Re: Undefine mixed data

[email protected] (rir)
Newsgroups perl.perl6.users
Message-ID <20230320004843.vxinbxmukymdsqkz@shrew>
Ralph, we agree on my primary complaint that utility/convenience is being
lost.

I did, and do, recognize the validity of the problem of 'undefine' not 
not aligning with '.defined'.  The docs indicate that being empty is the
definition of undefinedness for non-scalar containers.

Keeping 'undefine' as a name of this action is beneficial because
'undefined' and 'defined' are mainstream terminology and so enable
people the find and understand Raku's variant behavior.  A name
like 'clear' would just be obscure--a great disadvantage.

Thanks for the links.

Rob


On Sat, Mar 18, 2023 at 06:06:54PM +0000, Ralph Mellor wrote:
> On Fri, Mar 17, 2023 at 11:11 PM rir <[email protected]> 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.
> 
> Onward...
> 
> ----
> 
> 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`:
> https://github.com/rakudo/rakudo/blob/591157170d29f8a45ef316bb0d065e8437059112/src/core.d/operators.pm6#L1-L9:
> 
> Git blame led to this commit:
> https://github.com/rakudo/rakudo/commit/72bac6708002f992952ca93e617435482824b95f
> 
> The commit message mentions "6.d-prep".
> 
> A google for that led to:
> https://github.com/Raku/6.d-prep
> 
> Results of a GH search included
> https://github.com/Raku/6.d-prep/search?q=undefine&type=issues
> 
> 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
> 
> (https://irclogs.raku.org/perl6/2015-07-02.html#17:19-0001
> 
> ----
> 
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.