[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: LOOP and "anti-finally"?

William James

2/17/2016 9:39:00 PM

Arthur Lemmens wrote:

> Johan Kullstam wrote:
>
> > I find myself wanting to execute something in a loop *except for* the
> > last iteration. Is there some way to concisely express this?
>
> When you're looping through a list, you can use
>
> (loop for (thing . rest) on list
> when rest
> do (operate-on thing) ; this will not happen for the last thing in list
> ...)

MatzLisp (Ruby):

%w(a b c d).each_cons(2){|x,y| p x}
"a"
"b"
"c"


--
[A]n unholy alliance of leftists, capitalists, and Zionist supremacists has
schemed to promote immigration and miscegenation with the deliberate aim of
breeding us out of existence in our own homelands.... [T]he real aim stays the
same: the biggest genocide in human history.... --- Nick Griffin
(https://www.youtube.com/watch?v=K...)