Lisp HUG Maillist Archive

Delivery bug on MacOSX ?

Hello,

I observe the following strange behavior when delivering the  
following code:
(defun do-it ()
	;(format *error-output* "~&Performing illegal operation")
	(assoc 'a '(b c d)))

This function complains:
  `Error: Alist element B is not a cons or NIL'
when invoked from repl in windows, linux and mac os and when  
delivered under windows (lispworks 4.4.5) and linux (Lispworks  
4.4.6), but works (returns nil, of course) under mac os without any  
warnings/errors (Lispworks 4.4.6 for ppc and Lispworks 5.0.0 for  
intel/ppc).

Thanks,
  Khachik


Re: Delivery bug on MacOSX ?

Khachik Kocharyan wrote:

> I observe the following strange behavior when delivering the
> following code:
> (defun do-it ()
> 	;(format *error-output* "~&Performing illegal operation")
> 	(assoc 'a '(b c d)))
>
> This function complains:
>   `Error: Alist element B is not a cons or NIL'

And rightly so.

ASSOC expects an association list, i.e. a list of conses, as its
second argument.  Your list (B C D) is not an association list.
That's a bug in your code, and I wouldn't call it strange behaviour
in Lispworks.

Arthur Lemmens


Re: Delivery bug on MacOSX ?

Khachik Kocharyan <khachik@zenteq.am> writes:

> I know what 'assoc' expects. The strangest thing is that the  
> delivered code works on Mac, with both lispworks 4 and 5. It  
> shouldn't work.

It shouldn't - but on the other hand I don't think the standard
specifies what assoc should do if you give it a list that's
not an association list (it only specifies the behaviour with
cons and nil elements).
--
  (espen)


Re: Delivery bug on MacOSX ?

Unable to parse email body. Email id is 6089

Updated at: 2020-12-10 08:47 UTC