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

Re: Types in Cor (and Perl)

Thread Next
From:
Curtis Jewell
Date:
July 31, 2020 22:41
Subject:
Re: Types in Cor (and Perl)
Message ID:
5495097a-d0b9-43d2-912a-2618c4de74ea@www.fastmail.com
Just saw this (took a break from reading p5p email, ended up being a month) and answering below.

On Sun, Jul 12, 2020, at 19:52, Dave Rolsky wrote:
> Specifically, I think having a `Str` type that doesn't accept objects 
> which overload (and similar for other types) is a huge mistake. Of 
> course, once you start thinking about this you start going down the 
> rabbit hole of stringification and what it means for something to 
> stringify, since _every_ type in Perl can stringify, but maybe not 
> usefully. Then you start thinking about things like roles and have a 
> `Stringies` role or something like that.

Which is why I (personally) would want to have a Str type that accepts objects that overload AND a StrictStr type that does not. The ability to allow or reject that as desired would be nice to have.

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