Closed
Bug 816884
Opened 13 years ago
Closed 9 years ago
Add Boolean literal
Categories
(L20n :: General, defect)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
Next
People
(Reporter: zbraniecki, Unassigned)
Details
We decided that we need a new literal type - boolean.
It will be used in two scenarios:
- local attributes may have values of type boolean (_person=True)
- macros may return booleans (<isBlue {{ True }}>)
The exact syntax proposed is: "True" for true, "False" for false.
Comment 1•13 years ago
|
||
(In reply to Zbigniew Braniecki [:gandalf] from comment #0)
> - local attributes may have values of type boolean (_person=True)
The exact syntax would be:
<foo "Foo"
_bar: True
_baz: False
quux: "Quux"
>
The thinking behind this is that we don't want to break the promise we make to the developer that everything they get from the context is a string. Public attributes can be accessed by the developer, and so they need to be strings. Local attributes, however, are off-limits.
Additionally, Bool's intended use is to describe language-specific meta-data of the entity. This kind of information is not symmetric between languages so it makes sense to restrict its use to local attributes only.
> - macros may return booleans (<isBlue {{ True }}>)
Syntax nit; this should read:
<isBlue { True }>
Comment 2•13 years ago
|
||
"True" and "False" will become reserved keywords. We decided not to reserve any others (the ideas included None, Null, Nil and Undefined). I reckon that if needed, we can provide similar functionality with macros in the future, e.g. @exists(entity..non_existing_attr).
| Reporter | ||
Comment 3•13 years ago
|
||
(In reply to Staś Małolepszy :stas (traveling until Dec 4) from comment #1)
> (In reply to Zbigniew Braniecki [:gandalf] from comment #0)
> > - macros may return booleans (<isBlue {{ True }}>)
>
> Syntax nit; this should read:
>
> <isBlue { True }>
Syntax nit; this should read:
<isBlue() { True }>
Comment 4•13 years ago
|
||
Haha, you're right :)
Updated•13 years ago
|
Priority: -- → P3
Target Milestone: --- → 1.0
Comment 5•13 years ago
|
||
(In reply to Staś Małolepszy :stas (traveling until Dec 4) from comment #2)
> [...] we can provide similar functionality with macros in the
> future, e.g. @exists(entity..non_existing_attr).
Bug 817617.
Updated•13 years ago
|
Assignee: nobody → stas
Priority: P3 → P2
Target Milestone: 1.0 → 1.0 beta
Comment 6•13 years ago
|
||
Moving this feature to Next. It's still possible to use strings to achieve the same thing:
<person "Person"
_animate: "animate"
>
(or, "yes" or whatever)
Priority: P2 → --
Target Milestone: 1.0 beta → Next
Updated•11 years ago
|
Assignee: stas → nobody
Comment 7•9 years ago
|
||
This bug is about the old L20n syntax which was replaced by the FTL syntax in spring 2016.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•