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
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.
You do not have the permission required to post.
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.
You do not have the permission required to post.
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.
You do not have the permission required to post.
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.
You do not have the permission required to post.
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.
You do not have the permission required to post.