[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Doing it in Lua (was Re: +=)
- From: "Magnus Lie Hetland" <mlh@...>
- Date: Wed, 28 Mar 2001 18:15:23 +0200
----- Original Message -----
From: "Jason Clow" <firstname.lastname@example.org>
To: "Multiple recipients of list" <email@example.com>
Sent: Wednesday, March 28, 2001 5:56 PM
Subject: Re: +=
> How would one go about implementing operators such as
> +=, -=, ++, etc? I use x = x + something_else quite a lot,
> and having x += something_else would make my code look so
> much cleaner, imho. Is there a way to do it with Lua code
> (like tag methods), or will it have to be added to the parser?
Can't you do something like x:add(something)? And then implement
the add-thing with a tag method or something. You could have
x:multiply(something) etc. as well...
Just a thought.
Magnus Lie Hetland http://www.hetland.org
"Reality is that which, when you stop believing in
it, doesn't go away." -- Philip K. Dick