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

enhancements



For all you hackers out there, more features... this about takes me to
the end of things I can do without making some kind of structure package
& a manual... so don't be too distressed about how random this all is...

- Read-macro characters don't act as break characters.  For example:
  (SET-SYNTAX #\? (LAMBDA (STREAM CH) `(QUESTION-MARK ,(READ STREAM))))
  With this definition, ?FOO reads in as (QUESTION-MARK FOO), but
  FOO? still reads in as the single symbol FOO?.

- (MDEBUG) puts you in a read-macroexpand-prettyprint loop.  Very handy
  if you're debugging macros.  Type any atom to exit.  This is likely
  to be replaced by a fancier facility in the future, but for now, it'll
  do.  (There is a MACRO-EXPAND routine but I'll only describe it if
  someone asks about it.)

- General I/O streams seem to work.  Soon PP will start indenting, and
  (FORMAT NIL ...) will work.  Even without these, see what you get:
  - (STRING->STREAM string) returns a stream from which you can READ or READC
    or whatever.
      (LET ((Z (STRING->STREAM "What (a win) ")))
	(LIST (READ Z) (READ Z)))
      =>  (WHAT (A WIN))
  - (WITH-OUTPUT-TO-STRING var . body) binds var to an output stream to
    which you can do WRITEC, PRINT, DISPLAY, FORMAT, etc.  Output is
    accumulated in a string, which is yielded as the value of the whole
    form.  E.g.
      (WITH-OUTPUT-TO-STRING FOO
	(WRITES FOO "What ")
	(PRINT '(A WIN) FOO)
	(WRITEC FOO #\.))
      => "What (A WIN)."
  - You can define your own streams using ENTITY-expressions.  See
    <F.T.TAU>STREAMS.TAU for examples.  Documentation forthcoming.