aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-05 19:27:35 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-05 19:27:35 -0700
commit09a206d85bd7037168a50a6a76b038e37cb43e7e (patch)
treebacc7f554e32b77c564be71c66342c9cb7748e52
parent27a4aeb9987897dfc2c2a92868fe133811bec984 (diff)
downloadcppawk-09a206d85bd7037168a50a6a76b038e37cb43e7e.tar.gz
cppawk-09a206d85bd7037168a50a6a76b038e37cb43e7e.tar.bz2
cppawk-09a206d85bd7037168a50a6a76b038e37cb43e7e.zip
cons man page: new convention for undefined vars.
-rw-r--r--cppawk-cons.120
1 files changed, 13 insertions, 7 deletions
diff --git a/cppawk-cons.1 b/cppawk-cons.1
index 3d97e7b..dcf413f 100644
--- a/cppawk-cons.1
+++ b/cppawk-cons.1
@@ -456,6 +456,14 @@ denote that the expression
returns the value
.IR Y ,
+In examples, whenever a variable appears with one of the names
+.IR undef ,
+.I undef1
+or
+.IR undef2 ,
+it is to be understood as a variable that was not assigned, and
+therefore evaluates to the undefined value.
+
The
.B =>
notation indicates that
@@ -688,7 +696,7 @@ symbol, and not as \f"B"Snil"\fP.
box(0.707) => 0.707
box("") => "T"
box("abc") => "Tabc"
- box(undefined_var) => "U"
+ box(undef) => "U"
unbox(nil) => "nil" // name of symbol nil is "nil"
unbox(box("abc")) => "abc"
@@ -758,17 +766,15 @@ symbol as an argument instead of a cons, in which case they return
car(cons(1, 2)) -> 1
cdr(cons(1, "abc")) => "abc"
- // Below, abc and def are assumed to be unassigned.
-
// Without boxing, undefined gets treated as nil.
- cons(abc, def) => "C0,0:" -> (nil . nil)
- car(cons(abc, def)) => "" -> nil
+ cons(undef1, undef2) => "C0,0:" -> (nil . nil)
+ car(cons(undef1, undef2)) => "" -> nil
// Boxing passes through and recovers Awk undefined value
- cons(box(abc), box(def)) => "C1,1:UU" -> (#U . #U)
- car(cons(box(abc), box(def))) => ;; Awk undefined value
+ cons(box(undef1), box(undef2)) => "C1,1:UU" -> (#U . #U)
+ car(cons(box(undef1), box(undef1))) => ;; Awk undefined value
.ft R
.SS Function \fIsexp\fP