Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Decls in Loop
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
SRS  
View profile  
 More options Apr 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: SRS <sr...@my-deja.com>
Date: 2000/04/30
Subject: Decls in Loop
I'd like to put a declaration in the Loop Facility, something like this:

    (loop
        :for x :from 1 :to 10
        :do (declare (fixnum x))
            (print x))

but this doesn't seem to work. It is, however, possible to put decls in
other iteration constructs, like:

    (do ((x 1 (+ x 1)))
        ((> x 10))
        (declare (fixnum x))
        (print x))

Is it impossible to put declarations in Loop? If so, is there a reason
why, or have the folks at X3J13 overlooked it?

--SRS

Sent via Deja.com http://www.deja.com/
Before you buy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rainer Joswig  
View profile  
 More options Apr 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Rainer Joswig <rainer.jos...@ision.net>
Date: 2000/04/30
Subject: Re: Decls in Loop
In article <8ehcp8$b7...@nnrp1.deja.com>, SRS <sr...@my-deja.com>
wrote:

> I'd like to put a declaration in the Loop Facility, something like this:

>     (loop
>         :for x :from 1 :to 10
>         :do (declare (fixnum x))
>             (print x))

(loop for x fixnum from 1 to 10 do ...

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Apr 30 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 2000/04/30
Subject: Re: Decls in Loop
* SRS <sr...@my-deja.com>
| Is it impossible to put declarations in Loop?

  no, but it has a different syntax than other declarations:

(loop :for x :of-type fixnum :from 1 :to 100 :do ...)

  note that "fixnum" is not a loop keyword, but the symbol naming the
  type.  see 6.1.1.7 [Loop] Destructuring in the standard.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
SRS  
View profile  
 More options May 2 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: SRS <sr...@my-deja.com>
Date: 2000/05/02
Subject: Re: Decls in Loop
In article <3166093389825...@naggum.no>,
  Erik Naggum <e...@naggum.no> wrote:

> * SRS <sr...@my-deja.com>
> | Is it impossible to put declarations in Loop?

>   no, but it has a different syntax than other declarations:

> (loop :for x :of-type fixnum :from 1 :to 100 :do ...)

Thanks! But what about other, non-type, declarations, such as
    (special ...) or (inline ...)
Do I have to use
    (locally (declare (special x))
        (loop ...))

--SRS

Sent via Deja.com http://www.deja.com/
Before you buy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options May 2 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.no>
Date: 2000/05/02
Subject: Re: Decls in Loop
* SRS <sr...@my-deja.com>
| But what about other, non-type, declarations, ...

  Well, there's no special syntax for them, so you'd have to resort to
  declarations inherited from superior forms or within inferior forms.
  Please see the standard or other language reference on loop for the
  rich set of details on loop.

#:Erik


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »