| kind | = | "Mixins" |
Mixins is the name space for most mixins in the system. DefaultBehavior is the notable exception.
- =([place], value, +[morePlacesForDestructuring])
- ==(other)
- cell(cellName)
- cell=(cellName, value)
- cell?(cellName)
- cellNames(includeMimics false, cutoff nil)
- cells(includeMimics false)
- mimic()
- - should have the correct kind
[ show source ]
Mixins Comparing kind should ==("Mixins Comparing")
- - should have the correct kind
[ show source ]
Mixins Enumerable kind should ==("Mixins Enumerable")
- - should be Enumerable
[ show source ]
(Reflector other:mimics(Mixins Sequenced) [](1) ==(Mixins Enumerable)) should be true
expects two or more arguments, the first arguments unevaluated, the last evaluated. assigns the result of evaluating the last argument in the context of the caller, and assigns this result to the name/s provided by the first arguments. the first arguments remains unevaluated. the result of the assignment is the value assigned to the name. if the last argument is a method-like object and it's name is not set, that name will be set to the name of the cell.
returns true if the left hand side is equal to the right hand side. exactly what this means depend on the object. the default behavior of Ioke objects is to only be equal if they are the same instance.
expects one evaluated text or symbol argument and returns the cell that matches that name, without activating even if it's activatable.
- - should be possible to get a cell using a Text argument
[ show source ]
Mixins x = 42 Mixins cell("x") should ==(Mixins x) Mixins Comparing x = 43 Mixins Comparing cell("x") should ==(Mixins Comparing x) - - should be possible to get a cell using a Symbol argument
[ show source ]
Mixins x = 42 Mixins cell(:x) should ==(Mixins x) Mixins Comparing x = 43 Mixins Comparing cell(:x) should ==(Mixins Comparing x)
- - should report an error if trying to get a cell that doesn't exist in that object
[ show source ]
fn(Mixins cell(:mixins_spec_non_existing)) should signal(Condition Error NoSuchCell) fn(Mixins cell("mixins_spec_non_existing")) should signal(Condition Error NoSuchCell) fn(Mixins Comparing cell(:mixins_spec_non_existing)) should signal(Condition Error NoSuchCell) fn(Mixins Comparing cell("mixins_spec_non_existing")) should signal(Condition Error NoSuchCell)
expects one evaluated text or symbol argument that names the cell to set, sets this cell to the result of evaluating the second argument, and returns the value set.
- - should be possible to set a cell using a Text argument
[ show source ]
Mixins cell("blurg") = 42 Mixins blurg should ==(42) Mixins Comparing cell("murg") = 43 Mixins Comparing murg should ==(43) - - should be possible to set a cell using a Symbol argument
[ show source ]
Mixins cell(:blurg) = 42 Mixins blurg should ==(42) Mixins Comparing cell(:murg) = 43 Mixins Comparing murg should ==(43)
- - should be possible to set a cell with an empty name
[ show source ]
oldEmpty = cell("") Mixins Comparing cell("") = 42 Mixins Comparing cell("") should ==(42) Mixins Comparing cell("") = cell(:oldEmpty) - - should be possible to set a cell with complicated expressions
[ show source ]
f = Origin mimic f b = "foobar" Mixins cell(f b) = 42 +(24) -(3) Mixins cell(:foobar) should ==(63)
- - should be possible to set a cell that doesn't exist
[ show source ]
Mixins cell(:blurg) = 42 Mixins blurg should ==(42) Mixins Comparing cell(:murg) = 43 Mixins Comparing murg should ==(43)
- - should be possible to set a cell that does exist
[ show source ]
Mixins x = 42 Mixins cell(:x) = 43 Mixins x should ==(43) Mixins Comparing x = 42 Mixins Comparing cell(:x) = 44 Mixins Comparing x should ==(44)
- - should be possible to set a cell that does exist in a mimic. this should not change the mimic value
[ show source ]
one = Mixins mimic one x = 42 two = one mimic two cell(:x) = 43 one x should ==(42) one = Mixins mimic one x = 42 two = one mimic two cell(:x) = 43 two x should ==(43)
expects one evaluated text or symbol argument and returns a boolean indicating whether such a cell is reachable from this point.
takes one optional evaluated boolean argument, which defaults to false. if false, this method returns a list of the cell names of the receiver. if true, it returns the cell names of this object and all it's mimics recursively.
- - should return the cell names of this object by default
[ show source ]
x = Mixins mimic x cellNames should ==([]) x = Mixins mimic x f = 13 x cellNames should ==([](:f)) x = Mixins mimic x f = 13 x Why = 1 x cellNames should ==([](:f, :Why)) x = Mixins mimic x Why = 1 x f = 13 x cellNames should ==([](:Why, :f))
takes one optional evaluated boolean argument, which defaults to false. if false, this method returns a dict of the cell names and values of the receiver. if true, it returns the cell names and values of this object and all it's mimics recursively.
- - should return the cells of this object by default
[ show source ]
x = Mixins mimic x cells should ==({}) x = Mixins mimic x f = 13 x cells should ==({}(f: 13)) x = Mixins mimic x f = 13 x Why = 1 x cells should ==({}(f: 13, Why: 1)) x = Mixins mimic x Why = 1 x f = 13 x cells should ==({}(f: 13, Why: 1))