[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.lisp

Re: Help: I can't find a simple CL function/idiom

William James

2/13/2016 9:26:00 PM

Kent M. Pitman wrote:

> > but of course #'or is a macro. I wound up writing
> >
> > (some (lambda (e) e) alist)
> >
> > but that seems a bit strained. I've played "guess the word" in the
> > HyperSpec, but can't find the idiom I want.
>
> What's it called in other languages?



He doesn't really want to know. He hopes that there is no such
facility in other languages.

MatzLisp (Ruby):

[nil,2,nil].any?
==>true
[nil,false,nil].any?
==>false
[2,:foo,3].any?{|x| x.is_a? Symbol}
==>true


>
> Lisp has a half dozen ultra trivial ways of saying this, which for as
> often as it seems to come up seems more than adequate.
>
> (loop for x in list thereis x)
>
> (find-if-not #'null x) ;or #'not
>
> (find-if #'identity x)
>
> (some #'identity x)
>
> (eval `(or ,@(mapcar #'(lambda (x) `',x) list)))


--
When there is nothing left on earth but individuals without any roots, sans
racial identity or pride, deprived of any religion, and existing only to be a
consumer, the Jews---who, however, will have kept their own traditions and
identity---will be recognized by all as "God's Chosen People."
--- Herve Ryssen
1 Answer

William James

2/13/2016 9:37:00 PM

0

WJ wrote:

> Kent M. Pitman wrote:
>
> > > but of course #'or is a macro. I wound up writing
> > >
> > > (some (lambda (e) e) alist)
> > >
> > > but that seems a bit strained. I've played "guess the word" in the
> > > HyperSpec, but can't find the idiom I want.
> >
> > What's it called in other languages?
>
>
>
> He doesn't really want to know. He hopes that there is no such
> facility in other languages.
>
> MatzLisp (Ruby):
>
> [nil,2,nil].any?
> ==>true
> [nil,false,nil].any?
> ==>false
> [2,:foo,3].any?{|x| x.is_a? Symbol}
> ==>true
>
>
> >
> > Lisp has a half dozen ultra trivial ways of saying this,


Note that he does not say CL or Common Lisp, but simply Lisp.

McCarthy, the inventor of Lisp, insisted that this should not be done.
All worshippers of CL (COBOL-Like) have nothing but contempt for McCarthy
and for Lispy languages.

Their only allegiance is to their beetle-browed deity, CL (COBOL-Like).


--
[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...)