Pascal's triangle: Difference between revisions
m
→{{header|AppleScript}}: updated primitive
m (→{{header|AppleScript}}: updated primitive) |
|||
Line 358:
-- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
on zipWith(f, xs, ys)
set
if nx < 1 or ny < 1 then
set
tell mReturn(f)
end repeat▼
repeat with i from 1 to lng
return lst▼
set end of lst to lambda(item i of xs, item i of ys)
▲ end repeat
▲ return lst
end tell
end if
end zipWith
-- cond :: Bool -> (a -> b) -> (a -> b) -> (a -> b)
on cond(bool, f, g)
if bool then
f
▲ else
g
end if
end cond
-- intercalate :: Text -> [Text] -> Text
|