I said:
> > Ah, I think I understand the issue better now.  The problem is that in 
> > sweet-expressions, if you're in the hash reader, and you read a comment, 
> > you want to recurse to *some* reader, but it's not always clear which one.  
> > So the current code passes that info back up, for someone else to figure 
> > out.  Here are examples?
> >
> > ; Indentation active after #-comment read:
> > #| comment |#
> > foo bar bat
> > => (foo bar bat)
> >
> > ; Indentation inactive after #-comment read:
> > foo
> > ! bar #| comment |# bat big
> > => (foo (bar bat big))
> > Do I have it now?


Alan Manuel Gloria:
> You're missing the worst case:
> 
> foo
> ! bar nitz #|comment|#
> ! quux

Ah, I see.

Ugh, all of this would be trivial if there was a standard one-character 
unread-char that you could use after a peek. Then the sweet reader could 
read-char the "#", peek to see if "|" follows, and then either handle it 
ourselves (if |) or unread and recurse (if not).  A two-character "peekahead" 
would also work.  I think we should note that in the comments, that we've 
implemented a *portable* reader, but that other capabilities would make that 
unnecessary.

...
> Nope.  Anyway, passing in a function is congruent to returning some
> value; that's essentially the difference between continuation-passing
> style and normal function call.  So you either pass in two readers (a
> reader for sub-elements, and a reader to handle the case where the
> hash-parser got a comment) or you delineate a special return value for
> the second case.  The smaller-code-change is the second solution I
> think, if only because in my experience CPS causes code size
> explosion.

Okay.  I don't want to go full-bore on CPS for other reasons, anyway.  Scheme's 
tail-recursion makes CPS work well (that was the fundamental insight of 
Scheme), but I want the code to be easily ported to other languages (Common 
Lisp, etc.) which don't promise proper tail recursion.  Eventually people may 
rewrite code in the other languages, but we want them to be able to quickly 
bootstrap something that runs.

--- David A. Wheeler

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to