In article <·························@news.skynet.be>,
Lieven <···············@hotmail.com> wrote:
> Is there a statement in LISP like the 'begin' in Scheme?
PROGN is the closest, I think.
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Hello!
Lieven <···············@hotmail.com> wrote:
>Is there a statement in LISP like the 'begin' in Scheme?
progn.
And nowadays, it's Lisp without shouting.
Kind regards,
Hannah.
······@schlund.de (Hannah Schroeter) writes:
> Hello!
>
> Lieven <···············@hotmail.com> wrote:
> >Is there a statement in LISP like the 'begin' in Scheme?
>
> progn.
>
> And nowadays, it's Lisp without shouting.
Well, all implementations still come by the LISP nickname, or at least
an uppercase nickname:
[1]> (PACKAGE-NICKNAMES :COMMON-LISP)
("LISP" "CL")
--
__Pascal Bourguignon__
Pascal Bourguignon <····@mouse-potato.com> wrote:
> Well, all implementations still come by the LISP nickname, or at least
> an uppercase nickname:
>
> [1]> (PACKAGE-NICKNAMES :COMMON-LISP)
> ("LISP" "CL")
Make that "some", and possibly non-conformant as well: 11.1.2 lists the
nicknames of standardized packages -- no "LISP" there -- but doesn't
explicitly say that the list is exhaustive.
CL-USER(1): (package-nicknames :cl)
("CL")
(Yeah, I realize that was tongue-in-cheek. Just feeling pedantic.)
Cheers,
-- Nikodemus
Lieven <···············@hotmail.com> writes:
> Is there a statement in LISP like the 'begin' in Scheme?
Yes. It's called PROGN. (Which is a pretty dreadful name,
but frankly so is BEGIN.)
--
Gareth McCaughan
.sig under construc
···············@gmail.com wrote:
>
> As others have stated, PROGN. But note that:
>
> (PROGN)
>
> (i.e, there are no forms to evaluate) is fine Common Lisp, but:
> (BEGIN)
>
> is incorrect in R5RS Scheme.
It took me a little while to figure out where the value of the
form (PROGN) was defined in the CL spec.
Paul
Paul Dietz <············@motorola.com> writes:
> ···············@gmail.com wrote:
>>
>> As others have stated, PROGN. But note that:
>>
>> (PROGN)
>>
>> (i.e, there are no forms to evaluate) is fine Common Lisp, but:
>> (BEGIN)
>>
>> is incorrect in R5RS Scheme.
>
> It took me a little while to figure out where the value of the
> form (PROGN) was defined in the CL spec.
Found it. That *was* a bit tricky. And it's so tempting to just use
the non-normative (progn) => NIL in the PROGN examples.
-Peter
--
Peter Seibel ·····@javamonkey.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
On Fri, 12 Nov 2004 10:21:16 -0600, Paul Dietz <············@motorola.com> wrote:
> It took me a little while to figure out where the value of the form
> (PROGN) was defined in the CL spec.
And where is it?
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
Edi Weitz wrote:
>
> On Fri, 12 Nov 2004 10:21:16 -0600, Paul Dietz <············@motorola.com> wrote:
>
> > It took me a little while to figure out where the value of the form
> > (PROGN) was defined in the CL spec.
>
> And where is it?
In the glossary entry for 'value' (1.c).
Paul
Edi Weitz <········@agharta.de> writes:
> On Fri, 12 Nov 2004 10:21:16 -0600, Paul Dietz <············@motorola.com> wrote:
>
>> It took me a little while to figure out where the value of the form
>> (PROGN) was defined in the CL spec.
>
> And where is it?
In the glossary definition for "value" (1. c.).
Hi Lieven,
> Is there a statement in LISP like the 'begin' in Scheme?
There's PROGN, which evaluates all the forms in order and returns the
value or values of the last form.
Common Lisp has better defined evaluation semantics than Scheme. A
function's arguments are always evaluated from left to right. It's looking
more likely that Scheme's undefined evaluation order will eventually be
addressed: <http://www.schemers.org/Documents/Standards/Charter/>
The Revised R6RS Status Report
...
Below is the current list of issues, without each editor's position.
Note that this list is still open to be expanded as new issues arise in
the design process.
...
Extensions that would break implementation-specific features
* specify evaluation order
However the preliminary decision for R6RS is:
* specify evaluation order
Evaluation order will be unspecified for procedure calls and let form.
Regards,
Adam
···············@gmail.com wrote:
> As others have stated, PROGN. But note that:
>
> (PROGN)
>
> (i.e, there are no forms to evaluate) is fine Common Lisp, but:
> (BEGIN)
>
> is incorrect in R5RS Scheme.
I think it is legal, if one views (begin) as a <definition>.
Here is the grammar from 7.1.6 in R5RS:
<program> -> <command or definition>*
<command or definition> -> <command>
| <definition>
| <syntax defintion>
| (begin <command or definition>+)
<definition> -> (define <variable> <expression>)
| (define (<variable> <def formals>) <body>)
| (begin <definition>*)
A <program> can consist of one <command or defintion>.
A <command or definition> can be a <definition>.
A <definition> can be a (begin <definition>*).
A (begin <definition>*) can be (begin).
--
Jens Axel Søgaard
Jens Axel S�gaard <······@soegaard.net> writes:
>> As others have stated, PROGN. But note that:
>> (PROGN)
>> (i.e, there are no forms to evaluate) is fine Common Lisp, but:
>> (BEGIN)
>> is incorrect in R5RS Scheme.
>
> I think it is legal, if one views (begin) as a <definition>.
It's legal only at toplevel and among internal definitions.
It's not legal as an expression.
Scheme has 3 kinds of 'begin'.
--
__("< Marcin Kowalczyk
\__/ ······@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/