[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Index with multiple parameters?
- From: Fabien <fleutot+lua@...>
- Date: Wed, 20 Feb 2008 17:35:51 +0100
On Feb 20, 2008 4:33 PM, Daniel Stephens <email@example.com
Ideally there could be a new multi-arg indexing syntax with its own pair
of metamethods, allowing for both multiple arguments **AND** multiple
Something [...] Where matrix[1, 2] = 8.1, 0.0, 7.2; Becomes _setmulti(matrix, 2, 1, 2, 8.1, 0.0, 7.2)
What I dont know (since I've not played with any of them) is whether any
of the existing language extension mechanisms provides the framework
required for this without modifying the language directly.
You can, and with metalua it's fairly easy. That's essentially what does my code snippet above (I've left the multi-assignment matter unaddressed, but that's a 3-lines modification). I'd only advise you to use a syntax that don't overlap the regular "[expr]" one, for modularity reasons.