Re: Case-sensitivity goals, policy and implementation



Jim> Because Lisp would do all that for us automatically. What you are
Jim> proposing is to manually re-implement the effects of
Jim> readtable-case :invert in the maxima code. Why bother?

ole> Does the maxima reader/parser acutally and consistently use the
ole> lisp reader? Or does it rather do things like
ole> (find-symbol (concatenate 'string "$" (string-upcase input))
ole> :maxima)

Raymond> That's always a possibility, but I think maxima uses implode1
Raymond> to convert input into a symbol.  I'm playing around right now
Raymond> with modifying implode1 to use a readtable-case of :invert to
Raymond> see if that is even close to what we want.

The version of IMPLODE1 that I'm looking at calls INTERN, so there is
no READing involved and hence no *READTABLE*, right? In my
understanding, there are now two possible ways of implementing the
READTABLE-CASE :INVERT semantics:

1. Replace any explicit case conversion and INTERM wit a call to
   READ-FROM-STRING with *READTABLE* and *PACKAGE* dynamically bound

2. Explicitly code the :INVERT logic and call INTERN, ie something like:
   (cond ((not (some #'upper-case-p string)) (intern (string-upcase string)))
         ((not (some #'lower-case-p string)) (intern (string-downcase string)))
         (t (intern string)))

(I still think *PACKAGE* should be explicit)

BTW, I'm wondering about a possible bug in IMPLODE1 - it seems to call
INTERN repeatedly with the same string *STRING-FOR-IMPLODE*, modifying
the string between each call? As I understand the Hyperspec, the
consequences are indefined...

Ole