-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I have no idea right now how this would work or what it would look like! However, I have a feeling that the ability to define a sealed type of enumerations could be useful.
For example if I have a function like compute-checksum($algorithm, $data)
, it might be useful if I could define that the $algorithm
is one of a number of enumerated (supported) values and nothing else.
A further example to start a discussion:
declare enumeration local:animal := {
CAT
DOG
PIG
};
declare function local:sound($animal as enumeration(local:animal)) as xs:string {
if ($animal eq local:animal:CAT) then
"meow"
else if ($animal eq local:animal:DOG) then
"woof"
else
"oink"
};
Metadata
Metadata
Assignees
Labels
No labels