From bfe20f0537c72191de2aa872d032b4233ef49ecf Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Thu, 9 Jul 2015 03:51:56 +1000 Subject: Document crazy idea I had for implementing Skang's _123 via metatables. --- docs/ClientHamr/README.GuiLua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/ClientHamr/README.GuiLua b/docs/ClientHamr/README.GuiLua index 72f13f3..3d4bb1c 100644 --- a/docs/ClientHamr/README.GuiLua +++ b/docs/ClientHamr/README.GuiLua @@ -165,6 +165,15 @@ This could even allow relative placement as mentioned in the skang TODO - foo = widget.label(0, "otherWidget+0.1", 0.5, 0, 'Text goes here") +While failing to fall asleep, I had another idea, though not sure how +feasible it is just yet. _123 could use a metatable thingy at the +lowest level, and just translates that to a value, the value being a +number. Or something hand wavey like that. lol + +In skang.lua _M is the modules table, and it's a local, it's also a +proxy table. So _M's metatable's __index could check if it's a _123, +then return the 123 as the value. As a bonus, we could do arithmatic +via this metatable. "widget" would be a table with functions for dealing with widgets. It would include metatable stuff for widget set introspection. So -- cgit v1.1