module Novika::IDict
Overview
Novika dictionary protocol. Objects or values that want to be Block dictionaries can implement this protocol to make that possible.
Direct including types
Defined in:
novika/dict.crInstance Method Summary
-
#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(& : Form, Form -> )
Yields key, value forms in this dictionary.
-
#empty? : Bool
Returns whether this dictionary currently stores no entries.
-
#get(name : Form, & : Form -> Entry | Nil) : 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 Method Detail
Deletes the entry corresponding to name form in this dictionary if it exists. Otherwise, does nothing.
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).
Assigns name form to entry in this dictionary.
Converts this dictionary to the standard Dict
implementation
(used in e.g. serialization).