[bitc-dev] Syntax: Procedure application
Geoffrey Irving
irving at naml.us
Fri Mar 6 16:08:24 EST 2009
On Fri, Mar 6, 2009 at 12:04 PM, Jonathan S. Shapiro <shap at eros-os.com> wrote:
> - Show quoted text -
> On Fri, Mar 6, 2009 at 2:46 PM, Gelf Mrogen <gelfmrogen at yahoo.com> wrote:
>>
>> > The problem is that in things like
>> > f a b + f c d
>> > we do not know how many arguments to "consume" for f until f is typed,
>> > and we don't have that information at parse time.
>>
>> Can you explain this more? Why not interpret "f a b + f c d" exactly as you'd interpret "(f a b) + (f c d)"?
>
> Because of my assumption that "+" and "a" are both identifiers. I
> didn't know about the ML rule that mixfix operators must be
> punctuation. It raises a conundrum, though, because now I need to go
> look at the UNICODE standard and see if there is an appropriate
> character class for what we want, or if not, then what it would take
> to build something of that sort.
If you're going the mixfix route, and will be parsing expressions into
lists of tokens that are turned into trees by a separate parsing
phase, then I don't think this restriction is necessary. You'll know
which identifiers are mixfix operators by the time you parse, which
lets you control their precedence relative to function application.
Geoffrey
More information about the bitc-dev
mailing list