19 lines
261 B
Text
19 lines
261 B
Text
templates fold&{op:}
|
|
@: $(1);
|
|
$(2..last)... -> @: [$@, $] -> op;
|
|
$@ !
|
|
end fold
|
|
|
|
templates add
|
|
$(1) + $(2) !
|
|
end add
|
|
|
|
templates mul
|
|
$(1) * $(2) !
|
|
end mul
|
|
|
|
[1..5] -> fold&{op:add} -> '$;
|
|
' -> !OUT::write
|
|
|
|
[1..5] -> fold&{op:mul} -> '$;
|
|
' -> !OUT::write
|