opendylan
opendylan copied to clipboard
#rest should accept variable-name BNF, not variable
I believe both of the examples below should produce compiler warnings. They're the two ways I could imagine interpreting a type spec for a rest parameter. The BNF is #rest variable-name, not #rest variable.
define function foo (#rest things :: <string>)
format-out("%s\n", things);
end;
foo(1, 2, 3);
define function bar (#rest things :: limited(<sequence>, of: <string>))
format-out("%s\n", things);
end;
bar(1, 2, 3);
https://play.opendylan.org/shared/ac3d2bab7156132f