Hi all,

Axel Svensson pointed out in a recent IRC discussion, that the current
implementation of the token-mode of the 'read' function in PicoLisp does
not distinguish between strings and punctuation.

This makes 'read' less useful in certain cases.

Therefore, I propose to change 'read', so that it will return a list of
characters instead of a string (i.e. a list of single-char transient
symbols instead of a multi-char transient symbol).

Thus,

   : (make (do 5 (link (read "_"))))
   {"abc"+123}
   -> ("{" "abc" "+" 123 "}")

will change to

   : (make (do 5 (link (read "_"))))
   {"abc"+123}
   -> ("{" ("a" "b" "c") "+" 123 "}")

In addition to now being able to distinguish punctuation like "{" from
strings like ("a" "b" "c"), this has the advantage that these lists of
characters can be directly processed with list functions (without
needing to 'chop' them first).

This change might possibly break existing applications, but I suspect it
is not a heavily used feature ;-)

Any objections?

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to