Need to change parse-hash in reference implementation David A. Wheeler (04 Apr 2013 22:46 UTC)
Re: Need to change parse-hash in reference implementation Alan Manuel Gloria (05 Apr 2013 04:52 UTC)
Re: Need to change parse-hash in reference implementation David A. Wheeler (05 Apr 2013 13:01 UTC)

Need to change parse-hash in reference implementation David A. Wheeler 04 Apr 2013 22:46 UTC

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