On 4 Oct 2002, Aaron Sherman wrote:
: There are a very large number of good things that I think we should put
: into properties for meta-programming purposes (e.g. constraints,
: assertions, optimization hints, documentation, etc).
:
: For example:
:
: sub f(int $a is constrained($a>=1,"must be positive),
: documented("an integer"))
: is constrained(some_global_condition),
: documented("applies transformation f to an integer") {
: ...
: }
Another good reason to allow:
sub f(int $a is constrained($a>=1,"must be positive),
documented("an integer")) {
...
}
also &f is constrained(some_global_condition),
documented("applies transformation f to an integer");
or possibly even
sub f(int $a) {
also $a is constrained($a>=1,"must be positive),
documented("an integer");
...
}
also &f is constrained(some_global_condition),
documented("applies transformation f to an integer");
One could argue that, given that "is" is always compile-time, the "also"
is redundant.
sub f(int $a) {
$a is constrained($a>=1,"must be positive),
documented("an integer");
...
}
&f is constrained(some_global_condition),
documented("applies transformation f to an integer");
But maybe that's too weird.
Larry