[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: no more lua tag methods?
- From: Paul Swanson <pswanson@...>
- Date: Tue, 18 Dec 2001 16:19:21 -0800 (PST)
Most of the proposed changes (for Lua 4.1?) are good, or at least neutral
for me. One of them, however, troubles me greatly:
- no more tag methods for basic types: only tables and userdata can have
a "handler-table". Moreover, "basic" tables and userdata (that is, those
that you did not set a handler-table) cannot have tag methods, either.
I have implemented many extensions to the Lua language, including the
following:
tableA + tableB => modified tableA with "defaults" provided by tableB
arrayA .. arrayB => modified arrayA with arrayB as elements nA .. nA+B
nil + tableA => duplicate of tableA
I suppose I can emulate this behaviour by using copytagmethods() for every
new tag/object I create, but that seems like a lot of effort to work
around an unnecessary restriction.
I have also been considering other extensions as well (which would not be
possible without tag methods for basic types, including tables). For
instance: "string1" ^ "string2" would always generate an error, with
absolutely no way to override it.
Am I misunderstanding the intent or implementation of the above "feature"?
Also, I would like to reiterate my request to change the functionality of
format("%q"), so that it replaces newlines with \\n, instead of \\\n.
Note that those are both two-character sequences beginning with a
backslash :)
paul