Skip to content

? modifier #104

Description

@Mouvedia
//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) { }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions