HigherOrderCO / Bend

A massively parallel, high-level programming language
https://higherorderco.com
Apache License 2.0
17.19k stars 424 forks source link

FEATURES.md: add a bit more context or introduction to lambda functions syntax #437

Open MrOnlineCoder opened 3 months ago

MrOnlineCoder commented 3 months ago

I've been reading through FEATURES.md but at the section of "Some caveats and limitations", an example with lambda symbol is dropped right away without, in my opinion, a proper introduction explaining the Bend syntax for it and how it handles them:

def scott_list.add(xs, add):
  xs(
    λxs.head xs.tail: λc n: (c (xs.head + add) scott_list.sum(xs.tail, add)),
    λc λn: n
  )

I suppose newbies (and comers from regular imperative languages) like me would appreciate if you could clarify it a bit. Also if it's just a complete 1-to-1 mapping of regular lambda calculus, then maybe it's worth leaving a link in the docs to the article/paper, for thoose interested, in order to get familiar with that. Thanks

developedby commented 3 months ago

The whole point is that if you use lambdas, then some things are dangerous. I'll word it better.