This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Serious eq? bug?


Wolfgang Hukriede <whukriede@ifm.uni-kiel.de> writes:

 > >  Consider the following:
 > >  
 > >     hjstein@bacall:~$ guile
 > >     guile> (eq? (string->symbol "-a") '-a)
 > >     #t
 > >     guile> (eq? (string->symbol "-b") '-b)
 > >     #t
 > >     guile> (eq? (string->symbol "-i") '-i)
 > >     #f
 > 
 > >  Is this expected behavior for an R4RS scheme which supports complex
 > >  number?  
 > 
 > Yes. Since  (number? '-i)  ==> #t
 > 
 > >  If so, it's a real pain in the ass for command line
 > >  processing...
 > 
 > You need to compare strings.  You will have to use equal? or string=?,
 > because eq? is not usable with strings.  Afait, -a and -b aren't
 > portable identifiers either.  See the report.

That's annoying because case uses eq?.

-- 
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il