[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reader hacks

    Date: Mon, 23 Dec 85 16:47 EST
    From: Guy Steele <gls@THINK-AQUINAS.ARPA>

    I am writing code for reader macros and find I need the following
    (1) A predicate that is true of whitespace characters and false
	of all others.  The problem is that
	    (member foo '(#\Space #\Newline))
	doesn't cover tabs, etc., and
	    (member foo '(#\Space #\Newline #\Tab #\Form))
	is not completely portable because of the semi-standard
	character names.

Is this something different from
  (or (char-equal char #\space)
      (not (graphic-char-p char))) ?

    (2) I find I can't easily write myself something akin to
	READ-DELIMITED-LIST that handles dotted lists because of
	the problem of recognizing all-dots tokens.  PEEK-CHAR can
	only peek one ahead, so I can't tell whether there is a
	space after a dot before calling READ recursively.

How about a way (a special variable?) to turn off the somewhat silly
restriction that you can't have a symbol named .?  Alternatively,
how about a function that does the token-isolating portion of READ
but not the printed-representation-to-object conversion portion of