develooper Front page | perl.perl5.porters | Postings from February 2022

Re: Thoughts Towards Type Assertions (was: Re: Pre-RFC: builtin::functions for detecting numbers vs strings)

Thread Previous | Thread Next
From:
Yuki Kimoto
Date:
February 25, 2022 06:55
Subject:
Re: Thoughts Towards Type Assertions (was: Re: Pre-RFC: builtin::functions for detecting numbers vs strings)
Message ID:
CAExogxPm9dMQsHYaKxpNdpQiZ_OzF1VCR2gHdih1+qd1UzAwDQ@mail.gmail.com
2022-2-25 1:31 Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> wrote:

>
>   * We've finished the PV vs. IVNV split that PR #18958 began, so now
>     we can perfectly remember "was originally a string" vs "was
>     originally a number".
>
>
A Perl big problem is that when a value is touched, the type of value is
changed.

When a value is created or updated, the type of value is created or
changed. This is understandable.

However, in current Perl, only touching a value changes the type of the
value. This is strange.

This reason is that the type of value is used internally and the type is
changed freely.

Is it possible to design the user type that is not affected by touching?

I think it's important that the types of the number and string don't change
unintentionally.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About