sullyj3
Joined 12 years ago
Karma
1,004
Submissions
544
Member since
Jul 4
Joined 12 years ago
Anyone who's learned one or two languages should be able to pick up the basics of any of the standard ones pretty much instantaneously.
At a certain point, the reason we like some particular wacky physical model is always going to be "it has the best combination of explanatory power and simplicity"
Maybe this will make people tend to shorter lines, counterbalancing the natural tendency towards incomprehensibility of array and stack languages
(fn add-1 [x] (+ x 1))
(lambda add-2 [x] (+ x 2))
transpiles to the following lua: local function add_1(x)
return (x + 1)
end
local function add_2(x)
_G.assert((nil ~= x), "Missing argument x on /home/sullyj3/tmp/fn-vs-lambda/fnl/x.fnl:3")
return (x + 2)
end
return add_2 (*) <$> [1..10] <*> [2,3,5]
-- or
liftA2 (*) [1..10] [2,3,5]
Admittedly also not accessible to non-haskellers. But on the other hand, if you're going to learn a language, you ought to learn its idioms at some point.