Re: [Pdl-devel] naming conventions

2024-02-07 Thread Ingo Schmid via pdl-devel
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

Re: [Pdl-devel] naming conventions

2024-02-06 Thread David Mertens
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

Re: [Pdl-devel] naming conventions

2024-02-06 Thread Luis Mochan
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

Re: [Pdl-devel] naming conventions

2024-01-30 Thread Luis Mochan
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.

Re: [Pdl-devel] naming conventions

2024-01-29 Thread David Mertens
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

Re: [Pdl-devel] naming conventions

2024-01-28 Thread Luis Mochan
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

Re: [Pdl-devel] naming conventions

2024-01-28 Thread Ed .
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

[Pdl-devel] naming conventions

2024-01-28 Thread Luis Mochan
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