[Purdue-pm] good Perl 6 article

Mark Senn mark at purdue.edu
Mon Jul 29 05:34:52 PDT 2019


There is a good Perl 6 article at
    http://blogs.perl.org/users/damian_conway/2019/07/six-slices-of-pie.html
about the following problem
    First person gets 1% of a pie, secord person gets 2% of
    the remaining pie, etc.  Which person gets the largest
    piece of pie.

Handy takeaway: instead of typing $x/100 do
    sub postfix:<%> (Numeric $x) { $x / 100 }
to make a % postfix operator and type
    $x%.

Last line from article:
    Because people shouldn't have to adapt to the needs of
    programming languages; programming languages should adapt
    to the needs of people.

-mark


More information about the Purdue-pm mailing list