[Ecls-list] BUG: incorrect checking of EQL types
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Sun Dec 18 17:59:07 UTC 2011
I think we have discussed this before in the mailing list. EQL uses EQL for
type checking and two constants need not be EQL. For instance, two
bitvectors which are EQUAL are not EQL because they are read at different
times
$ ecl -norc
ECL (Embeddable Common-Lisp) 11.1.1
(git:d4f3d0d3307e73e9034d0348777dbabc8798534b)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.
Top level in: #<process TOP-LEVEL>.
> (eql #*1 #*1)
NIL
> (typep #*1 '(eql #*1))
NIL
>
$ sblc
bash: sblc: command not found
$ sbcl
This is SBCL 1.0.53, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (eql #*1 #*1)
NIL
* (typep #*1 '(eql #*1))
NIL
On Sun, Dec 18, 2011 at 6:19 PM, Eric Marsden <eric.marsden at free.fr> wrote:
> Hi,
>
> A bug in type checking.
>
> ,----
> | ECL (Embeddable Common-Lisp) 11.1.1
> (git:e786001fd99e2713feacf53484c4350442f8552a)
> | > (defun foo (a)
> | (declare (type (eql #*1) a))
> | a)
> | FOO
> | > (compile 'foo)
> | ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
> | ;;;
> | ;;; End of Pass 1.
> | FOO
> | NIL
> | NIL
> | > (foo #*1)
> | Condition of type: TYPE-ERROR
> | #*1 is not of type (EQL #*1).
> `----
>
> --
> Eric Marsden
>
>
>
> ------------------------------------------------------------------------------
> Learn Windows Azure Live! Tuesday, Dec 13, 2011
> Microsoft is holding a special Learn Windows Azure training event for
> developers. It will provide a great way to learn Windows Azure and what it
> provides. You can attend the event by watching it streamed LIVE online.
> Learn more at http://p.sf.net/sfu/ms-windowsazure
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20111218/9cf42035/attachment.html>
More information about the ecl-devel
mailing list