Category talk:Wren-trait: Difference between revisions

→‎Source code: Added a method to ByKey class.
(→‎Source code: Added Indexed and SeqEntry classes.)
(→‎Source code: Added a method to ByKey class.)
Line 183:
// Retrieves a ByKey object from its key. Returns null if the key is not present.
static [key] { __map ? __map[key] : null }
 
// Retrieves a ByKey object's key from the object it wraps. Returns 0 if the object is unwrapped.
static findKey(obj) {
for (me in __map) {
if (me.value.obj == obj) return me.key
}
return 0
}
 
// Returns the number of objects currently in the internal map.
9,482

edits