Phrase reversals: Difference between revisions
m
→{{header|AppleScript}}: Subheaders added. Typo correction in Idiomatic solution.
m (→{{header|AppleScript}}: Subheaders added. Typo correction in Idiomatic solution.) |
|||
Line 137:
=={{header|AppleScript}}==
===Functional===
AppleScript has a very small and patchy library of primitive functions. To accumulate a larger and more coherent library, which includes some higher order functions, we can try to overcome two architectural weaknesses: 1. Built-in functions have a different type from user functions, and 2. user functions are second class properties of (first class) script objects.
Line 271 ⟶ 272:
reversal phrase code rosetta"</pre>
----
===Idiomatic===
▲<lang applescript>set aString to "rosetta code phase reversal"
set astid to AppleScript's text item delimiters
set AppleScript's text item delimiters to ""
set
set AppleScript's text item delimiters to space
set
set
set AppleScript's text item delimiters to linefeed
set output to {
set AppleScript's text item delimiters to astid
return output</lang>
{{output}}
<
attesor edoc
reversal
=={{header|AutoHotkey}}==
|