aboutsummaryrefslogtreecommitdiff
path: root/README.adoc
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-05-26 19:44:03 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-05-26 20:15:43 +0200
commit3e68a09ae1617551ca1cbf3b5b72621170b4aa0c (patch)
tree8e5234c897c48c40c6e1f75e74febdc51e06e963 /README.adoc
parent8414e07010b2265db3cbbd2854d8dc49acc63ac8 (diff)
downloadell-3e68a09ae1617551ca1cbf3b5b72621170b4aa0c.tar.gz
ell-3e68a09ae1617551ca1cbf3b5b72621170b4aa0c.tar.xz
ell-3e68a09ae1617551ca1cbf3b5b72621170b4aa0c.zip
Remove suck
struct context::arguments stank, the "arg" special form stank. The amount of lines this adds can be counted on one hand.
Diffstat (limited to 'README.adoc')
-rw-r--r--README.adoc18
1 files changed, 9 insertions, 9 deletions
diff --git a/README.adoc b/README.adoc
index c31b576..12a397c 100644
--- a/README.adoc
+++ b/README.adoc
@@ -52,8 +52,8 @@ For a slightly more realistic example have a look at 'greet.ell'.
Runtime
-------
Variables use per-block dynamic scoping. Arguments to a block (which is a list
-of lists) must be assigned to variables first using the `arg` special form, and
-that must happen before they get overriden by execution of a different block.
+of lists) are assigned to local variables named `1`, `2`, etc., and the full
+list of them is stored in `*`.
When evaluating a command, the first argument is typically a string with its
name and it is resolved as if `set` was called on it.
@@ -64,19 +64,18 @@ Special Forms
-------------
`quote [<arg>]...`
-Returns the arguments without any evaluation.
-
-`arg [<name>]...`
-
-Assigns arguments to the current block in order to given names. Names for which
-there are no values left default to `[]`. This form can effectively be used to
-declare local variables.
+Like `values` but returns the arguments without any evaluation.
Standard library
----------------
The standard library interprets the empty list and the empty string as false
values, everything else is taken as true.
+`local <names> [<value>]...`
+
+Create local variables in the current block. Names for which there are no
+values left default to `()`.
+
`set <name> [<value>]`
Retrieve or set a named variable. The syntax sugar for retrieval is `@`.
@@ -167,6 +166,7 @@ Install development packages for GNU Readline to get a REPL for toying around:
Possible Ways of Complicating
-----------------------------
+ * `local [_a _b _rest] @*` would elegantly solve the problem of varargs
* reference counting: currently all values are always copied as needed, which
is good enough for all imaginable use cases, simpler and less error-prone