Closed Bug 816884 Opened 13 years ago Closed 9 years ago

Add Boolean literal

Categories

(L20n :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

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.
(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 }>
"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).
(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 }>
Haha, you're right :)
Priority: -- → P3
Target Milestone: --- → 1.0
(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.
Assignee: nobody → stas
Priority: P3 → P2
Target Milestone: 1.0 → 1.0 beta
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
Assignee: stas → nobody
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.