-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a list datatype #261
Comments
What should be the pattern to work with it? I see two big paths personally;
|
We could maybe do this with |
Those are good questions, and I currently don't have an answer. I certainly see Numbat as a kind of functional programming language. As for the lambda syntax, I personally prefer the Rust style |
#398 also brings up the question of whether we should also add (heterogeneously-typed) tuples and not just lists. Thoughts?
I really dislike the Python syntax personally (also doesn't really fit in with the rest of the Numbat syntax), but a bit more on the fence about Rust-style vs Haskell-style syntax. Would the Rust-style syntax possibly introduce parsing difficulties if we decide to add |
Since you can’t use the |
Some cool things we could do with lists:
|
Bit tangential, but how would we deal with heterogeneous lists (e.g. |
We wouldn't 😄. That is, until we add sum types. |
Of course. :) |
Syntax-wise, I'd prefer JS, |
I personally would prefer the same style as well, but there is a pretty good argument against it as well. I consider the following possibilities to be good compromises between a widely recognizable style and one in line with numbats style.
I don't particularly like the Haskell inspired ones though, as they are a bit of a pain to write on danish keyboards. |
The simple |
I also like |
Can we please move the lambda-syntax discussion to a new ticket that discusses lambdas in general? |
List<T>
?The text was updated successfully, but these errors were encountered: