Cantor set: Difference between revisions
m
→{{header|AppleScript}}: tidied. Added preamble.
m (→{{header|REXX}}: added whitespace, changed some comments.) |
m (→{{header|AppleScript}}: tidied. Added preamble.) |
||
Line 152:
=={{header|AppleScript}}==
<lang applescript>-- cantor :: [String] -> [String]▼
Using composable library functions whenever possible, for better productivity:
on cantor(xs)
script go
Line 169 ⟶ 173:
end cantor
---------------------------- TEST --------------------------
on run▼
showCantor(5)▼
end run▼
-- showCantor :: Int -> String
Line 178 ⟶ 187:
▲on run
▲ showCantor(5)
▲end run
▲-- GENERIC ------------------------------------------------
-- concat :: [[a]] -> [a]
Line 200 ⟶ 203:
acc
end concat
-- concatMap :: (a -> [b]) -> [a] -> [b]
Line 212 ⟶ 216:
return acc
end concatMap
-- map :: (a -> b) -> [a] -> [b]
Line 224 ⟶ 229:
end tell
end map
-- Lift 2nd class handler function into 1st class script wrapper
Line 236 ⟶ 242:
end if
end mReturn
-- iterate :: (a -> a) -> a -> Gen [a]
Line 300 ⟶ 307:
end if
end take
-- unlines :: [String] -> String
|