Alan Manuel Gloria: > Wait, the implementation does not seem correct... What?! A bug? How could that happen :-) ?
> parse-hash is not assured of leaving the port in a decent state if it > returns #f; i.e. it could consume the character after the #. The > current Guile implementation behaves decently, but the comments at the > top of the file don't reflect that. I think it would be better to > copy even more of process-sharp's code rather than calling into > process-sharp, so that the standard Scheme syntaxes are considered > *before* calling parse-hash. > > I suppose this is due to a desire to reduce the code size by not > rewriting process-sharp. Yes, you're right. > How about, making process-sharp-comment-tag the more "basic" function, > and having process-sharp be: > > (define (process-sharp no-indent-read fake-port) > (let ((rv (process-sharp-comment-tag no-indent-read fake-port))) > (if (eq? rv comment-tag) > (no-indent-read fake-port) > rv))) > > Of course, comment-tag still "infects" underlying read, but I think > that's acceptable... No, I think it's really important that comment-tag be absolutely absent from the lower levels. It doesn't matter for *this* code, but I think it's important that we be *sure* that implementations can create the tiers in stages. In particular, if neoteric-expressions are built into a system, it should be possible to build sweet-expressions on top *WITHOUT* having to re-implement neoteric-expressions. Having to re-implement "#" for sweet-expressions is bad, but is easier to live with than having to re-implement everything. Every piece you have to re-implement means you either lose the implementation extensions or that you have to rewrite those extensions. Ugh either way. By carefully *NOT* alllowing comment-tag in curly-infix or neoteric, we can confirm that this goal was actually met. > Alternatively, make process-sharp return a *list*, i.e. use the same > calling convention for parse-hash. Then in the underlying-read, check > for '() and recurse if it is, or return the car if not. This > alternative removes comment-tag as well, and you can return > comment-tag into process-sharp-comment-tag by simply converting '() -> > comment-tag and (a) -> a That sounds like the better approach. I've got to sleep. Feel free to make that happen! --- 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