From: Lieven
Subject: begin
Date: 
Message-ID: <4193faed$0$21242$ba620e4c@news.skynet.be>
Is there a statement in LISP like the 'begin' in Scheme?

From: Barry Margolin
Subject: Re: begin
Date: 
Message-ID: <barmar-CEF51C.19114511112004@comcast.dca.giganews.com>
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 ***
From: Hannah Schroeter
Subject: Re: begin
Date: 
Message-ID: <cn0ull$oh9$1@c3po.use.schlund.de>
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.
From: Surendra Singhi
Subject: Re: begin
Date: 
Message-ID: <cn17j0$jfd$1@news.asu.edu>
Hannah Schroeter wrote:

> Hello!
> 
> Lieven  <···············@hotmail.com> wrote:
> 
>>Is there a statement in LISP like the 'begin' in Scheme?
> 
> 
> progn.

Block
http://www.lisp.org/HyperSpec/Body/speope_block.html#block


-- 
Surendra Singhi

www.public.asu.edu/~sksinghi
From: Pascal Bourguignon
Subject: Re: begin
Date: 
Message-ID: <87fz3fg9qf.fsf@naiad.informatimago.com>
······@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__
From: Nikodemus Siivola
Subject: Re: begin
Date: 
Message-ID: <cn24jr$fkqsm$2@midnight.cs.hut.fi>
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
From: Gareth McCaughan
Subject: Re: begin
Date: 
Message-ID: <87lld7539i.fsf@g.mccaughan.ntlworld.com>
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
From: Paul Dietz
Subject: Re: begin
Date: 
Message-ID: <4194E2FC.75402FBA@motorola.com>
···············@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
From: Peter Seibel
Subject: Re: begin
Date: 
Message-ID: <m3actn2c68.fsf@javamonkey.com>
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
From: Edi Weitz
Subject: Re: begin
Date: 
Message-ID: <ur7my6h3p.fsf@agharta.de>
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")
From: Paul Dietz
Subject: Re: begin
Date: 
Message-ID: <41950F87.5C1B48DE@motorola.com>
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
From: Kalle Olavi Niemitalo
Subject: Re: begin
Date: 
Message-ID: <87y8h6ajrq.fsf@Astalo.kon.iki.fi>
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.).
From: Adam Warner
Subject: Re: begin
Date: 
Message-ID: <pan.2004.11.12.00.07.21.812737@consulting.net.nz>
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
From: Jens Axel Søgaard
Subject: Re: begin
Date: 
Message-ID: <4194c790$0$297$edfadb0f@dread11.news.tele.dk>
···············@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
From: Marcin 'Qrczak' Kowalczyk
Subject: Re: begin
Date: 
Message-ID: <871xezhwp2.fsf@qrnik.zagroda>
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/