Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.perl6.language > #5662

Re: To :D or not to :D

Newsgroups perl.perl6.language
References <20151012134136.GE3111@moon.overmeer.net> <561BD28B.8090607@faui2k3.org> <20151012195113.GB31314@moon.overmeer.net>
Message-ID <561CAFF3.80900@faui2k3.org> (permalink)
Date 2015-10-13 09:17 +0200
Subject Re: To :D or not to :D
From moritz@faui2k3.org (Moritz Lenz)

Show all headers | View raw



On 10/12/2015 09:51 PM, Mark Overmeer wrote:
> * Moritz Lenz (moritz@faui2k3.org) [151012 15:32]:
>>>    . are they using :D correctly?
>>
>> Yes, though not everybody uses :D as much as they do. Do you check that
>> all the parameters that your Perl 5 methods/subs receive are defined? If
>> not, you wouldn't use :D in Perl 6 either.
>
> In Perl5, you get slower code when you test for definedness... in Perl6
> you get faster (better optimized) code.  That's a big difference.

Do you? Did you actually measure that?

>> FWIW you can now (as of a few days ago) control the default with
>> use invocant :D;
>
> How can de invocant not be defined?

Well, if you call a constructor, you call it on the type object. Hence 
the type object is the class, and not defined.

>> use parameters :D;
>
> The new "use warnings"/"use strict"...
>
>> which means all those :D annotations can go away, and you have to use :_
>> explicitly if you want to allow all.
>
> Oh, use :U for that.  Ehhh.... already in use.

:U means "undefined", :_ means "defined or undefined, I don't care"

>> And I don't know if we can change it now without creating a huge havoc
>> in the existing ecosystem.
>
> There shouldn't be a problem making :D a superfluous option.  Of swiftly
> add  "use parameters $_;"  to all modules.

Why shouldn't this be a problem?

>  And there still quite a
> number of other crucial changes going in anyway...

But hopefully none of them breaking backwards compatibility on such a 
large scale. The last few backwards incompatible changes still cause 
pain in the ecosystem. We have 390+ modules, and hand-waving away all 
trouble of maintaining them seems a bit lofty.

>>>    . :D looks really ugly, don't you think?  Try to explain to students
>>>      to add this smiley everywhere.
>>
>> It's not uglier than a 'die "Must be defined" unless defined $x'
>
> Much too expensive in Perl5.

Then don't do in Perl 6 either. If you can argue away the need for 
safety based on the need for performance, you can also argue away the 
need for safety based on the need for cleaner code.

Cheers,
Moritz

Back to perl.perl6.language | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-12 15:41 +0200
  Re: To :D or not to :D moritz@faui2k3.org (Moritz Lenz) - 2015-10-12 17:32 +0200
    Re: To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-12 21:51 +0200
      Re: To :D or not to :D pmichaud@pobox.com ("Patrick R. Michaud") - 2015-10-12 15:25 -0500
        Re: To :D or not to :D darren@darrenduncan.net (Darren Duncan) - 2015-10-12 13:30 -0700
        Re: To :D or not to :D solutions@overmeer.net (Mark Overmeer) - 2015-10-13 00:32 +0200
          Re: To :D or not to :D pmichaud@pobox.com ("Patrick R. Michaud") - 2015-10-12 20:05 -0500
            Re: To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-14 13:37 +0200
              Re: To :D or not to :D email@froggs.de (Tobias Leich) - 2015-10-14 14:11 +0200
      Re: To :D or not to :D moritz@faui2k3.org (Moritz Lenz) - 2015-10-13 09:17 +0200
        Re: To :D or not to :D mark@overmeer.net (Mark Overmeer) - 2015-10-13 10:41 +0200
        Backwards compatibility and release 1.0 rnhainsworth@gmail.com (Richard Hainsworth) - 2015-10-13 16:52 +0800
          Re: Backwards compatibility and release 1.0 darren@darrenduncan.net (Darren Duncan) - 2015-10-13 15:33 -0700
          Re: Backwards compatibility and release 1.0 moritz@faui2k3.org (Moritz Lenz) - 2015-10-14 11:54 +0200
            Re: Backwards compatibility and release 1.0 mark@overmeer.net (Mark Overmeer) - 2015-10-14 12:12 +0200
            Exploit the versioning (was Re: Backwards compatibility and release 1.0) darren@darrenduncan.net (Darren Duncan) - 2015-10-14 04:04 -0700
            Re: Backwards compatibility and release 1.0 Smylers@stripey.com (Smylers) - 2015-10-15 09:47 +0100
              Re: Backwards compatibility and release 1.0 email@froggs.de (Tobias Leich) - 2015-10-15 11:06 +0200
                Re: Backwards compatibility and release 1.0 liz@dijkmat.nl (Elizabeth Mattijsen) - 2015-10-15 12:42 +0200
                Re: Backwards compatibility and release 1.0 mark@overmeer.net (Mark Overmeer) - 2015-10-15 12:57 +0200
                Re: Backwards compatibility and release 1.0 liz@dijkmat.nl (Elizabeth Mattijsen) - 2015-10-15 13:13 +0200
              Re: Backwards compatibility and release 1.0 moritz@faui2k3.org (Moritz Lenz) - 2015-10-15 14:13 +0200
            Re: Backwards compatibility and release 1.0 rnhainsworth@gmail.com (Richard Hainsworth) - 2015-10-15 12:48 +0800

csiph-web