diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-03-07 19:57:05 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-03-07 19:57:05 -0800 |
commit | 80c985bc48a448e53ee5ef9c5e4910f598f5af7e (patch) | |
tree | d969f6b34da4167509fbbfa49cbf7930f81a9073 | |
parent | fe1d0cb216b54a511ab9e3dc4f41b3ce09075997 (diff) | |
download | txr-80c985bc48a448e53ee5ef9c5e4910f598f5af7e.tar.gz txr-80c985bc48a448e53ee5ef9c5e4910f598f5af7e.tar.bz2 txr-80c985bc48a448e53ee5ef9c5e4910f598f5af7e.zip |
doc: improvements in dwim and call documentation
* txr.1: Under call function, document that callable
objects need not be functions; the dwim operator
description has the details.
Fix a formatting problem in the dwim operator
syntax synopsis. Under dwim, clarify in more detail
that the behavior for various objects are a consequence
of their function calling semantics, rather than
inherent in the dwim operator.
-rw-r--r-- | txr.1 | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -15850,6 +15850,13 @@ function invokes .metn function , passing it the given arguments, if any. +.meta function +need not be a function; other kinds of objects +can be used in place of functions with various semantics. +The details are given in the description of the +.code dwim +operator. + .TP* Examples: Apply .code lambda @@ -16069,7 +16076,7 @@ retrieve a global macro expander using the function .mets (set (dwim >> { integer | << range } << obj-place ) << new-value ) .mets <> '[' argument *']' .mets (set >> '[' obj-place < index <> [ alt ]']' << new-value ) -.mets (set >> '[{' integer | << range } << obj-place']' << new-value ) +.mets (set >> '[{' integer | << range } << obj-place ']' << new-value ) .syne .desc The @@ -16425,10 +16432,17 @@ according to the endpoints of .RE .PP -Note that the various above forms are not actually special cases of +Note that the various above forms are not actually cases of the .code dwim -but the consequence of the objects appearing as the first argument being -callable as functions, and their respective semantics. +operator but the due to the semantics of the left argument objects being used +as functions. All of the semantics described above is available in any +situation in which an object is used as a function: for instance, as an +argument of the +.code call +or +.code apply +operators, or the functional argument in +.codn mapcar . .TP* "Range Indexing:" Vector and list range indexing is based from zero, meaning |