Named-Procedure Templates

The second form of template is the "named-procedure" form. If the template is a word rather than a list, it is taken as the name of a procedure. That procedure must accept a number of inputs equal to the number of parallel data slots provided by the tool; the procedure is applied to all the available data in order. That is, if data ?1 through ?3 are available, the template "PROC is equivalent to [PROC ?1 ?2 ?3].

Example:

SHOW (MAP "WORD [a b c] [d e f])
[ad be cf]

TO DOTPRODUCT :a :b  ; vector dot product
  OUTPUT APPLY "sum (MAP "product :a :b)
END


SourceForge.net Logo