> 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?
You're missing the worst case: foo ! bar nitz #|comment|# ! quux > > The obvious alternative is to pass that info down the call chain (new > parameters everywhere!); that'd eliminate the problem. Adding new parameters > everywhere is not always a great answer, but in our case, we're *already* > passing the "other reader" down; couldn't we use that? 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. > > When implementation is complicated, I also look to see if we can redefine the > spec to make it easy. I'm not sure that's possible in this case, though it'd > be great if it was. > >> > How ready does the implementation need to be for us to start the SRFI >> > process? >> >> I think we just need some implementation that a full reader can call >> (probably providing its own read function, the way read-at-curly now >> works). We can then give a fuller replacement in Guile to show how it >> would be used / integrated into an implementation's reader. > > Ah. Well in *that* case, we've got that right now. > > --- 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