Subject: | Reduce boilerplate for inline_as |
Instead of:
inline_as {
my ($constraint, $varname) = @_;
my $perlcode = $constraint->parent->inline_check($varname)
. "&& ($varname >= -32768 && $varname <= 32767)";
return $perlcode;
},
I'd really like to avoid all that boilerplate and be able to write something like:
inline_as {
return (undef, "$_ >= -32768 && $_ <= 32767");
},
This build on three things:
1: allow returning a list of strings that will be merged via: join "&&", map { "($_)" } to form the inline condition
2: allow an initial undef to mean "whatever $constraint->parent->inline_check($varname)" returns
3: call the inline_as code with $_ set to $varname