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

Re: Collection operations taking pseudo-predicates?



In article <3C986B2E.B8FA6711@lucent.com>,
 Gabor Greif <ggreif@lucent.com> wrote:

> http://www.gwydiondylan.org/drm/drm_102.htm#HEADING102-0
> 
> states under
> 
> 	choose [Open Generic Function]
> 	...
> 	Returns a sequence containing those elements of source-sequence that satisfy 
> predicate.
> 	...
> 
> 
> I wonder if a proper predicate is needed (i.e. one returning a <boolean>) or 
> a pseudo-predicate
> ( whose result is compared against #f) is sufficient.
> 
> 
> Anybody who can shed light on this?

This is a theoretical question?

Clearly you have the Gwydion source, which says:

  if (predicate(elem)) pair(elem, result) else result end

i.e. #f or non #f

-- Bruce