I used to use 'andmap' in Scheme but I don't know what its equivalent is
in CL. Is there a built in function (or macro) that does the same thing?
Lowell
p.s. I'm also looking for an ormap equivalent
I'm familiar with every but it is not exactly what I'm looking for.
andmap is lazy and will not apply the function the the remaining list
elements once a nil value is found.
Lowell
Lars Brinkhoff wrote:
> Lowell <······@cs.ubc.ca> writes:
>
>>I used to use 'andmap' in Scheme but I don't know what its equivalent
>>is in CL. Is there a built in function (or macro) that does the same
>>thing?
>
>
> every (well, almost)
>
>
>>p.s. I'm also looking for an ormap equivalent
>
>
> some
>
> See
> http://www.lispworks.com/reference/HyperSpec/Body/f_everyc.htm
>
Lowell <······@cs.ubc.ca> writes:
> Lars Brinkhoff wrote:
> > Lowell <······@cs.ubc.ca> writes:
> > > I used to use 'andmap' in Scheme but I don't know what its equivalent
> > > is in CL.
> > http://www.lispworks.com/reference/HyperSpec/Body/f_everyc.htm
> I'm familiar with every but it is not exactly what I'm looking
> for. andmap is lazy and will not apply the function the the
> remaining list elements once a nil value is found.
From that web page:
every returns false as soon as any invocation of predicate returns
false. If the end of a sequence is reached, every returns true.
--
Lars Brinkhoff, Services for Unix, Linux, GCC, PDP-10, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
My bad! every will work!
Lowell
Lars Brinkhoff wrote:
> Lowell <······@cs.ubc.ca> writes:
>
>>Lars Brinkhoff wrote:
>>
>>>Lowell <······@cs.ubc.ca> writes:
>>>
>>>>I used to use 'andmap' in Scheme but I don't know what its equivalent
>>>>is in CL.
>>>
>>>http://www.lispworks.com/reference/HyperSpec/Body/f_everyc.htm
>>
>>I'm familiar with every but it is not exactly what I'm looking
>>for. andmap is lazy and will not apply the function the the
>>remaining list elements once a nil value is found.
>
>
> From that web page:
>
> every returns false as soon as any invocation of predicate returns
> false. If the end of a sequence is reached, every returns true.
>
Moreover, last I checked, 'andmap' and 'ormap' are not standard in
Scheme. EVERY (and SOME) are standard in Common Lisp.
Cheers
Marco
Lowell wrote:
> My bad! every will work!
>
> Lowell
>
> Lars Brinkhoff wrote:
>
>> Lowell <······@cs.ubc.ca> writes:
>>
>>> Lars Brinkhoff wrote:
>>>
>>>> Lowell <······@cs.ubc.ca> writes:
>>>>
>>>>> I used to use 'andmap' in Scheme but I don't know what its equivalent
>>>>> is in CL.
>>>>
>>>>
>>>> http://www.lispworks.com/reference/HyperSpec/Body/f_everyc.htm
>>>
>>>
>>> I'm familiar with every but it is not exactly what I'm looking
>>> for. andmap is lazy and will not apply the function the the
>>> remaining list elements once a nil value is found.
>>
>>
>>
>> From that web page:
>>
>> every returns false as soon as any invocation of predicate returns
>> false. If the end of a sequence is reached, every returns true.
>>
>