Apply a callback to an array: Difference between revisions

(Added Bracmat example)
Line 141:
array[ +4] = +16
</pre>
 
=={{header|AppleScript}}==
<lang applescript>on callback for arg
-- Returns a string like "arc has 3 letters"
arg & " has " & (count arg) & " letters"
end callback
 
set alist to {"arc", "be", "circle"}
repeat with aref in alist
-- Passes a reference to some item in alist
-- to callback, then speaks the return value.
say (callback for aref)
end repeat</lang>
 
If the callback would <code>set arg's contents to "something"</code>, then <code>alist</code> would be mutated.
 
=={{header|AutoHotkey}}==
Anonymous user