You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following discussion in #261, it was decided to move discussion about lambdas to a separate issue. There are a few unknowns still in regards to the implementation and syntax. The syntax is mostly a preference issue with many proposed syntax's.
Here are most or all of the discussed variations:
(a, b) => a + b
|a, b| = a + b
|a, b| => a + b
\(a, b) = a + b
\(a, b) => a + b
fn (a, b) = a + b
fn (a, b) a + b
The implementation aspect relates to closures and their handling which is not as straightforward a problem to solve. See #347 for more on this.
Other questions about the implementation were discussed in this comment but is copied below with the syntax updated to current numbat syntax for ease of access.
Do we want partial function application "by default"? Or would users have to curry/uncurry manually, i.e. write scale as fn scale(a) = |x| a * x and then use it with expr -> scale(10).
Do we need anonymous functions if we have closures and lambdas?
Do we want to keep both expr |> fn and expr -> fn? Right now, they are not 100% equivalent, expr |> fn can only be used for "proper" functions, while expr -> fn can also be used for other callables (function pointers), like in now() -> tz("Europe/Berlin")
The text was updated successfully, but these errors were encountered:
Following discussion in #261, it was decided to move discussion about lambdas to a separate issue. There are a few unknowns still in regards to the implementation and syntax. The syntax is mostly a preference issue with many proposed syntax's.
Here are most or all of the discussed variations:
The implementation aspect relates to closures and their handling which is not as straightforward a problem to solve. See #347 for more on this.
Other questions about the implementation were discussed in this comment but is copied below with the syntax updated to current numbat syntax for ease of access.
The text was updated successfully, but these errors were encountered: