-
Notifications
You must be signed in to change notification settings - Fork 45
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
Change named arguments syntax to $name = value #192
Comments
This one leaves me a touch confused, and ultimately I prefer the old syntax, but this might just be because it parallels javascript so well. my reactions:
So ultimately, I prefer the current syntax, but I recognize that the new one could solve problems I haven't dug into. |
Thanks for sharing your thoughts, @hkasemir. I understand the internal conflict you're describing. Whenever I write JS and then go back to Fluent, I don't find The reason why I've suggested changing the syntax to To your second point, yes, this would effectively change the meaning of |
cool, sounds good! Those are good points, and I think after just a little mental re-framing, it's easy to see the benefits of this simplification. |
This sounds like something rather tough to implement for the python parser, is there enough to gain? |
Yes, the simplification of the syntax is worth the extra effort. Especially with #176, requiring the Looking at the Python parser, to keep the backwards compat for the archaeology use-case we'd need to first check for I would also like to point out that there's only one string in |
Moving this out of the Syntax 0.8 milestone, which shipped in mid-December. I'm keeping this issue open for now to make it easier to find in case it's relevant to people testing Syntax 0.8. |
This idea hit me when I was working on #176 (comment). It's long bothered me that we use colons
:
to define values of named arguments. It's different from how the values of messages, terms and attributes are defined.The reason to use
:
was to avoid ambiguity with definitions of new messages. This was particularly important in context of the indentation relaxation (#87), where a named argument formatted over multiple lines could produce a false positive for the error recovery:If all named arguments were required to start with the
$
sigil, there would be no ambiguity. It also makes sense semantically: named arguments define values of variables used by the function. And we could use the familiar=
for defining the values.The text was updated successfully, but these errors were encountered: