Updated doc.
This commit is contained in:
parent
096973f06d
commit
f4c8b30d51
@ -4,11 +4,13 @@
|
||||
* that can be used to declare immutable classes, like so:
|
||||
*
|
||||
* immutable = require 'immutable'
|
||||
* local Foo = immutable({"baz","qux"})
|
||||
* local Foo = immutable({"baz","qux"}, {class_var=5})
|
||||
* local foo = Foo("hello", 99)
|
||||
* assert(foo.baz == "hello")
|
||||
* assert(not pcall(function() foo.x = 'mutable' end))
|
||||
* local t = {[foo]="it works"}
|
||||
* assert(t[Foo("hello", 99)] == "it works")
|
||||
* assert(foo.class_var == 5)
|
||||
*
|
||||
* Instances *are* garbage collected.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user