-
-
Notifications
You must be signed in to change notification settings - Fork 36
Clarify that variables declarations may override previous ones #381
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -275,6 +275,20 @@ This local variable can then be used in other expressions within the same messag | |
declaration = let s variable [s] "=" [s] expression | ||
``` | ||
|
||
Declaration examples: | ||
|
||
``` | ||
let $foo = {|A literal value|} | ||
``` | ||
|
||
``` | ||
let $foo = {:func opt=$bar} | ||
``` | ||
|
||
``` | ||
let $foo = {$foo :number minimumFractionDigits=2} | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though it's explained in the formatting doc, is it worth explaining here as well that in the third example, either there must be a previous in-scope definition of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better example would make the second There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @aphillips Fair point. However, I'd like it if there was some place to put an example like this:
It would be useful for explaining the meaning of variable resolution if the example said: "If this message resolves to a string, the string is '5.00'." That would show that the Probably the Anyway, for illustrating the syntax, I'm OK with either or both. |
||
|
||
### Selectors | ||
|
||
A `match` statement contains one or more **_selectors_** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that last time we proposed to not allow overriding.
Compared to programming, these messages are a relatively short "code block"
There should be no problem to just use a different name.
It just introduces complexity without any benefit that I can imagine.