Open johnstairs opened 11 months ago
Computed fields are currently an embedded expression language within a YAML file. switch expressions (to work with unions and optional types) are not expressed in this language, but rather as YAML nodes:
switch
optionalNamedArrayLength: # YAML !switch optionalNamedArray: # YAML NamedNDArray arr: size(arr) # YAML-type-expression hybrid null: 0 # YAML-type-expression hybrid
This does not allow switch expressions to be used as part of larger expressions (type conversions, a function call argument, etc).
Instead, we should consider making switch part of the expression language. The example above might then look like:
optionalNamedArrayLength: | switch(optionalNamedArray) { NamedNDArray arr: size(arr) null: 0 }
On the other hand, this syntax introduces curly braces within a YAML document, where indentation is usually favoured.
Computed fields are currently an embedded expression language within a YAML file.
switch
expressions (to work with unions and optional types) are not expressed in this language, but rather as YAML nodes:This does not allow switch expressions to be used as part of larger expressions (type conversions, a function call argument, etc).
Instead, we should consider making
switch
part of the expression language. The example above might then look like:On the other hand, this syntax introduces curly braces within a YAML document, where indentation is usually favoured.