Hi,
I guess this is a NiceSlice thing, this one works in the pdl shell:
$f=sub{$_[0]**2};
...
Ingo
On 07.02.24 01:14, Luis Mochan wrote:
On Tue, Jan 30, 2024 at 09:40:59PM -0600, Luis Mochan wrote:
...>
On Mon, Jan 29, 2024 at 10:19:56PM -0500, David Mertens wrote:
Hello Luis,
Ever crafty, Perl gives you another way to solve this. You could put your
functions under another name space and invoke them by explicitly naming the
package and function. For example, if you have a function "do_it" in
package MY, you could invoke it as
$pdl->MY::do_it(...args...)
Found another alternative, as in:
my $f=sub($x){$x**2}; #or $f=sub{$_[0]**2};
print sequence(10)->$f;
Curiously, it works in general but not the sub($x){...} in the pdl REPL.
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel