help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loop macro tutorial


From: Pascal J. Bourguignon
Subject: Re: loop macro tutorial
Date: Wed, 17 Jun 2009 18:26:01 +0200
User-agent: Gnus/5.101 (Gnus v5.10.10) Emacs/22.2 (gnu/linux)

Michal <rabbitko@tenbit.pl> writes:

> Hallo group members.
>
> with C-h f loop, i get:
> Valid clauses are:
>   for VAR from/upfrom/downfrom NUM to/upto/downto/above/below NUM by NUM,
>   for VAR in LIST by FUNC, for VAR on LIST by FUNC, for VAR = INIT then EXPR,
>   for VAR across ARRAY, repeat NUM, with VAR = INIT, while COND, until COND,
>   always COND, never COND, thereis COND, collect EXPR into VAR,
>   append EXPR into VAR, nconc EXPR into VAR, sum EXPR into VAR,
>   count EXPR into VAR, maximize EXPR into VAR, minimize EXPR into VAR,
>   if COND clause [and clause]... else clause [and clause...],
>   unless COND clause [and clause]... else clause [and clause...],
>   do EXPRS..., initially EXPRS..., finally EXPRS..., return EXPR,
>   finally return EXPR, named NAME.
>
>
> I does not tell me anything.
> Do You know any sites that would explain 'loop' in more clear way?

It comes from CLtL LOOP, which we find in Common Lisp too:

   http://www.lispworks.com/reference/HyperSpec/Body/m_loop.htm
   http://www.lispworks.com/documentation/HyperSpec/Body/06_a.htm


   http://www.gigamonkeys.com/book/loop-for-black-belts.html

There are some small differences between CLtL LOOP and Common Lisp
LOOP (eg CL LOOP doesn't accept finally return EXPR, you have to write
in CL finally (return EXPR)), and of course, there are the
restrictions of emacs lisp (only dynamic bindings, no lexical
binding), and you cannot use keywords for the loop key words, but
otherwise they're quite similar, so you can use the above documents to
learn how to use emacs lisp loop.

-- 
__Pascal Bourguignon__


reply via email to

[Prev in Thread] Current Thread [Next in Thread]