[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Hacking the parser - function argument parentheses
- From: Mark Hamburg <mark@...>
- Date: Sun, 18 Apr 2010 22:00:45 -0700
On Apr 18, 2010, at 10:22 AM, spir ☣ wrote:
> I'm presently thinking at something maybe a bit similar (not for a Lua variant, rather a custom language). It has 2 aspects:
> * Extend Lua-like "funcname {...}" & "funcname '...'" to any argument, and make it standard (and only) func call syntax.
> * Identifiers can be made of any non-reserved chars.
>
> It appears to be a bit problematic because of possible ambiguity; especially the case of no arg at all is annoying. So, I ended up using '!' meaning request for execution, eg:
> obj.doSomething arg!
> obj.doSomething!
> x : obj.makeSomething arg!
> x : obj.makeSomething!
> (This also gives for free a distinction between denotation of the method itself & execution:
> x : obj.makeSomething <-- 'x' is bound to the method
> )
I get tempted by these sort of things on occasion, but the I realize that ! is only one fewer characters than (). The downside to () is that I actually tend to put spaces inside, so that's two more characters and they have to be balanced properly. On the other hand, I don't even want to think about balancing !s.
Mark