Carapace

Evaluation

function name description
apply apply the given function to the supplied list of arguments
objectApply apply the method of the given object to the supplied list of arguments
eval evaluate the supplied expression
quote protect the argument from evaluation
stop stop the interactive parser


apply

Apply the given function to the supplied list of arguments. The values within the list are assumed to have been evaluated -- no further evaluation takes place before the argument list is given to the function being applied.

Arguments:

functionSymbol
argumentsList

Return type: Object - this is the result returned by the applied function.


objectApply

Apply tthe method of the given object to the supplied list of arguments -- no further evaluation takes place before the argument list is given to the function being applied.

Arguments:

objectObject
methodSymbol
argumentsList

Return type: Object - this is the result returned by the applied method.


eval

Evaluate the supplied expression. Except for objects of type List and Symbol, an object evaluates to itself.

A List is taken to be a function expression, the head being the function name, the tail being the argument list.

A Symbol is taken to stand for either a global variable (if it starts with a double colon :: or a local variable. Its value is looked up in the appropriate environment.

Arguments:

exprObject

Return type: Object


quote

Protect the argument from evaluation. For example:

    (defun NIL test ()

        (local (a Integer)
        )

        (set a 33)

        (print a)                   # prints the value of a ie. 33

        (print (quote a))           # stops a from being evaluated, so prints out the symbol: a

        (print (eval (quote a)))    # the quote protects against evaluation, returning the symbol a
                                    # but the eval re-evaluates it to give 33

    )

Arguments:

objObject

Return type: Object


stop

Stop the interactive parser. All objects in existence are destroyed and the interpreter finishes.

Arguments: none

Return type: Object


Contents Index Current topic: functions