From:

Date:

March 2, 2021 15:20Subject:

Re: 'CALL-ME' Math problem?Message ID:

CAJ+jyGhfOoY1JaedwixUpYBGfMNwZGxkHNEb2UN3fgVHL6GMWA@mail.gmail.comOn Tue, Mar 2, 2021 at 4:08 PM Matthew Stuckwisch <mateu@softastur.org> wrote: > But why do that when you can add a CALL-ME to the number classes that does > multiplication? ðŸ˜‡ > > Int.^add_fallback( > {$^i.defined && $^m eq 'CALL-ME'}, > -> $, $ { * * * } > ); > > say 5(4); # 20 > say 5(5)Â² # 625â€¦ oops! ðŸ˜€ but say 5(5Â²) # 125 ok > On Tue, Mar 2, 2021, 09:08 Daniel Sockwell <daniel@codesections.com> > wrote: > >> Kevin Pye <kevin.pye@gmail.com> wrote: >> > Just because mathematics allows an implied multiplication doesn't mean >> Raku does -- in fact I can't >> > think of any programming language which does. >> >> As a (potentially) interesting side note, while Raku doesn't provide >> implied multiplication, it _is_ >> one of the few programming languages that would let you implement >> something very similar yourself: >> sub infix:Â«\c[INVISIBLE TIMES]Â» { $^a Ã— $^b } >> >> This would let you write `say 60Ã·5(7âˆ’5)` (with an invisible character >> between the `5` and the `(` ) >> and get the expected result. >> >> Doing so would, of course, be a very bad idea. But still, you _could_. >> >> Source: >> >> https://perl6advent.wordpress.com/2017/12/01/the-grinch-of-perl-6-a-practical-guide-to-ruining-christmas/ >> > -- Fernando SantagataThread Previous

- Re: 'CALL-ME' Math problem? by Kevin Pye
- 'CALL-ME' Math problem? by ToddAndMargo via perl6-users
- Re: 'CALL-ME' Math problem? by Wenzel P. P. Peppmeyer
- Re: 'CALL-ME' Math problem? by ToddAndMargo via perl6-users
- Re: 'CALL-ME' Math problem? by ToddAndMargo via perl6-users
- Re: 'CALL-ME' Math problem? by Daniel Sockwell
- Re: 'CALL-ME' Math problem? by Parrot Raiser
- Re: 'CALL-ME' Math problem? by Vadim Belman
- Re: 'CALL-ME' Math problem? by Matthew Stuckwisch
**Re: 'CALL-ME' Math problem?**by Fernando Santagata

nntp.perl.org: Perl Programming lists via nntp and http.

Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About