Discuss Scratch

Monniasza_spzoo
Scratcher
100+ posts

Multi-hashtables

Multi-hashtables are advanced storage method, hybrid of hashtables and nested lists
Manipulation of individual items of sublists {
add [] to sublist () of multi-hashtable [list v] :: list
delete ( v) from sublist () of multi-hashtable[list v] :: list
insert [] at (1 v) in sublist () of multi-hashtable [list v] :: list
set [] of hashtable () in multi-hashtable [list v] with [thing] :: list
}

Reading of sublists{
reporter (get [] of hashtable () of multi-hashtable [list v] :: list)
reporter (length of hashtable () in multi-hashtable [list v] :: list)
predicate <hashtable () of multi-hashtable [ v] contains key [thing] ? :: list>
predicate <hashtable () of multi-hashtable [ v] contains value [thing] ? :: list>
}

Reading of whole nested list {
predicate <any hashtable of multi-hashtable[ v] contains key [thing] ? :: list>
predicate <any hashtable of multi-hashtable[ v] contains value [thing] ? :: list>
reporter (hashtable count of multi-hashtable [list v] :: list)
}

Manipulation of whole sublists {
set hashtable () of multi-hashtable [list v] to list [ v] :: list
insert hashtable [ v] at () of multi-hashtable [list v] :: list
add hashtable [ v] to multi-hashtable [list v] :: list
delete hashtable () of multi-hashtable [list v] :: list
}

Reading whole sublists{
set hashtable [ v] to hashtable ( v) of multi-hashtable [list v] :: list
}

Powered by DjangoBB

Standard | Mobile