diff options
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 24 |
1 files changed, 16 insertions, 8 deletions
@@ -5022,10 +5022,11 @@ If the form is a function call then the arguments are evaluated. If any of the arugments are symbols, they are treated according to Lisp-2 namespacing rules. Additionally, if there is an expression in the dotted position, it is also -evaluated. It should evaluate to a list or vector. The elements of the list -or vector generate additional arguments for the function call. -In some other Lisp dialects, a function called apply (or similar) must be -used to do the same thing. +evaluated. It should evaluate to a sequence: a list, vector or string. The +elements of the sequence generate additional arguments for the function +call. In some other Lisp dialects, a function called apply (or similar) must +be used to do the same thing, and applying sequences other than lists is not +supported. The DWIM brackets are similar, except that the first position is an arbitrary expression which is evaluated according to the same rules as the remaining @@ -5041,9 +5042,11 @@ Examples: ;; a contains 3 ;; b contains 4 ;; c contains #(5 6 7) + ;; s contains "xyz" (foo a b . c) ;; calls (foo 3 4 5 6 7) (foo a) ;; calls (foo 3) + (foo . s) ;; calls (foo #\ex #\ey #\ez) [foo a b . c] ;; calls (foo 3 4 5 6 7) @@ -7130,14 +7133,16 @@ can be expressed as: .TP Syntax: - (apply <function> <arglist>) + (apply <function> <argsequence>) .TP Description: -The apply function converts a list of values <arglist> into individual arguments -which are passed to <function>. The return value of the apply invocation is -that of <function>. +The apply function converts a sequence of values <argsequence> into individual +arguments which are passed to <function>. The return value of the apply +invocation is that of <function>. + +<argsequence> must be list, vector or string. .TP Examples: @@ -7145,6 +7150,9 @@ Examples: ;; '(1 2 3) becomes arguments to list, thus (list 1 2 3). (apply (fun list) '(1 2 3)) -> (1 2 3) + ;; "abc" is separated into characters which become arguments of list + (apply (fun list) "abc") -> (#\ea #\eb #\ec) + .TP Dialect Note 1: |