develooper Front page | perl.perl6.users | Postings from March 2023

Re: Undefine mixed data

Thread Previous | Thread Next
Ralph Mellor
March 18, 2023 18:07
Re: Undefine mixed data
Message ID:
On Fri, Mar 17, 2023 at 11:11 PM rir <> wrote:
> Deprecating 'undefine' is just making something easy more difficult.

I see a problem with `undefine`:

my @bar;
say @bar.defined, @bar.DEFINITE; # TrueTrue
undefine @bar;
say @bar.defined, @bar.DEFINITE; # TrueTrue

I think a warning about this is the wrong solution.

I think deprecation is the right solution.


That said, I'm a bit surprised that the deprecation message isn't something like

Please use `foobar` instead

(where `foobar` does exactly the same thing as `undefine`, just using
a different name).


Maybe no one has yet thought of a name that isn't also fraught?

Maybe there is no reasonable name?

Maybe it's only Perl folk who would want `undefine`?

Maybe it's only Perl folk who will see the deprecation message and be unhappy?

Maybe, on balance, it's reasonable to consider it an opportunity to remind Perl
folk that a fresh uninitialized array or hash is NOT undefined?

Dunno. Just keeping an open mind.



I searched Rakudo's sources for "undefine".

No useful match?!? Looks like GH search goes from bad to worse. Sigh.


`say &undefine.file` got me `SETTING::src/core.d/operators.pm6`:

Git blame led to this commit:

The commit message mentions "6.d-prep".

A google for that led to:

Results of a GH search included

I ask that no one here comments on the discussions therein unless
they are *very* careful to avoid using inflammatory language.


Next I decided to search IRC. That led to this by Larry:

> I think we should s/undefine/clear/, because clarity



Liz suggested it was perhaps redundant.

(A similar argument appeared in the 6d prep issues.)

Larry didn't reply. Warnock's dilemma applies though I don't think
Larry ever missed anything. I think he always went with his gut; if
he felt he'd be repeating himself he said nothing.


And so we arrive at 2023 and the same issue arises as ever.

Can we be kind to each other even if we don't agree, even if we
are upset about some decision?


love, ralph

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