From 68a6d369290859aa3188c79ed7d73db58e9ac234 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 23 Aug 2021 07:20:55 -0400 Subject: =?UTF-8?q?Specification=20for=20=E2=80=A2MakeREPL,=20=E2=80=A2sta?= =?UTF-8?q?te,=20and=20evaluation=20left=20arguments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/spec/system.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/spec/system.html') diff --git a/docs/spec/system.html b/docs/spec/system.html index e95be2ab..d4b56cf4 100644 --- a/docs/spec/system.html +++ b/docs/spec/system.html @@ -30,11 +30,16 @@ Evaluate the argument string in a child scope +•MakeREPL +Create an evaluator that keeps variables across runs + + •Using Import all values from the argument namespace +

The left argument to any evaluator (•BQN, •Eval, •ScopedEval, result of •MakeREPL), if given, is a list of up to three elements, giving a prefix of •state (see next section) during evaluations of that function. Thus "","xyz"•BQN"•name" returns "xyz".

The effect of •Eval should be the same as if its argument were written as source code in the scope where •Eval appears. It can define variables, and modify those in the current scope or a parent.

•ScopedEval creates as new scope for evaluation as it is loaded. Other than its syntactic role, it is effectively equivalent to {•Eval}. Parent scopes are visible from the created scope; to make a scope without this property use •BQN"•Eval" or •BQN"•ScopedEval".

Scripts

@@ -51,6 +56,10 @@ Load a script file +•state +•path, •name, •args + + •args Arguments passed to current file -- cgit v1.2.3