Hi Gurusamy,
Thanks for the info, what we are after is indeed a compile-time
feature.
Here is some more information about what we are trying to do
so you can tell us if we are barking up the wrong tree.
The idea is to have a concise way to specify PDL variables
in a subroutine and have them created.
e.g.
sub foo {
pdl_signature('a(n),b(m,n)');
...
}
would constrain the first arg to be 1D and the 2nd arg to be
a 2D PDL variable (with 2nd axis matching first axis of a)
We already have code to parse the "signature" and check args.
The two points we are unsure about are:
1. Once the signature is parsed does the subroutine 'foo' have a compile-time
hook where the parsed data can be stored?
2. Is it possible as an extra feature to create lexical variables $a and $b
which would then be visible in foo? Obviously one could do something like
my($a,$b) = pdl_signature('a(n),b(m,n)')
But it would be nice to save the typing.
best wishes,
Karl