Dictionary Manipulation Primitives
The gas consumption of most dictionary operations is not fixed, it depends on the contents of the given dictionary.
TVM Instructions Content List
- Overview
- Stack Manipulation
- Tuple, List and Null
- Constants and Literals
- Arithmetic Operations
- Data Comparison
- Cell Manipulation
- Continuation and Control Flow
- Exception Generation and Handling
- Dictionary Manipulation
- Application-specific Primitives
- Miscellaneous
Opcode | Fift syntax | Stack | Description | Gas |
---|---|---|---|---|
Please enter a search query | ||||
No results found |
Dictionary Manipulation Primitives
Dictionary creation
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
6D | NEWDICT | - D | Returns a new empty dictionary. It is an alternative mnemonics for PUSHNULL . | 18 |
6E | DICTEMPTY | D - ? | Checks whether dictionary D is empty, and returns -1 or 0 accordingly.It is an alternative mnemonics for ISNULL . | 18 |
Dictionary serialization and deserialization
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
CE | STDICTS `` | s b - b' | Stores a Slice-represented dictionary s into Builder b .It is actually a synonym for STSLICE . | 18 |
F400 | STDICT STOPTREF | D b - b' | Stores dictionary D into Builder b , returing the resulting Builder b' .In other words, if D is a cell, performs STONE and STREF ; if D is Null, performs NIP and STZERO ; otherwise throws a type checking exception. | 26 |
F401 | SKIPDICT SKIPOPTREF | s - s' | Equivalent to LDDICT NIP . | 26 |
F402 | LDDICTS | s - s' s'' | Loads (parses) a (Slice-represented) dictionary s' from Slice s , and returns the remainder of s as s'' .This is a “split function'' for all HashmapE(n,X) dictionary types. | 26 |
F403 | PLDDICTS | s - s' | Preloads a (Slice-represented) dictionary s' from Slice s .Approximately equivalent to LDDICTS DROP . | 26 |
F404 | LDDICT LDOPTREF | s - D s' | Loads (parses) a dictionary D from Slice s , and returns the remainder of s as s' . May be applied to dictionaries or to values of arbitrary (^Y)? types. | 26 |
F405 | PLDDICT PLDOPTREF | s - D | Preloads a dictionary D from Slice s .Approximately equivalent to LDDICT DROP . | 26 |
F406 | LDDICTQ | s - D s' -1 or s 0 | A quiet version of LDDICT . | 26 |
F407 | PLDDICTQ | s - D -1 or 0 | A quiet version of PLDDICT . | 26 |
Get dictionary operations
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F40A | DICTGET | k D n - x -1 or 0 | Looks up key k (represented by a Slice, the first 0 <= n <= 1023 data bits of which are used as a key) in dictionary D of type HashmapE(n,X) with n -bit keys.On success, returns the value found as a Slice x . | |
F40B | DICTGETREF | k D n - c -1 or 0 | Similar to DICTGET , but with a LDREF ENDS applied to x on success.This operation is useful for dictionaries of type HashmapE(n,^Y) . | |
F40C | DICTIGET | i D n - x -1 or 0 | Similar to DICTGET , but with a signed (big-endian) n -bit Integer i as a key. If i does not fit into n bits, returns 0 . If i is a NaN , throws an integer overflow exception. | |
F40D | DICTIGETREF | i D n - c -1 or 0 | Combines DICTIGET with DICTGETREF : it uses signed n -bit Integer i as a key and returns a Cell instead of a Slice on success. | |
F40E | DICTUGET | i D n - x -1 or 0 | Similar to DICTIGET , but with unsigned (big-endian) n -bit Integer i used as a key. | |
F40F | DICTUGETREF | i D n - c -1 or 0 | Similar to DICTIGETREF , but with an unsigned n -bit Integer key i . |
Set/Replace/Add dictionary operations
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F412 | DICTSET | x k D n - D' | Sets the value associated with n -bit key k (represented by a Slice as in DICTGET ) in dictionary D (also represented by a Slice) to value x (again a Slice), and returns the resulting dictionary as D' . | |
F413 | DICTSETREF | c k D n - D' | Similar to DICTSET , but with the value set to a reference to Cell c . | |
F414 | DICTISET | x i D n - D' | Similar to DICTSET , but with the key represented by a (big-endian) signed n -bit integer i . If i does not fit into n bits, a range check exception is generated. | |
F415 | DICTISETREF | c i D n - D' | Similar to DICTSETREF , but with the key a signed n -bit integer as in DICTISET . | |
F416 | DICTUSET | x i D n - D' | Similar to DICTISET , but with i an unsigned n -bit integer. | |
F417 | DICTUSETREF | c i D n - D' | Similar to DICTISETREF , but with i unsigned. | |
F41A | DICTSETGET | x k D n - D' y -1 or D' 0 | Combines DICTSET with DICTGET : it sets the value corresponding to key k to x , but also returns the old value y associated with the key in question, if present. | |
F41B | DICTSETGETREF | c k D n - D' c' -1 or D' 0 | Combines DICTSETREF with DICTGETREF similarly to DICTSETGET . | |
F41C | DICTISETGET | x i D n - D' y -1 or D' 0 | DICTISETGET , but with i a signed n -bit integer. | |
F41D | DICTISETGETREF | c i D n - D' c' -1 or D' 0 | DICTISETGETREF , but with i a signed n -bit integer. | |
F41E | DICTUSETGET | x i D n - D' y -1 or D' 0 | DICTISETGET , but with i an unsigned n -bit integer. | |
F41F | DICTUSETGETREF | c i D n - D' c' -1 or D' 0 | DICTISETGETREF , but with i an unsigned n -bit integer. | |
F422 | DICTREPLACE | x k D n - D' -1 or D 0 | A Replace operation, which is similar to DICTSET , but sets the value of key k in dictionary D to x only if the key k was already present in D . | |
F423 | DICTREPLACEREF | c k D n - D' -1 or D 0 | A Replace counterpart of DICTSETREF . | |
F424 | DICTIREPLACE | x i D n - D' -1 or D 0 | DICTREPLACE , but with i a signed n -bit integer. | |
F425 | DICTIREPLACEREF | c i D n - D' -1 or D 0 | DICTREPLACEREF , but with i a signed n -bit integer. | |
F426 | DICTUREPLACE | x i D n - D' -1 or D 0 | DICTREPLACE , but with i an unsigned n -bit integer. | |
F427 | DICTUREPLACEREF | c i D n - D' -1 or D 0 | DICTREPLACEREF , but with i an unsigned n -bit integer. | |
F42A | DICTREPLACEGET | x k D n - D' y -1 or D 0 | A Replace counterpart of DICTSETGET : on success, also returns the old value associated with the key in question. | |
F42B | DICTREPLACEGETREF | c k D n - D' c' -1 or D 0 | A Replace counterpart of DICTSETGETREF . | |
F42C | DICTIREPLACEGET | x i D n - D' y -1 or D 0 | DICTREPLACEGET , but with i a signed n -bit integer. | |
F42D | DICTIREPLACEGETREF | c i D n - D' c' -1 or D 0 | DICTREPLACEGETREF , but with i a signed n -bit integer. | |
F42E | DICTUREPLACEGET | x i D n - D' y -1 or D 0 | DICTREPLACEGET , but with i an unsigned n -bit integer. | |
F42F | DICTUREPLACEGETREF | c i D n - D' c' -1 or D 0 | DICTREPLACEGETREF , but with i an unsigned n -bit integer. | |
F432 | DICTADD | x k D n - D' -1 or D 0 | An Add counterpart of DICTSET : sets the value associated with key k in dictionary D to x , but only if it is not already present in D . | |
F433 | DICTADDREF | c k D n - D' -1 or D 0 | An Add counterpart of DICTSETREF . | |
F434 | DICTIADD | x i D n - D' -1 or D 0 | DICTADD , but with i a signed n -bit integer. | |
F435 | DICTIADDREF | c i D n - D' -1 or D 0 | DICTADDREF , but with i a signed n -bit integer. | |
F436 | DICTUADD | x i D n - D' -1 or D 0 | DICTADD , but with i an unsigned n -bit integer. | |
F437 | DICTUADDREF | c i D n - D' -1 or D 0 | DICTADDREF , but with i an unsigned n -bit integer. | |
F43A | DICTADDGET | x k D n - D' -1 or D y 0 | An Add counterpart of DICTSETGET : sets the value associated with key k in dictionary D to x , but only if key k is not already present in D . Otherwise, just returns the old value y without changing the dictionary. | |
F43B | DICTADDGETREF | c k D n - D' -1 or D c' 0 | An Add counterpart of DICTSETGETREF . | |
F43C | DICTIADDGET | x i D n - D' -1 or D y 0 | DICTADDGET , but with i a signed n -bit integer. | |
F43D | DICTIADDGETREF | c i D n - D' -1 or D c' 0 | DICTADDGETREF , but with i a signed n -bit integer. | |
F43E | DICTUADDGET | x i D n - D' -1 or D y 0 | DICTADDGET , but with i an unsigned n -bit integer. | |
F43F | DICTUADDGETREF | c i D n - D' -1 or D c' 0 | DICTADDGETREF , but with i an unsigned n -bit integer. |
Builder-accepting variants of Set dictionary operations
The following primitives accept the new value as a Builder b
instead of a Slice x
.
| xxxxxxx
Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fift syntax | xxxxxxxxxxxxxxxxx
Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Description | xxxx
Gas |
|:-|:-|:-|:-|:-|
| F441
| DICTSETB
| b k D n - D'
| | |
| F442
| DICTISETB
| b i D n - D'
| | |
| F443
| DICTUSETB
| b i D n - D'
| | |
| F445
| DICTSETGETB
| b k D n - D' y -1 or D' 0
| | |
| F446
| DICTISETGETB
| b i D n - D' y -1 or D' 0
| | |
| F447
| DICTUSETGETB
| b i D n - D' y -1 or D' 0
| | |
| F449
| DICTREPLACEB
| b k D n - D' -1 or D 0
| | |
| F44A
| DICTIREPLACEB
| b i D n - D' -1 or D 0
| | |
| F44B
| DICTUREPLACEB
| b i D n - D' -1 or D 0
| | |
| F44D
| DICTREPLACEGETB
| b k D n - D' y -1 or D 0
| | |
| F44E
| DICTIREPLACEGETB
| b i D n - D' y -1 or D 0
| | |
| F44F
| DICTUREPLACEGETB
| b i D n - D' y -1 or D 0
| | |
| F451
| DICTADDB
| b k D n - D' -1 or D 0
| | |
| F452
| DICTIADDB
| b i D n - D' -1 or D 0
| | |
| F453
| DICTUADDB
| b i D n - D' -1 or D 0
| | |
| F455
| DICTADDGETB
| b k D n - D' -1 or D y 0
| | |
| F456
| DICTIADDGETB
| b i D n - D' -1 or D y 0
| | |
| F457
| DICTUADDGETB
| b i D n - D' -1 or D y 0
| | |
Delete dictionary operations
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F459 | DICTDEL | k D n - D' -1 or D 0 | Deletes n -bit key, represented by a Slice k , from dictionary D . If the key is present, returns the modified dictionary D' and the success flag -1 . Otherwise, returns the original dictionary D and 0 . | |
F45A | DICTIDEL | i D n - D' ? | A version of DICTDEL with the key represented by a signed n -bit Integer i . If i does not fit into n bits, simply returns D 0 (“key not found, dictionary unmodified''). | |
F45B | DICTUDEL | i D n - D' ? | Similar to DICTIDEL , but with i an unsigned n -bit integer. | |
F462 | DICTDELGET | k D n - D' x -1 or D 0 | Deletes n -bit key, represented by a Slice k , from dictionary D . If the key is present, returns the modified dictionary D' , the original value x associated with the key k (represented by a Slice), and the success flag -1 . Otherwise, returns the original dictionary D and 0 . | |
F463 | DICTDELGETREF | k D n - D' c -1 or D 0 | Similar to DICTDELGET , but with LDREF ENDS applied to x on success, so that the value returned c is a Cell. | |
F464 | DICTIDELGET | i D n - D' x -1 or D 0 | DICTDELGET , but with i a signed n -bit integer. | |
F465 | DICTIDELGETREF | i D n - D' c -1 or D 0 | DICTDELGETREF , but with i a signed n -bit integer. | |
F466 | DICTUDELGET | i D n - D' x -1 or D 0 | DICTDELGET , but with i an unsigned n -bit integer. | |
F467 | DICTUDELGETREF | i D n - D' c -1 or D 0 | DICTDELGETREF , but with i an unsigned n -bit integer. |
"Maybe reference" dictionary operations
The following operations assume that a dictionary is used to store values c?
of type Maybe Cell. The representation is as follows: if c?
is a Cell , it is stored as a value with no data bits and exactly one reference to this Cell. If c?
is Null, then the corresponding key must be absent from the dictionary.
| xxxxxxx
Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fift syntax | xxxxxxxxxxxxxxxxx
Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Description | xxxx
Gas |
|:-|:-|:-|:-|:-|
| F469
| DICTGETOPTREF
| k D n - c^?
| A variant of DICTGETREF
that returns Null instead of the value c^?
if the key k
is absent from dictionary D
. | |
| F46A
| DICTIGETOPTREF
| i D n - c^?
| DICTGETOPTREF
, but with i
a signed n
-bit integer. If the key i
is out of range, also returns Null. | |
| F46B
| DICTUGETOPTREF
| i D n - c^?
| DICTGETOPTREF
, but with i
an unsigned n
-bit integer. If the key i
is out of range, also returns Null. | |
| F46D
| DICTSETGETOPTREF
| c^? k D n - D' ~c^?
| A variant of both DICTGETOPTREF
and DICTSETGETREF
that sets the value corresponding to key k
in dictionary D
to c^?
(if c^?
is Null, then the key is deleted instead), and returns the old value ~c^?
(if the key k
was absent before, returns Null instead). | |
| F46E
| DICTISETGETOPTREF
| c^? i D n - D' ~c^?
| Similar to primitive DICTSETGETOPTREF
, but using signed n
-bit Integer i
as a key. If i
does not fit into n
bits, throws a range checking exception. | |
| F46F
| DICTUSETGETOPTREF
| c^? i D n - D' ~c^?
| Similar to primitive DICTSETGETOPTREF
, but using unsigned n
-bit Integer i
as a key. | |
Prefix code dictionary operations
These are some basic operations for constructing prefix code dictionaries.
These primitives are completely similar to their non-prefix code counterparts (DICTSET
etc), with the obvious difference that even a Set may fail in a prefix code dictionary, so a success flag must be returned by PFXDICTSET
as well.
| xxxxxxx
Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Fift syntax | xxxxxxxxxxxxxxxxx
Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Description | xxxx
Gas |
|:-|:-|:-|:-|:-|
| F470
| PFXDICTSET
| x k D n - D' -1 or D 0
| | |
| F471
| PFXDICTREPLACE
| x k D n - D' -1 or D 0
| | |
| F472
| PFXDICTADD
| x k D n - D' -1 or D 0
| | |
| F473
| PFXDICTDEL
| k D n - D' -1 or D 0
| | |
Variants of GetNext and GetPrev operations
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F474 | DICTGETNEXT | k D n - x' k' -1 or 0 | Computes the minimal key k' in dictionary D that is lexicographically greater than k , and returns k' (represented by a Slice) along with associated value x' (also represented by a Slice). | |
F475 | DICTGETNEXTEQ | k D n - x' k' -1 or 0 | Similar to DICTGETNEXT , but computes the minimal key k' that is lexicographically greater than or equal to k . | |
F476 | DICTGETPREV | k D n - x' k' -1 or 0 | Similar to DICTGETNEXT , but computes the maximal key k' lexicographically smaller than k . | |
F477 | DICTGETPREVEQ | k D n - x' k' -1 or 0 | Similar to DICTGETPREV , but computes the maximal key k' lexicographically smaller than or equal to k . | |
F478 | DICTIGETNEXT | i D n - x' i' -1 or 0 | Similar to DICTGETNEXT , but interprets all keys in dictionary D as big-endian signed n -bit integers, and computes the minimal key i' that is larger than Integer i (which does not necessarily fit into n bits). | |
F479 | DICTIGETNEXTEQ | i D n - x' i' -1 or 0 | Similar to DICTGETNEXTEQ , but interprets keys as signed n -bit integers. | |
F47A | DICTIGETPREV | i D n - x' i' -1 or 0 | Similar to DICTGETPREV , but interprets keys as signed n -bit integers. | |
F47B | DICTIGETPREVEQ | i D n - x' i' -1 or 0 | Similar to DICTGETPREVEQ , but interprets keys as signed n -bit integers. | |
F47C | DICTUGETNEXT | i D n - x' i' -1 or 0 | Similar to DICTGETNEXT , but interprets all keys in dictionary D as big-endian unsigned n -bit integers, and computes the minimal key i' that is larger than Integer i (which does not necessarily fit into n bits, and is not necessarily non-negative). | |
F47D | DICTUGETNEXTEQ | i D n - x' i' -1 or 0 | Similar to DICTGETNEXTEQ , but interprets keys as unsigned n -bit integers. | |
F47E | DICTUGETPREV | i D n - x' i' -1 or 0 | Similar to DICTGETPREV , but interprets keys as unsigned n -bit integers. | |
F47F | DICTUGETPREVEQ | i D n - x' i' -1 or 0 | Similar to DICTGETPREVEQ , but interprets keys a unsigned n -bit integers. |
GetMin, GetMax, RemoveMin, RemoveMax operations
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F482 | DICTMIN | D n - x k -1 or 0 | Computes the minimal key k (represented by a Slice with n data bits) in dictionary D , and returns k along with the associated value x . | |
F483 | DICTMINREF | D n - c k -1 or 0 | Similar to DICTMIN , but returns the only reference in the value as a Cell c . | |
F484 | DICTIMIN | D n - x i -1 or 0 | Similar to DICTMIN , but computes the minimal key i under the assumption that all keys are big-endian signed n -bit integers. Notice that the key and value returned may differ from those computed by DICTMIN and DICTUMIN . | |
F485 | DICTIMINREF | D n - c i -1 or 0 | Similar to DICTIMIN , but returns the only reference in the value. | |
F486 | DICTUMIN | D n - x i -1 or 0 | Similar to DICTMIN , but returns the key as an unsigned n -bit Integer i . | |
F487 | DICTUMINREF | D n - c i -1 or 0 | Similar to DICTUMIN , but returns the only reference in the value. | |
F48A | DICTMAX | D n - x k -1 or 0 | Computes the maximal key k (represented by a Slice with n data bits) in dictionary D , and returns k along with the associated value x . | |
F48B | DICTMAXREF | D n - c k -1 or 0 | Similar to DICTMAX , but returns the only reference in the value. | |
F48C | DICTIMAX | D n - x i -1 or 0 | Similar to DICTMAX , but computes the maximal key i under the assumption that all keys are big-endian signed n -bit integers. Notice that the key and value returned may differ from those computed by DICTMAX and DICTUMAX . | |
F48D | DICTIMAXREF | D n - c i -1 or 0 | Similar to DICTIMAX , but returns the only reference in the value. | |
F48E | DICTUMAX | D n - x i -1 or 0 | Similar to DICTMAX , but returns the key as an unsigned n -bit Integer i . | |
F48F | DICTUMAXREF | D n - c i -1 or 0 | Similar to DICTUMAX , but returns the only reference in the value. | |
F492 | DICTREMMIN | D n - D' x k -1 or D 0 | Computes the minimal key k (represented by a Slice with n data bits) in dictionary D , removes k from the dictionary, and returns k along with the associated value x and the modified dictionary D' . | |
F493 | DICTREMMINREF | D n - D' c k -1 or D 0 | Similar to DICTREMMIN , but returns the only reference in the value as a Cell c . | |
F494 | DICTIREMMIN | D n - D' x i -1 or D 0 | Similar to DICTREMMIN , but computes the minimal key i under the assumption that all keys are big-endian signed n -bit integers. Notice that the key and value returned may differ from those computed by DICTREMMIN and DICTUREMMIN . | |
F495 | DICTIREMMINREF | D n - D' c i -1 or D 0 | Similar to DICTIREMMIN , but returns the only reference in the value. | |
F496 | DICTUREMMIN | D n - D' x i -1 or D 0 | Similar to DICTREMMIN , but returns the key as an unsigned n -bit Integer i . | |
F497 | DICTUREMMINREF | D n - D' c i -1 or D 0 | Similar to DICTUREMMIN , but returns the only reference in the value. | |
F49A | DICTREMMAX | D n - D' x k -1 or D 0 | Computes the maximal key k (represented by a Slice with n data bits) in dictionary D , removes k from the dictionary, and returns k along with the associated value x and the modified dictionary D' . | |
F49B | DICTREMMAXREF | D n - D' c k -1 or D 0 | Similar to DICTREMMAX , but returns the only reference in the value as a Cell c . | |
F49C | DICTIREMMAX | D n - D' x i -1 or D 0 | Similar to DICTREMMAX , but computes the minimal key i under the assumption that all keys are big-endian signed n -bit integers. Notice that the key and value returned may differ from those computed by DICTREMMAX and DICTUREMMAX . | |
F49D | DICTIREMMAXREF | D n - D' c i -1 or D 0 | Similar to DICTIREMMAX , but returns the only reference in the value. | |
F49E | DICTUREMMAX | D n - D' x i -1 or D 0 | Similar to DICTREMMAX , but returns the key as an unsigned n -bit Integer i . | |
F49F | DICTUREMMAXREF | D n - D' c i -1 or D 0 | Similar to DICTUREMMAX , but returns the only reference in the value. |
Special Get dictionary and prefix code dictionary operations and constant dictionaries
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F4A0 | DICTIGETJMP | i D n - | Similar to DICTIGET , but with x BLESS ed into a continuation with a subsequent JMPX to it on success. On failure, does nothing. This is useful for implementing switch /case constructions. | |
F4A1 | DICTUGETJMP | i D n - | Similar to DICTIGETJMP , but performs DICTUGET instead of DICTIGET . | |
F4A2 | DICTIGETEXEC | i D n - | Similar to DICTIGETJMP , but with EXECUTE instead of JMPX . | |
F4A3 | DICTUGETEXEC | i D n - | Similar to DICTUGETJMP , but with EXECUTE instead of JMPX . | |
F4A6_n | [ref] [n] DICTPUSHCONST | - D n | Pushes a non-empty constant dictionary D (as a Cell^? ) along with its key length 0 <= n <= 1023 , stored as a part of the instruction. The dictionary itself is created from the first of remaining references of the current continuation. In this way, the complete DICTPUSHCONST instruction can be obtained by first serializing xF4A4_ , then the non-empty dictionary itself (one 1 bit and a cell reference), and then the unsigned 10-bit integer n (as if by a STU 10 instruction). An empty dictionary can be pushed by a NEWDICT primitive instead. | 34 |
F4A8 | PFXDICTGETQ | s D n - s' x s'' -1 or s 0 | Looks up the unique prefix of Slice s present in the prefix code dictionary represented by Cell^? D and 0 <= n <= 1023 . If found, the prefix of s is returned as s' , and the corresponding value (also a Slice) as x . The remainder of s is returned as a Slice s'' . If no prefix of s is a key in prefix code dictionary D , returns the unchanged s and a zero flag to indicate failure. | |
F4A9 | PFXDICTGET | s D n - s' x s'' | Similar to PFXDICTGET , but throws a cell deserialization failure exception on failure. | |
F4AA | PFXDICTGETJMP | s D n - s' s'' or s | Similar to PFXDICTGETQ , but on success BLESS es the value x into a Continuation and transfers control to it as if by a JMPX . On failure, returns s unchanged and continues execution. | |
F4AB | PFXDICTGETEXEC | s D n - s' s'' | Similar to PFXDICTGETJMP , but EXEC utes the continuation found instead of jumping to it. On failure, throws a cell deserialization exception. | |
F4AE_n | [ref] [n] PFXDICTCONSTGETJMP [ref] [n] PFXDICTSWITCH | s - s' s'' or s | Combines [n] DICTPUSHCONST for 0 <= n <= 1023 with PFXDICTGETJMP . | |
F4BC | DICTIGETJMPZ | i D n - i or nothing | A variant of DICTIGETJMP that returns index i on failure. | |
F4BD | DICTUGETJMPZ | i D n - i or nothing | A variant of DICTUGETJMP that returns index i on failure. | |
F4BE | DICTIGETEXECZ | i D n - i or nothing | A variant of DICTIGETEXEC that returns index i on failure. | |
F4BF | DICTUGETEXECZ | i D n - i or nothing | A variant of DICTUGETEXEC that returns index i on failure. |
SubDict dictionary operations
xxxxxxx Opcode | xxxxxxxxxxxxxxxxxxxxxxxxxxxx Fift syntax | xxxxxxxxxxxxxxxxx Stack | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Description | xxxx Gas |
---|---|---|---|---|
F4B1 | SUBDICTGET | k l D n - D' | Constructs a subdictionary consisting of all keys beginning with prefix k (represented by a Slice, the first 0 <= l <= n <= 1023 data bits of which are used as a key) of length l in dictionary D of type HashmapE(n,X) with n -bit keys. On success, returns the new subdictionary of the same type HashmapE(n,X) as a Slice D' . | |
F4B2 | SUBDICTIGET | x l D n - D' | Variant of SUBDICTGET with the prefix represented by a signed big-endian l -bit Integer x , where necessarily l <= 257 . | |
F4B3 | SUBDICTUGET | x l D n - D' | Variant of SUBDICTGET with the prefix represented by an unsigned big-endian l -bit Integer x , where necessarily l <= 256 . | |
F4B5 | SUBDICTRPGET | k l D n - D' | Similar to SUBDICTGET , but removes the common prefix k from all keys of the new dictionary D' , which becomes of type HashmapE(n-l,X) . | |
F4B6 | SUBDICTIRPGET | x l D n - D' | Variant of SUBDICTRPGET with the prefix represented by a signed big-endian l -bit Integer x , where necessarily l <= 257 . | |
F4B7 | SUBDICTURPGET | x l D n - D' | Variant of SUBDICTRPGET with the prefix represented by an unsigned big-endian l -bit Integer x , where necessarily l <= 256 . |