Open lmorg opened 1 year ago
A little more thought on this feature:
constraint
constraint
as a property (gets a little repetitive otherwise). So I've opted for Validation
insteadconstraint yyyymmdd {
Inherit: str
Validation: '{
-> regexp (m/[0-9]{4}-[0-9]{2}-[0-9]{2}/)
}'
}
Given how expressions are now first class citizens, Validation should probably be passed as a variable rather than a pipe. eg
constraint yyyymmdd {
Inherit: str
Expression: '$VALUE =~ "[0-9]{4}-[0-9]{2}-[0-9]{2}"'
}
Describe the problem: Add support for custom types with type constraints.
Possible ways to implement: eg
Additional context:
inherit
will be the built in data type (marshallers et al) to use for that data type.contraint
will be a Murex code block that takes the data as value from STDIN and returns a non-zero exitnum if the constraint isn't met. STDOUT and/or STDERR will be output to terminal if constraint isn't met.