One can exploit subranges to create a new type that is a subset of char, like
so:
type
CapitalLetters = range['A'..'Z']
var s = "The capital letters are: "
for i in low(CapitalLetters)..high(CapitalLetters):
s &= $i
echo s
Run
But is it possible to derive a type for a non-contiguous subset. Ideally
something like this (non-working of course):
type
WASDLetters = set{'W','A','S','D'}
Run
