2 Oct 15:09
Unexpected behaviour
From: Tim Channon <tc <at> gpsl.net>
Subject: Unexpected behaviour
Newsgroups: gmane.comp.lang.lua.general
Date: 2008-10-02 13:10:09 GMT
Subject: Unexpected behaviour
Newsgroups: gmane.comp.lang.lua.general
Date: 2008-10-02 13:10:09 GMT
Where does argument 3 go?
tagclass = {}
tagmetatable = {__index = tagclass}
function tagclass.new (kind, args, body)
local self = {}
self.kind=kind
self.args=args
self.body=body
setmetatable(self,tagmetatable)
return self
end
function tagclass:show()
print("kind",self.kind)
print("args",self.args)
print("body",self.body)
end
xx=tagclass:new("kindp", "argp", "bodyp")
xx:show()
kind table: 00887f48
args kindp
body argp
I'm struggling with a language where I have no mental model, rather too
abstract for me. Part of what I am trying to work towards is use a
technique I think I last used in modula where it is trivially easy. This
would be a dynamically decorated trie where the leaves are executable,
data driven.
This is most easily explained by example: might be a patricia trie which
can be runtime fed with t4 fax huffman codes and routines. T4 data can
then be walked into the trie and the leaves executed, decoding the fax.
In practice this proved faster executing than commercial assembler
decoders, which was a surprise.
Lua obviously would be much slower but that doesn't matter. (especially
as computers are slightly faster many years later)
RSS Feed