READ
Evaluates code in a context of a new read transaction
Input stack: code
Output stack: result of code
evaluation
This instruction is one of two ways one can read from the database. Instructions like RETR are only possible in the context of a READ or a WRITE.
The total number of simultaneous read transactions is limited to 126.
PumpkinDB> ["hi" RETR] READ
Allocation
Will allocate for code
appended with an internal transaction end
marker instruction.
Errors
EmptyStack error if stack is less than one item on the stack.
DatabaseError error if there's a problem with underlying storage.
Decoding error error if the code is undecodable.
Tests
evals : [1] READ.
invalid_code : [1 READ] TRY UNWRAP 0x05 EQUAL?.
empty_stack : [READ] TRY UNWRAP 0x04 EQUAL?.