[Openmcl-devel] bug?
    Ben Hyde 
    bhyde at pobox.com
       
    Mon Dec  7 14:56:27 PST 2009
    
    
  
On Dec 7, 2009, at 5:36 PM, Paul Krueger wrote:
> Is the following a bug or does the standard permit the following
> behavior?
>
> Welcome to Clozure Common Lisp Version 1.5-dev-r13174M-trunk
> (DarwinX8664)!
> ?  (setf ls (list 1 2 3 'a 0 1 2 3))
> (1 2 3 A 0 1 2 3)
> ? (plusp 0)
> NIL
> ? (find-if-not #'plusp ls :from-end t)
>> Error: value A is not of the expected type REAL.
>> While executing: PLUSP, in process Listener-2(7).
>> Type cmd-. to abort, cmd-\ for a list of available restarts.
>> Type :? for other options.
> 1 >
> ?
>
> I guess I would have expected that if the ":from-end t" was honored
> that #'plusp would never be called on the 'a element, but obviously
> that isn't the case.
While the name ":from-end" certainly suggests the behavior you and I'd  
expect, the spec reads "If from-end is true, then the result is the  
rightmost element that satisfies the test." and do seems to license  
that behavior.   The portablity gods may reward you if you suppress  
your very natural expectations.  SBCL exhibits the same behavior.
    
    
More information about the Openmcl-devel
mailing list