aboutsummaryrefslogtreecommitdiff
path: root/vm.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-11-28 19:31:51 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-11-28 19:37:12 -0500
commit92bd804e1249774b33f54cc9b8504ac9e72ca651 (patch)
tree97d4eb44d75733bc75f4c5f7523f45c8f7850c87 /vm.bqn
parentb2df3496227d2d7ebe1363fad0bafbfcb2a6efb4 (diff)
Allow · as placeholder in assignment and headers
Diffstat (limited to 'vm.bqn')
-rw-r--r--vm.bqn2
1 files changed, 2 insertions, 0 deletions
diff --git a/vm.bqn b/vm.bqn
index 052ef1a2..a481a695 100644
--- a/vm.bqn
+++ b/vm.bqn
@@ -14,6 +14,7 @@ MakeVar ← { program 𝕊 name:
}
GetF ⇐ {program 𝕩.Field name}
}
+vnot ← { SetU⇐SetN⇐⊢ ⋄ SetQ⇐0˙ }
MakeEnv ← { 𝕊p‿v‿n‿e:
ns ← v-≠n # Number of special names
parent ⇐ p
@@ -107,6 +108,7 @@ ops ← ((!∘"Unknown opcode")˙⊣´⊢)¨ ⊔˝ ⍉> ⟨
# Headers
42‿( {s𝕊e: {0:s.Skip@; 1:@; 𝕊:!"Predicate value must be 0 or 1"} ⊑s.Pop 1 }˙)
43‿( {s𝕊e: s.Push ref.Matcher ⊑s.Pop 1 }˙)
+ 44‿( {s𝕊e: s.Push vnot }˙)
# Assignment
47‿( {s𝕊e: s.Skip⍟⊢{r‿ v: r.SetQ v } s.Pop 2 }˙) # r:
48‿( {s𝕊e: s.Push { r‿ v: r.SetN⊸⊢ v } s.Pop 2 }˙) # r ←v