develooper Front page | perl.perl5.porters | Postings from July 2001

RE: [PATCH for discussion] new feature: clamp %hash

Thread Previous | Thread Next
Nick Ing-Simmons
July 25, 2001 05:40
RE: [PATCH for discussion] new feature: clamp %hash
Message ID:
Jeffrey Friedl <> writes:
>Nick Ing-Simmons <> wrote:
>|> readonly \%hash;     # clamped
>I reiterate that I believe that this would be a mistake.

to which I reiterate that that was pseudo code example of the 
implementation - not an interface definition.
I was trying to demonstrate that with "hooks" e.g. by readonl() xsub,
and minor tweaks to the core adding some "dies" we can implement both.

I leave it up to list as a whole to discuss what it should look like
to user.

>If you want readonlyness for a hash to mean that its values are also
>readonly (which, Nick, you made abundantly clear that you do), then
>how can it be anything but a misnomer and trap that
>   readonly \%hash;
>not do that?
>As I and Scott have said, and to which you agreed, clamping and
>readonlyness are different animals. Shouldn't the way to invoke them,
>therefore, also be different? That they may be internally dealt with in
>similar manners is not something the user needs to be confused by.

I have no objection to the concepts - I was critical of the implementation.

If we can come up with an interface which does not confuse the user,
and which is implemented by a module with only minimal changes to the 
core then this is 5.8.* worthy. 

>	Jeffrey
Nick Ing-Simmons

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About