-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
//if this object wasn't previously set this would set it
@object ? name { … }
@value example { keywordA }
@value example2 { … }
& ? example { keywordB }
//this would use keywordA since example was already set
property: example;
It's quite useful when you rely on third party hss.
alternate proposal
Since we can't start an object name wth a ? we could either get rid of the space or make it optional.
@object ?name { … }
concequense
//since
#new name { … }
//is equivalent to
#new @container name { … }
//then
#new ? name { … }
//is equivalent to
#new @container ? name { … }
Which means that the ? will be scope aware when used with the new instruction and that this construct will replace the ensure instruction.
//example with several elements
#new @container elementA & ? elementB { … }
//is equivalent to
#new elementA & ? elementB { … }
PS: depends on axr/core#190
Question
//should we allow
?@object nameA & nameB { … }
//to resolve to
@object ? nameA & ? nameB { … }
//which would mean we would also have to accept
!#support (A) & (B) { }
//which would be equivalent to
#support !(A) & !(B) { }