Example Lambda argCount 001
|
Notes and Hints An Analytic Information Server Lambda may be defined, with a definite list (fixed)
or an indefinite list of arguments (variable) The ellipses at the end of the
argument list indicates the function has indefinite arguments. At run time, the
Lambda's arguments are bound to the specified definite arguments respectively. The
Lisp compiler can detect and generate an error message when there are too few
arguments in the definite argument list. If the number of arguments exceed the
number of definite arguments, the excess arguments can only be accessed during
runtime via the argCount and argFetch functions. (See the lambda
special form).
(define SumNums
(lambda (X ...) vars:(Z)
(setq Z X)
(loop for i from 1 until (argCount) do
(setq Z (+ Z (argFetch i))))
Z )) ;return the result of adding
Returns:
Returns:
Here are examples of the argCount function at work.
Lambda argCount 001 |
Here is the link to the current function used in this example.
Here are a number of links to other related functions.
argFetch(#void) |
Here are the links to the data types of the arguments used in this example. Here are a number of links to examples having similar argument types.
Lambda
Analytic Information Server (AIS)AIS Component Systems
|