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
Nice find! :-)
On Tue, Feb 6, 2024, 7:14 PM 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
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
that all your code’s objects are in, and instead make
> > PDL::Other::somefunction. You’d create objects with
> > PDL::Other->new(@args_as_normal). This is tested in t/subclass.t and ought
> > to work, including that any operations’ results will also be in that
> > subclass.
operations’ results will also be in that
> subclass. If you try it and find any surprises, please say so on here! Then
> I can capture that into t/subclass.t and fix it.
> >
> > Best regards,
> > Ed
> >
> >
> > From: Luis Mochan
> > Sent: Sunday, J
d
>
>
> From: Luis Mochan
> Sent: Sunday, January 28, 2024 2:41:27 PM
> To: perldl ; perldl
>
> Subject: [Pdl-devel] naming conventions
>
> Hi,
> It is sometimes convenient to call my own functions that operate on ndarrays
> usi
hat subclass. If you try it and find any surprises, please say so
on here! Then I can capture that into t/subclass.t and fix it.
Best regards,
Ed
From: Luis Mochan
Sent: Sunday, January 28, 2024 2:41:27 PM
To: perldl ; perldl
Subject: [Pdl-devel] naming conventi
Hi,
It is sometimes convenient to call my own functions that operate on ndarrays
using the object notation: $ndarray->somefunction. A simple way to do
it is to define the function within the PDL name space as in
sub PDL::somefunction($self,...){...}
Is there a better way? Adding functions to a p