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

Need to change parse-hash in reference implementation

This page is part of the web mail archives of SRFI 110 from before July 7th, 2015. The new archives for SRFI 110 contain all messages, not just those from before July 7th, 2015.

I think we need to modify the reference implementation, in particular, parse-hash's calling conventions.  This procedure is called when something begins with "#", since a whole lot 'o stuff starts with "#".

Currently, it only returns #f, () for comments, and (value) for values.  That means that only neoteric-expressions can follow them quasisyntax.  But if we're going to allow expressions like this:
! ... stuff ...
In the same way we handle quote ('), then parse-hash needs to be able to return something that indicates that it found a #' followed by whitespace.  That way, it can let the sweet-expression processor handle the rest. To do that, we need to expand what, exactly, parse-hash and friends can return.

I suggest using the same return convention as existing procedures like n_expr, which return "(stopper value)".  If stopper is 'normal, it's just a normal value.  If stopper is 'abbrevw, then it is an abbreviation followed by whitespace, and "value" is what the abbreviation stands for (e.g., quote or quasisyntax).  This is how the code *already* works for quote, quasiquote, and so on, so it should be straightforward.

 --- David A. Wheeler