lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Soni L. once stated:
> Hi list,
> 
> I'd like to implement data structures using nothing but closures and 
> coroutines, including setmetatable (or, in this project, setmetaclosure) 
> and getmetatable (or, in this project, getmetaclosure). These would be 
> wrappers around the stdlib's setmetatable and getmetatable.
> 
> Combining varargs and coroutines makes efficient stacks that are very 
> fast for push/pop operations, but very slow for other operations, thus 
> they are unsuitable as a general-purpose data structure.
> 
> How can I make general-purpose data structures without tables?

  https://codon.com/programming-with-nothing

  -spc (The rest I leave as an exercise for the reader)