summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-08-02 06:58:07 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-08-02 06:58:07 -0700
commit44e5337cb3f3f9d79e9c310bf50f5dca4156b5a7 (patch)
tree44e6f5c6c52aad8c2a1580813d852d9604710e85 /txr.1
parentca96062bb30e28586873ad491e4912cf599aaaab (diff)
downloadtxr-44e5337cb3f3f9d79e9c310bf50f5dca4156b5a7.tar.gz
txr-44e5337cb3f3f9d79e9c310bf50f5dca4156b5a7.tar.bz2
txr-44e5337cb3f3f9d79e9c310bf50f5dca4156b5a7.zip
doc: explain qref and uref.
* txr.1: Under the qref and uref operators, mention what these stand for and how the terminology is derived.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.123
1 files changed, 17 insertions, 6 deletions
diff --git a/txr.1 b/txr.1
index 4a33879b..35683f06 100644
--- a/txr.1
+++ b/txr.1
@@ -23278,9 +23278,9 @@ once.
.desc
The
.code qref
-macro performs structure slot access. Structure slot access is more
-conveniently expressed using the referencing dot notation, which works
-by translating to qref
+macro ("quoted reference") performs structure slot access. Structure slot
+access is more conveniently expressed using the referencing dot notation, which
+works by translating to qref
.code qref
syntax, according to the following equivalence:
@@ -23327,7 +23327,7 @@ following equivalence applies:
(qref o n) <--> (slot o 'n)
.cble
-Where
+where
.code slot
is the structure slot accessor function. Because
.code slot
@@ -23336,6 +23336,11 @@ slots can be modified via assignment to the
.code qref
form and the referencing dot syntax.
+The slot name being implicitly quoted is the basis of the term
+"quoted reference", giving rise to the
+.code qref
+name.
+
A compound designator indicates that the named slot is a function,
and arguments are to be applied to it. The following equivalence applies
in this case, except that
@@ -23394,8 +23399,8 @@ leftmost argument, so that the function has access to the object.
.desc
The
.code uref
-macro expands to an expression which evaluates to a function.
-The function takes exactly one argument: an object.
+macro ("unbound reference") expands to an expression which evaluates to a
+function. The function takes exactly one argument: an object.
When the function is invoked on an object, it references slots
or methods relative to that object.
@@ -23433,6 +23438,12 @@ argument is present, these equivalences also hold:
(uref s) <--> (usl s)
.cble
+The terminology "unbound reference" refers to the property that
+.code uref
+expressions produce a function which isn't bound to a structure
+object. The function binds a slot or method; the call to that function then
+binds an object to that function, as an argument.
+
.TP* Examples:
Suppose that the objects in