From 6b92ce62a59b7324c6b7da0f4469b55cf64b1d7b Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 19 Nov 2021 16:31:46 -0500 Subject: Update documentation on calling formatter (f.bqn) --- docs/implementation/vm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/implementation/vm.html') diff --git a/docs/implementation/vm.html b/docs/implementation/vm.html index 6674ced8..56a020a7 100644 --- a/docs/implementation/vm.html +++ b/docs/implementation/vm.html @@ -723,7 +723,7 @@
  • Evaluate the bytecode $ src/cjs.bqn r, passing the core runtime provide in the constants array. The result is a BQN list of a full runtime, and a function SetPrims.
  • Optionally, call SetPrims on a two-element list Decompose, PrimInd.
  • Evaluate the bytecode $ src/cjs.bqn c, which uses primitives from the runtime in its constants array. This is the compiler.
  • -
  • Evaluate the bytecode $ src/cjs.bqn f. This returns a 1-modifier. To obtain the formatter, call it on a four-element operand list Type, Decompose, Glyph, FmtNum.
  • +
  • Evaluate the bytecode $ src/cjs.bqn f. This returns a function. Then call it on a four-element list Type, Decompose, Glyph, FmtNum to obtain the two-element list •Fmt, •Repr.
  • The compiler takes the runtime as 𝕨 and source code as 𝕩. To evaluate BQN source code, convert it into a BQN string (rank-1 array of characters), pass this string and runtime to the compiler, and evaluate the result as bytecode. Results can be formatted with the formatter for use in a REPL, or used from the implementation language.

    Two formatter arguments Glyph and FmtNum are not part of the runtime. Glyph assumes 𝕩 is a primitive and returns the character (not string) that represents it, and FmtNum assumes 𝕩 is a number and returns a string representing it.

    -- cgit v1.2.3