TRANSFER

Synopsis
TRANSFER endtest template inbasket
Description

Outputs the result of repeated evaluation of the template input. The template is evaluated once for each member of the list inbasket. TRANSFER maintains an "out basket" that is initially the empty list. After each evaluation of the template, the resulting value becomes the new "out basket". When all input has been processed, TRANSFER outputs the "out basket".

In the template, the symbol ?IN represents the current item from inbasket; the symbol ?OUT represents the entire current "out basket". Other slot symbols should not be used.

If the endtest input is an empty list, evaluation continues until all inbasket members have been used. Otherwise, the endtest input must be a predicate expression template, and evaluation continues until either that template's value is TRUE or inbasket is used up.

Example

For each word in the last input, if that word is already part of the result, forget it; if not, append that word to the result so far. The result is initially empty.

SHOW TRANSFER [] [IFELSE MEMBERP ?IN ?OUT [?OUT] [LPUT ?IN ?OUT]] [A B C B D E F B C G]
[A B C D E F G]

SourceForge.net Logo