| attributeNames | = | [] |
Mimics
Inactive cells
Active cells
- ==(other)
- ===(other)
- [](index)
- []=(index, value)
- asText()
- attributes()
- create(+values, +:keywordValues)
- hash()
- inspect()
- internal:createDerived(orig, attributeNames, newValues, newKeywordValues)
- internal:createInitial(val, attributeNames, attributes, attributesWithDefaultValues, values, keywordValues)
- notice()
- seq()
- valuesAt(+indices)
Specs
Inactive cells (details)
Active cells (details)
nil
[ show source ]
method(other,
if(self same?(
#<IokeGround Struct:0>),
Reflector other:mimics?(cell(:other),
#<IokeGround Struct:0>),
bind(rescue(Condition Error, fn(c, false)),
self ==(
other))))
nil
[ show source ]
method(index,
ix = if(index mimics?(Number),
attributeNames [](index),
index)
@ cell(ix))
nil
[ show source ]
method(index, value,
ix = if(index mimics?(Number),
attributeNames [](index),
index)
@ cell(ix) = value)
nil
[ show source ]
method(
if(structInstance?,
"(#{attributeNames map(name, "#{name}: #{@ cell(name)}") join(", ")})",
"Struct(#{attributeNames join(", ")})"))
nil
[ show source ]
method(
if(structInstance?,
"(#{attributeNames map(name, "#{name}: #{@ cell(name) inspect}") join(", ")})",
"Struct(#{attributeNames join(", ")})"))
nil
[ show source ]
method(orig, attributeNames, newValues, newKeywordValues,
res = orig mimic
(newValues zipped(attributeNames) mapped(reverse) +(
newKeywordValues seq)) each(vv,
res cell(vv first) = vv second)
res
)
internal:createInitial(val, attributeNames, attributes, attributesWithDefaultValues, values, keywordValues)
nil
[ show source ]
method(val, attributeNames, attributes, attributesWithDefaultValues, values, keywordValues,
result = fn(+(newVals), +:(newKeywordVals),
Struct internal:createDerived(result, attributeNames, newVals, newKeywordVals))
result prependMimic!(val)
result structInstance? = true
(attributesWithDefaultValues seq +(
attributes zipped(values)) +(
keywordValues seq)) each(vv,
result cell(vv first) = vv second)
result)
nil
[ show source ]
method(
if(structInstance?,
"(#{attributeNames map(name, "#{name}: #{@ cell(name) notice}") join(", ")})",
"Struct(#{attributeNames join(", ")})"))