diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-06-06 06:59:38 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-06-06 06:59:38 -0700 |
commit | 6f1efc68c34a0c96e64f8d3919852dcb40eaecfd (patch) | |
tree | 2e874eafb64cb025e6504e9a670bc1da06dc2970 /txr.1 | |
parent | a58df6d48df211c57fb2065ae7146eaa2c23bd90 (diff) | |
download | txr-6f1efc68c34a0c96e64f8d3919852dcb40eaecfd.tar.gz txr-6f1efc68c34a0c96e64f8d3919852dcb40eaecfd.tar.bz2 txr-6f1efc68c34a0c96e64f8d3919852dcb40eaecfd.zip |
doc: relocate make-like.
* txr.1: Move description of make-like from near the bottom of
the Sequence Manipulation section to close to the top, just
under the seqp description. Also, ref-sequence parameter is
renamed to object.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 114 |
1 files changed, 57 insertions, 57 deletions
@@ -29152,6 +29152,63 @@ methods are considered sequences. No other objects are sequences. However, future revisions of the language may specify additional objects that are sequences. +.coNP Function @ make-like +.synb +.mets (make-like < list << object ) +.syne +.desc +The +.meta list +argument must be a list. If +.meta object +is a sequence type, +then +.meta list +is converted to the same type of sequence and returned. +Otherwise the original +.meta list +is returned. + +Conversion is supported to string and vector type. + +Conversion to a structure type is possible for structures. If +.meta object +is an object of a structure type which has a static function +.codn from-list , +then +.code make-like +calls that function, passing to it, and the resulting value is returned. +.meta list +and returns whatever value that function returns. + +If +.meta object +is a +.codn carray , +then +.meta list +is passed to the +.code carray-list +function, and the resulting value is returned. The second argument in the +.code carray-list +call is the element type taken from +.metn object . +The third argument is +.codn nil , +indicating that the resulting +.code carray +is not to be null terminated. + +Note: the +.code make-like +function is a helper which supports the development of +unoptimized versions of a generic function that accepts any type of +sequence as input, and produces a sequence of the same type as output. +The implementation of such a function can internally accumulate a list, and +then convert the resulting list to the same type as an input value +by using +.codn make-like . + .coNP Functions @ length and @ len .synb .mets (length << iterable ) @@ -33124,63 +33181,6 @@ function. #(4 5 6 7)) .brev -.coNP Function @ make-like -.synb -.mets (make-like < list << ref-sequence ) -.syne -.desc -The -.meta list -argument must be a list. If -.meta ref-sequence -is a sequence type, -then -.meta list -is converted to the same type of sequence and returned. -Otherwise the original -.meta list -is returned. - -Conversion is supported to string and vector type. - -Conversion to a structure type is possible for structures. If -.meta ref-sequence -is an object of a structure type which has a static function -.codn from-list , -then -.code make-like -calls that function, passing to it, and the resulting value is returned. -.meta list -and returns whatever value that function returns. - -If -.meta ref-sequence -is a -.codn carray , -then -.meta list -is passed to the -.code carray-list -function, and the resulting value is returned. The second argument in the -.code carray-list -call is the element type taken from -.metn ref-sequence . -The third argument is -.codn nil , -indicating that the resulting -.code carray -is not to be null terminated. - -Note: the -.code make-like -function is a helper which supports the development of -unoptimized versions of a generic function that accepts any type of -sequence as input, and produces a sequence of the same type as output. -The implementation of such a function can internally accumulate a list, and -then convert the resulting list to the same type as an input value -by using -.codn make-like . - .coNP Function @ nullify .synb .mets (nullify << iterable ) |