Takes the topmost item from the stack and pushes
1 to the stack
if the key is present,
0 if it is not.
This example demonstrates testing of the key presence both within READ and WRITE transaction scopes:
PumpkinDB> ["hi" "there" ASSOC "hi" ASSOC? COMMIT] WRITE ["hello" ASSOC?] READ 0x01 0x00
hello key was not associated (only
hi was), the second boolean value
EmptyStack error if there are less than two items on the stack
NoTransaction error if there's no current read or write transaction
present : "hi" DUP "there" [ASSOC COMMIT] WRITE [ASSOC?] READ. not_present : "hi" "there" [ASSOC COMMIT] WRITE "bye" [ASSOC?] READ NOT. assocp_requires_txn : [0 ASSOC?] TRY UNWRAP 0x08 EQUAL?. assoc_requires_one_item : [[ASSOC] WRITE] TRY UNWRAP 0x04 EQUAL?.