m...@bellatlantic.net (Michael Naunton) writes: > I want to write something like
> (apply #'or alist)
For all but the most pathological alists (i.e., association lists), FIRST will usually do the trick here. :-)
Maybe you meant (apply #'or list).
> 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?
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)))
...
In the rare situation that I've had a system where this is common, I have usually written a *OR or *AND function.
It's unfair to take an arbitrary action and complain that you have to play "guess the word" when the thing you want to do is not even expressable in most other languages. The reason it's called a programming language is that sometimes you have to program.
> It's unfair to take an arbitrary action and complain that you have to > play "guess the word" when the thing you want to do is not even expressable > in most other languages.
um, don't tempt the perl hackers who may be listening in. if there is some part of common lisp perl programmers want but don't yet have, it will show up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
oz -- you take a banana, you get a lunar landscape. -- j. van wijk
> Kent M Pitman: > ... > > It's unfair to take an arbitrary action and complain that you have to > > play "guess the word" when the thing you want to do is not even expressable > > in most other languages.
> um, don't tempt the perl hackers who may be listening in. if there is some > part of common lisp perl programmers want but don't yet have, it will show > up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
As it did in a Scheme SRFI a few years ago :)
Cheers
-- Marco Antoniotti ======================================================== NYU Courant Bioinformatics Group tel. +1 - 212 - 998 3488 719 Broadway 12th Floor fax +1 - 212 - 995 4122 New York, NY 10003, USA http://bioinformatics.cat.nyu.edu "Hello New York! We'll do what we can!" Bill Murray in `Ghostbusters'.
ozan s yigit wrote: >Kent M Pitman: >> It's unfair to take an arbitrary action and complain that you have to >> play "guess the word" when the thing you want to do is not even expressable >> in most other languages.
>um, don't tempt the perl hackers who may be listening in. if there is some >part of common lisp perl programmers want but don't yet have, it will show >up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
yes, but we don't care. they haven't even got the underlying basics (such as types) but want catchy idioms. only perl hackers are proud of this post-modern our-parser-understands-every-shit aeh we-do-it-all thing.
>For all but the most pathological alists (i.e., association lists), >FIRST will usually do the trick here. :-)
Thank you, after reading previous posts on the topic of naming, I will henceforth call a list a list.
<snip>
>In the rare situation that I've had a system where this is common, I >have usually written a *OR or *AND function. >It's unfair to take an arbitrary action and complain that you have to >play "guess the word" when the thing you want to do is not even expressable >in most other languages. The reason it's called a programming language >is that sometimes you have to program.
But, every other arbitrary action I've wanted to take has had a terse or idiomatic expression in Common Lisp :)
On 09 Apr 2002 15:41:29 -0400, ozan s yigit <o...@blue.cs.yorku.ca> wrote:
> um, don't tempt the perl hackers who may be listening in. if there is some > part of common lisp perl programmers want but don't yet have, it will show > up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
Hmmm... does this imply that Mr. Wall's opinion on Lisp changed in some way?
Paolo Amoroso wrote: >On 09 Apr 2002 15:41:29 -0400, ozan s yigit <o...@blue.cs.yorku.ca> wrote: >> um, don't tempt the perl hackers who may be listening in. if there is some >> part of common lisp perl programmers want but don't yet have, it will show >> up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
>Hmmm... does this imply that Mr. Wall's opinion on Lisp changed in some >way?
>> um, don't tempt the perl hackers who may be listening in. if there is some >> part of common lisp perl programmers want but don't yet have, it will show >> up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
>Hmmm... does this imply that Mr. Wall's opinion on Lisp changed in some >way?
I believe Larry's objection to Lisp has always been entirely on syntactic grounds.
> In article <jQG0PHyI+3cOl+J5WfuR+vicL...@4ax.com>, > Paolo Amoroso <amor...@mclink.it> wrote: > >On 09 Apr 2002 15:41:29 -0400, ozan s yigit <o...@blue.cs.yorku.ca> wrote:
> >> um, don't tempt the perl hackers who may be listening in. if there is some > >> part of common lisp perl programmers want but don't yet have, it will show > >> up in a perl6 rfc soon. :) [obhref: http://dev.perl.org/rfc/]
> >Hmmm... does this imply that Mr. Wall's opinion on Lisp changed in some > >way?
> I believe Larry's objection to Lisp has always been entirely on > syntactic grounds.
Really? What about this one?
"Lispers are among the best grads of the Sweep-It-Under-Someone-Else's-Carpet School of Simulated Simplicity. [Was that sufficiently incendiary? :-)]"
This to me looks as if he's had an overdose of Scheme when he was younger... :)
> > I believe Larry's objection to Lisp has always been entirely on > > syntactic grounds.
> Really? What about this one?
> "Lispers are among the best grads of the > Sweep-It-Under-Someone-Else's-Carpet School of Simulated > Simplicity. [Was that sufficiently incendiary? :-)]"
that was a 92 post. CL was not quite what it is today. :)
> This to me looks as if he's had an overdose of Scheme when he was > younger... :)
i think he only paid attention to scheme after he had already designed and implemented perl. [btw, an important distinction about him is that he articulates various linguistic aspects of his language, and why he thinks it works well for programmers, eg. www.wall.org/~larry/natural.html or state of the onion addresses. maybe his overdose is something else. :-]
* ozan s yigit <o...@blue.cs.yorku.ca> | that was a 92 post. CL was not quite what it is today. :)
It is still much more descriptive of people's experiences with Scheme. Even in 1992, Common Lisp was a real programming language suitable for production use. It is unlikely that anyone would seriously argue against Common Lisp at that time as being "simulated simplicity". That fake idea of "elegance" and "simplicity" has always been something to associated with Scheme and no other Lisp-lookalike.
| i think he only paid attention to scheme after he had already designed | and implemented perl. [btw, an important distinction about him is that he | articulates various linguistic aspects of his language, and why he thinks | it works well for programmers, eg. www.wall.org/~larry/natural.html or | state of the onion addresses. maybe his overdose is something else. :-]
I think the Common Lisp designers were years ahead of him, there. The Scheme folks obviously were not, focusing instead on formal semantics. It is kind of funny how much Perl has "stolen" from Common Lisp (but not from Scheme). Both Common Lisp and Perl aim to be practical and useful.
/// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.
On 15 Apr 2002 10:45:23 -0400, ozan s yigit <o...@blue.cs.yorku.ca> wrote:
[about Larry Wall]
> and implemented perl. [btw, an important distinction about him is that he > articulates various linguistic aspects of his language, and why he thinks > it works well for programmers, eg. www.wall.org/~larry/natural.html or
Anybody can easily create a software system that is a mess, and then justify it by claiming that he purposely designed it that way in order to mimic real life, which is well known to be a mess :)