diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-15 11:08:41 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-15 11:08:41 -0400 |
| commit | df001f1e38276a4b2a276042ca498c778c64e0ad (patch) | |
| tree | 9dff3055d673906ff2204fa7821f1569f8a51509 | |
| parent | 9c3608eab28788007b052cc600a8e210bb70b679 (diff) | |
Use •Repr for numeric formatting
| -rw-r--r-- | md.bqn | 2 | ||||
| -rwxr-xr-x | src/cjs.bqn | 2 | ||||
| -rw-r--r-- | test/this.bqn | 4 | ||||
| -rwxr-xr-x | wc.bqn | 2 |
4 files changed, 5 insertions, 5 deletions
@@ -624,7 +624,7 @@ GetMultiHighlights ← { # Format an array to a character matrix # Won't work on functions until we can catch errors fmtm ← •Import "src/f.bqn" -Fmt ← ⟨•Type,•Decompose,•Glyph,⍕⟩ _fmtm +Fmt ← ⟨•Type,•Decompose,•Glyph,•Repr⟩ _fmtm ################################ diff --git a/src/cjs.bqn b/src/cjs.bqn index 59e6ab3b..993bc386 100755 --- a/src/cjs.bqn +++ b/src/cjs.bqn @@ -14,7 +14,7 @@ Esc←{ }⍟(0<≠) Str ← "str("""∾Esc∾""")"˜ # A BQN string Char ← "'"(∾∾⊣)Esc∘⥊ # A BQN character -F ← ⍕ #•Fmt # Native format +F ← •Repr # Native format FP ← ∞⊸=◶⟨F,"Infinity"⟩ # Format positive number Num ← 0⊸≤◶⟨"-"∾FP∘|,FP⟩ # Format number diff --git a/test/this.bqn b/test/this.bqn index 179bc0fa..470aac8d 100644 --- a/test/this.bqn +++ b/test/this.bqn @@ -10,10 +10,10 @@ M ← {e‿b←𝕩 """",b,""": expected " "to fail"⍟("!"⊸≡)e " but " - 0⊸≡◶⟨"received "∾·•Fmt⊑,"evaluation failed"⟩𝕩 + 0⊸≡◶⟨"received "∾·•Repr⊑,"evaluation failed"⟩𝕩 ⥊@+10 ⟩} ("!"⊸≡◶⟨<Native,0˙⟩ e) ≢◶""‿Msg <∘Exec⎊0 b } r ← (M '%'⊸= (∨´⊣)◶⟨"1"≍○<⊢, Trim¨(+`-2⊸×)⊸⊔⟩ ⊢)¨ c -•Out ("All "∾(•Fmt≠c)∾" passed!")⍟(0=≠) ¯1↓∾r +•Out ("All "∾(•Repr≠c)∾" passed!")⍟(0=≠) ¯1↓∾r @@ -86,4 +86,4 @@ WCompile←{ Gen ⟨(≠¨f)/(1‿2‿0≍¨1)⥊¨¨f64 ⋄ 2 ⋄ ∾f⟩ } -•Out ∾((@+10)«·∾(" "∾•Fmt)¨)∘WCompile¨ •args +•Out ∾((@+10)«·∾(" "∾•Repr)¨)∘WCompile¨ •args |
