[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: What's up with token filters (Re: New operators?)
- From: Asko Kauppi <askok@...>
- Date: Thu, 12 Apr 2007 18:45:02 +0300
There already is a solution for this, namely token filters.
Only - they are not mainstream (5.1.2) as of yet, and whether they
shall be remains a mystery.
If the term is new, they allow you to "add on" Lua syntaxes on the
fly, by "-lmyfilters" when launching Lua. Without patching.
Instead of asking for += (which I, too, would like to use) one might
re-ask about the status on mainstreaming token filters into Lua? :)
Glenn Maynard kirjoitti 12.4.2007 kello 0:37:
On Wed, Apr 11, 2007 at 08:34:23PM +0100, Andy Stark wrote:
An alternative to assignment operators (+=, etc) might be to have a
shorthand for referring to the variables on the left hand side of the
assignment. Perhaps one of the unused characters (question mark, say)
could be used for this. So if we started with:-
longVarName = longVarName + 1
...we could change it to:-
longVarName = ? + 1
This makes me feel like I'm reading Perl code, where everything is a
mass of strange, unconventional operators. Inventing new, unfamiliar
operators for a language has its place ... but this just feels
where typical += operators are what's really wanted.
...and then perhaps ?1, ?2, etc for multiple assignments.
This is inviting unreadable code, where you have to keep looking back
and forth and counting to figure out what each number in an expression
means. I've adjusted enough Perl expressions after changing a regexp
to call it a maintenance nightmare, too.