class Novika::Dict
- Novika::Dict
- Reference
- Object
Overview
Default dictionary protocol implementation: default block dictionary implementation. Uses a hash map for storage.
Note: setting or getting with blocks as keys performs a linear scan for now. The semantics for this is unstable.
Included Modules
Defined in:
novika/dict.crInstance Method Summary
- #==(other : Dict)
-
#clear
Removes all entries in this dictionary.
-
#copy : IDict
Returns a shallow copy of this dictionary.
-
#count : Int32
Returns the amount of entries in this dictionary.
-
#del(name : Form)
Deletes the entry corresponding to name form in this dictionary if it exists.
-
#each(&)
Yields key, value forms in this dictionary.
-
#get(name : Form, &) : Entry | Nil
Returns the entry corresponding to name form in this dictionary, or yields with name and returns the block result.
-
#has?(name : Form) : Bool
Returns whether this dictionary has an entry corresponding to name form.
-
#import!(donor : IDict)
Imports entries from donor dictionary into this dictionary.
-
#set(name : Form, entry : Entry) : Entry
Assigns name form to entry in this dictionary.
-
#to_dict : Dict
Converts this dictionary to the standard
Dict
implementation (used in e.g.
Instance methods inherited from module Novika::IDict
clear
clear,
copy : IDict
copy,
count : Int32
count,
del(name : Form)
del,
each(& : Form, Form -> )
each,
empty? : Bool
empty?,
get(name : Form, & : Form -> Entry | Nil) : Entry | Nil
get,
has?(name : Form) : Bool
has?,
import!(donor : IDict)
import!,
set(name : Form, entry : Entry) : Entry
set,
to_dict : Dict
to_dict
Instance Method Detail
Returns the amount of entries in this dictionary.
Deletes the entry corresponding to name form in this dictionary if it exists. Otherwise, does nothing.
Yields key, value forms in this dictionary.
Returns the entry corresponding to name form in this dictionary, or yields with name and returns the block result.
Returns whether this dictionary has an entry corresponding to name form.
Imports entries from donor dictionary into this dictionary.
Entries whose names are preceded by one or more _
are
not imported (they are considered private).
Converts this dictionary to the standard Dict
implementation
(used in e.g. serialization).