So one can write collections omitting a set of parentheses, e.g. just
Set[1, 2, 3]
but
Pseq[1, 2, 3]
is an error:
ERROR: ListPattern (Pseq) requires a non-empty collection; received 3.
What’s the magic involved in making the first syntax work? Can be replicated for Pseq somehow? (One probably have to contend with the default args, i.e. repeats=1
when writing like that.) I’m mostly confused that Pseq doesn’t even seem to receive the first two args here (1 and 2).
(N.B. In contrast, things that take a function as arg can consistently drop the parentheses, e.g. Pfuncn{42}
works, and assumes the default repeats of 1 from Pfuncn’s constructor.)