summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.189
1 files changed, 89 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 85116591..a4bf6237 100644
--- a/txr.1
+++ b/txr.1
@@ -53186,6 +53186,95 @@ which must be an integer.
.um logcount
.um bitset
+.SS* Enumerated Constants
+
+The enumerated constants module provides ways for defining
+multiple constants whose names are ranges of consecutive integers
+or characters.
+
+Enumerated constants are implemented as symbol macros.
+
+.coNP Macro @ defenum
+.synb
+.mets (defenum >> { sym | >> ( sym << value )}*)
+.syne
+.desc
+The
+.code defenum
+macro defines zero or more constants, whose names are given by the
+.meta sym
+arguments.
+
+The
+.meta sym
+arguments must be bindable symbols.
+Each argument to
+.code defenum
+must be either a
+.meta sym
+or else a two-element expression combining a
+.meta sym
+and a
+.metn value .
+The
+.meta value
+must be an integer or character object. The
+.meta value
+is not an expression subject to evaluation.
+
+If no
+.meta value
+is specified for the leftmost
+.metn sym ,
+that
+.meta sym
+is implicitly associated with the value
+.code 0
+(integer zero).
+In any other position, if no
+.meta value
+is specified for a
+.metn sym ,
+it is implicitly associated with a value one greater than
+the value of the previous
+.metn sym ,
+as computed by the
+.code succ
+function applied to that value.
+
+The
+.code defenum
+macro generates a which establishes each
+.meta sym
+as a global symbol macro (as if by
+.codn defsymacro )
+whose value is the corresponding
+.metn value .
+
+.coNP Macro @ enumlet
+.synb
+.mets (enumlet >> ({ sym | >> ( sym << value )}*) << body-form *)
+.syne
+.desc
+The arguments of
+.code enumlet
+are subject exactly the same restrictions and denote the same
+.meta sym
+and
+.meta value
+associations as those of
+.codn defenum .
+
+Whereas the
+.code defenum
+macro generates a form that binds global symbol macros, the
+.code enumlet
+macro generates a form which binds local symbol macros (as if by
+.codn symacrolet )
+and arranges for zero or more
+.metn body-form s
+to be evaluated in the scope of these symbol macros.
+
.SS* Exception Handling
An