[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET
From: |
Kai Kaminski |
Subject: |
Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET |
Date: |
Tue, 26 Sep 2006 19:35:00 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) |
root <address@hidden> writes:
>> use lots of small functions. What is the difference between
>
> This defines 2 functions.
True.
>>
>> (defun bar (...)
>> (blah blub))
>>
>> (defun foo (...)
>> (let ((...))
>> (bar ...)))
>>
>
> This defines a function and a "top level form".
> The first expression is evaluated and returns a function.
> The second expression is immediately evaluated for effect.
No. The DO-BAR chunk is included in the FOO chunk. Hence (BLAH BLUB)
ends up in the body of FOO and is not a toplevel form. Of course, the
two snippets differ in that one defines a function and the other does
not. But in a Lisp program I'd very much prefer the former, since it's
easier to understand and to work with. If performance is an issue, an
INLINE-declaration might help.
>> and
>>
>> <<foo>>=
>> (defun foo (...)
>> (let ((...))
>> <<do-bar>>))
>> @
>>
>> <<do-bar>>=
>> (blah blub)
>> @
>
> Depending on the situation the value of the top level form
> could have other side effects.
It is not a toplevel form.
Kai
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, (continued)
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Ralf Hemmecke, 2006/09/22
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Kai Kaminski, 2006/09/22
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Ralf Hemmecke, 2006/09/22
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Kai Kaminski, 2006/09/22
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Ralf Hemmecke, 2006/09/22
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, root, 2006/09/26
- Message not available
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, root, 2006/09/26
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Kai Kaminski, 2006/09/26
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, root, 2006/09/26
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, root, 2006/09/26
- Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET,
Kai Kaminski <=
- RE: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Page, Bill, 2006/09/26
Re: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Frithjof Schulze, 2006/09/23
RE: [Axiom-developer] Literated VMLISP.LISP.PAMPHLET, Bill Page, 2006/09/23
[Axiom-developer] Pamphlet style (was: Literated VMLISP.LISP.PAMPHLET), Ralf Hemmecke, 2006/09/23