-
Notifications
You must be signed in to change notification settings - Fork 1
Possible Syntax Adjustment #1
Comments
In my opinion, with parentheses looks better, and people are more familiar with the parentheses |
Perhaps. I think it's mainly personal preference. On a similar note, what about this? I think we should consider changing the function syntax significantly let square x = x * x in F# for example meanwhile in elara it would be let square = (Int x) => x * x which obviously is pretty verbose If hypothetically we were to borrow F#'s syntax, we'd have a more concise syntax, functions and variables would still be declared in the same way, and we wouldn't need the hacky Thoughts? |
I still think that with |
Yeah I agree. As much as the current syntax is arguably clearer, the verbosity is going to be counter productive (especially considering that FP is all about small, repeatable functions) Perhaps we could use the |
How would the contract be defined for x in that example? |
Well, in F# there's some pretty powerful type inference for parameters. If Elara doesn't support that, we could do
perhaps Eg
|
Or of course something like
But I think parameter type inference is definitely something we should consider |
I liked this way |
This isn't anything fancy, just proposing a small tweak to function syntax
Would become
And
Would become
Without parentheses
Just an idea, but it looks cleaner imo
The text was updated successfully, but these errors were encountered: