From c0670c50cc1d27beb9b2e8f4ac20d72f921c904e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 29 Nov 2021 18:20:35 -0500 Subject: Rename VNOT to NOTM and document it --- docs/implementation/vm.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'docs/implementation') diff --git a/docs/implementation/vm.html b/docs/implementation/vm.html index 76aa1002..6d6df758 100644 --- a/docs/implementation/vm.html +++ b/docs/implementation/vm.html @@ -291,7 +291,7 @@ 2C -VNOT +NOTM X @@ -477,6 +477,12 @@ Constant to match reference +2B +NOTM + r +Constant to not-reference + + 30 SETN x r (rx) @@ -557,8 +563,8 @@ -

Bodies: SETH VFYM PRED

-

SETH is a modification of SETN for use in header destructuring. It differs in that it doesn't place its result on the stack (making it more like SETN followed by POPS), and that if the assignment fails because the reference and value don't conform then it moves on to the next eligible body in the block rather than giving an error. VFYM converts a BQN value c to a special reference: assigning a value v to it should check if vc but do no assignment. Only SETH needs to accept these references, and it should treat non-matching values as failing assignment.

+

Bodies: SETH VFYM NOTM PRED

+

SETH is a modification of SETN for use in header destructuring. It differs in that it doesn't place its result on the stack (making it more like SETN followed by POPS), and that if the assignment fails because the reference and value don't conform then it moves on to the next eligible body in the block rather than giving an error. VFYM converts a BQN value c to a special reference: assigning a value v to it should check if vc but do no assignment. Only SETH needs to accept these references, and it should treat non-matching values as failing assignment. NOTM also creates a special reference, but it takes no inputs and the reference has no effect—it always counts as matching but performs no assignment.

PRED drops the top value of the stack, but also checks whether it matches the number 1. If it does match, execution continues; if not, evaluation of the current body ends and evaluation moves to the next eligible body.

Namespaces: FLDO FLDM ALIM RETD

A namespace is the collection of variables in a particular scope, along with an association mapping some exported symbols (case- and underscore-normalized strings) to a subset of these. It can be represented using a frame for the variables, plus the variable name list and mask of exported variables from that block's properties in the bytecode. RETD finishes executing the block and returns the namespace for that execution.

-- cgit v1.2.3