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

Reading lisp expressions



  I have an interactive function that I use to examine my data structures
in lisp.  One of the function's commands allows the user to type a lisp
expression and print its results (= one iteration of the read-eval-print loop).
Unfortunately, this causes a problem with the listener.  The function
executes:
  (print (eval (read t nil nil)))
which works OK, but then the default mark in the listener where I ran the
function gets moved to the opening parenthesis of the function and the next
character typed causes the following error:
> Error: Can't throw to tag CCL::%RE-READ .
> While executing: CCL::STREAM-TYI-NO-LINEMODE

Then the reader starts reading text that was output to the listener from
before the call to read, and my program really gets screwed up.

  A couple of weeks (months?) ago on info-macl some people mentioned a function
named ccl::read-top-level-form or something similar that was supposed to work
better and allow the user to use cut, paste and other fred commands to
get the input expression.  I hunted around using apropos, but couldn't find it.
Would this fix my problem?

  Since it seems that several people have had the same problem, perhaps the
folks at Apple should document the appropriate read-top-level-form function.

         - John Canning