You could use a dynamically-scoped variable (don't remember what they're
called in CL) to pass back the "reason for stopping" return value, and
return the read-in datum from the read implementation. Dynamically-scoped
variables are even run-time-stack lifetimes, so they're highly appropriate
for simulating return values.
On Tue, Apr 30, 2013 at 5:31 AM, David A. Wheeler <dwhee...@dwheeler.com>wrote:
> I'd earlier said:
> > I'm looking for advice on how to implement, in Common Lisp, the
> sweet-expression semantics for {backquote,comma,comma-at}+whitespace.
>
> Just to document my research...
>
> Common Lisp can't unget multiple characters, but it does have the ability
> "make-concatenated-stream". You can create a stream out of a string and
> park that in front of another stream, resulting in a somewhat similar
> result:
> http://www.lispworks.com/documentation/HyperSpec/Body/f_mk_con.htm
>
> That lets me control what goes *into* read... but *not* the results that
> come *out* of read. Sigh. The fundamental problem is that "read" has a
> fixed interface, and I need read to *also* return any new indentation, if I
> want to be able to use backquote with indentation-sensitive constructs.
> And I do.
>
> So it looks like I'll have to re-implement backquote and comma in Common
> Lisp if I want a portable thread-safe Common Lisp implementation. The good
> news is that there is such an implementation:
> > http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node367.html
>
> On second glance it doesn't look *too* bad. Thankfully, this
> implementation can be in its own file.
>
> --- David A. Wheeler
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> Readable-discuss mailing list
> Readable-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/readable-discuss
>
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss