[my apologies, forgot to send to list]
---------- Forwarded message ---------- From: Diab Jerius <[email protected]> Date: Fri, Oct 7, 2016 at 3:52 PM Subject: Re: [Pdl-general] Read only piddles? To: Craig DeForest <[email protected]> On Fri, Oct 7, 2016 at 1:00 PM, Craig DeForest <[email protected]> wrote: > I don’t think that there is at the moment. > > It might be possible to mark a PDL read-only to prevent modification of its > contents, but modification as you describe involves a Perl-level change to > the variable: putting a new value in the variable is not something that PDL > controls. That's what I feared. I would like to prevent an inadvertent $pdl *= 3; I started out with a PDL subclass and overriding as many core methods and operator overloads that I could think of, but that's a chase with no end. > > You could make a Perl copy of the PDL and hand *that* off: > > $tmp = $my_pdl; > untrusted($tmp); > Unfortunately, the piddles may be large and the calls may be many. I'm trying to avoid too much memory thrashing. > >> On Oct 7, 2016, at 10:27 AM, Diab Jerius <[email protected]> wrote: >> >> I've got an application where I need to maintain a functional >> relationship between several piddles, but need to hand them over to >> untrusted code which will destroy that relationship if the piddles are >> modified. >> >> Is there any means of marking a piddle as read only? >> >> Thanks, >> >> Diab >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot >> _______________________________________________ >> pdl-general mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/pdl-general >> > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ pdl-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pdl-general
