From 54c04b9a04619ae4ef6159a2ca9e59ad00b99cc9 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 5 May 2022 14:35:14 -0400 Subject: =?UTF-8?q?Support=20identity=20element=20for=20F=E2=8C=9C=20if=20?= =?UTF-8?q?arithmetic=20function=20F=20has=20an=20identity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r1.bqn | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/r1.bqn b/src/r1.bqn index 4775ce47..5c15fbef 100644 --- a/src/r1.bqn +++ b/src/r1.bqn @@ -29,13 +29,14 @@ _glyphLookup_ ← { } _isGlyph ← { (glyphs _qSearch 𝕗) = {PrimInd𝕩} } IsJoin ← '∾'_isGlyph +IsTable ← '⌜'_isGlyph DIsConst ← (4=0⊸⊑)◶0‿('˙'_isGlyph 2⊸⊑) Split2 ← { s←2⊸×⌜↕(≠𝕩)÷2 ⋄ ⟨s⊏𝕩,(1⊸+⌜s)⊏𝕩⟩ } _lookup_ ← { k‿v←Split2 𝕘 ⋄ k _glyphLookup_ (v∾⟨𝕗⟩) } -Identity ← {𝕏0} !∘"´: Identity not found" _lookup_ ⟨ +ScalId ← @ _lookup_ ⟨ '+',0 , '-',0 '×',1 , '÷',1 '⋆',1 , '¬',1 @@ -44,6 +45,11 @@ Identity ← {𝕏0} !∘"´: Identity not found" _lookup_ ⟨ '≠',0 , '=',1 '>',0 , '≥',1 ⟩ +TabId ← { + id ← (4=0⊸⊑)◶⟨0,(IsTable 2⊸⊑)⟩◶⟨@,ScalId 1⊸⊑⟩ Decompose 𝕩 + "´: Identity not found" ! @≠id ⋄