Replies: 1 comment 1 reply
-
|
Hey, thanks for the suggestion! Once again consider joining the Discord, as it currently is the most active place for discussing these ideas, and more people can chime in. Regarding this proposal, I think we have two features in the plans that remedy the same problems. The first is a "pipe operator". In F# or Elm or other functional languages, there is this operator In Par, a similar operator would be used, but probably we'd use an arrow. So would be the same as Precedence would work like this would be the same as this Now, that's for expression syntax, but this becomes especially interesting, if we naturally extend it to process syntax. In process syntax, this Would be the same as So you see it acts very much like an extension method! Both in expression syntax and process syntax. The second feature helping here would be some kind of inference of generic types. Currently, you have to always explicitly write My current idea for remedying this would be to extend For example: instead of Here you can see that This is my current thinking there. Neither of these is implemented so far, but I hope it won't take too long. To me it sounds like these two together solve the problem you're trying to solve as well. What do you think? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Seems like i really like that project and able to generate something (i hope) useful.
I tried to follow intuition of "if i type dot, then i should see all available methods for this variable". I found that it is possible to create something like that in existing syntax but it looks too verbose.
Example with Rust highlight for easier understanding:
So, i would want to have an ability to declare "extension methods" and "static methods" for given type with some sort of syntax. Maybe static/dynamic impls. For now i imagine the following syntax:
If Par had macro system, it would be solved solely by that. But it also may be a part of language.
Dont think my new syntax is 100% good, i feel it lacks something. Anyway, it will make code easier to write.
Beta Was this translation helpful? Give feedback.
All reactions