[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need to change parse-hash in reference implementation
- To: dwheeler@xxxxxxxxxxxx
- Subject: Re: Need to change parse-hash in reference implementation
- From: Alan Manuel Gloria <almkglor@xxxxxxxxx>
- Date: Fri, 5 Apr 2013 12:52:46 +0800
- Cc: srfi-110 <srfi-110@xxxxxxxxxxxxxxxxx>
- Delivered-to: srfi-110@xxxxxxxxxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=z/oWcJ54cod//jrXaHVdQSq8a3uxDgagAfxP+QZIea8=; b=FktSDUow8aqdp1AyxKpkqoPVZBNsaoLZhQoqkNZ4gYsBtSIUMNZw+P2PpkP5eTf9GV FU0kUqST43nSnerN0Kjxs9x1c6+7qvi7ANbXdpMKCWjr6PSYf5MM1lwS7200MblEASKB 86sqUVf+xxhghQwZNcpRwdObe+ncykrrLg+EU+l+8Ma0R2CeITgKJgP+EwJtrFBl8m6q 8or8K7ouK4FI8dxRjfPhD36dQbv4bak7EnkGOjBWv67N+6yFGCMITCBBJfhcGK9Zs87k 2JKUE4I5yXZ3tPXg01xP0X8BCz4RGZZ3BmU2GVIIVAvH1hqW8aqETjg3l9MTF59AIij2 czJg==
- In-reply-to: <E1UNsvq-0003Fe-K0@xxxxxxxxxxxxxxxxxxxxx>
- References: <E1UNsvq-0003Fe-K0@xxxxxxxxxxxxxxxxxxxxx>
On 4/5/13, David A. Wheeler <dwheeler@xxxxxxxxxxxx> wrote:
> 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.
Could be. The intent was to make parse-hash's interface very simple,
and that #' #` #, #,@ would be processed by the main parser without
calling parse-hash. Either that original intent or your new proposal
will work. However it *does* put the onus on the
scheme-system-specific code to add #' and friends, and as far as I
know most scheme systems would either happily live with #' == syntax
or not really care that much about what #' is. I suggest putting #'
and friends in the main parser, unless someone strenuously objects on
the grounds that #' is being actually *used* to mean something other
than (syntax ...)