I need help with cosine and ()

2020-12-20 Thread ToddAndMargo via perl6-users
Hi All, Why does this work? say (45*π/180).cos 0.7071067811865476 And this not? say 45*π/180.cos -236.22573454917193 Is not the math suppose to be done first? Confused again, -T

Is the cosine page wrong?

2020-12-20 Thread ToddAndMargo via perl6-users
Hi All, https://docs.raku.org/routine/cos method cos() Where is the definition of what is fed to the method? Should it no be something like: method cos( Cool:D --> Cool:D ) What am I missing? -T

Re: Is the cosine page wrong?

2020-12-20 Thread Francis Grizzly Smit
On 20/12/2020 19:17, ToddAndMargo via perl6-users wrote: Hi All, https://docs.raku.org/routine/cos     method cos() Where is the definition of what is fed to the method? Should it no be something like:     method cos( Cool:D --> Cool:D ) What am I missing? umm it looks right to me a metho

Re: Is the cosine page wrong?

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 12:17 AM, ToddAndMargo via perl6-users wrote: Hi All, https://docs.raku.org/routine/cos     method cos() Where is the definition of what is fed to the method? Should it no be something like:     method cos( Cool:D --> Cool:D ) What am I missing? -T https://github.com/rakudo

Re: Is the cosine page wrong?

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 12:30 AM, Francis Grizzly Smit wrote: On 20/12/2020 19:17, ToddAndMargo via perl6-users wrote: Hi All, https://docs.raku.org/routine/cos     method cos() Where is the definition of what is fed to the method? Should it no be something like:     method cos( Cool:D --> Cool:D ) Wh

Re: I need help with cosine and ()

2020-12-20 Thread ToddAndMargo via perl6-users
On Sun, Dec 20, 2020 at 02:05 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Why does this work? say (45*π/180).cos 0.7071067811865476 And this not? say 45*π/180.cos -236.22573454917193 Is not the math suppose

Re: I am having trouble declaring a method

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 2:24 AM, ToddAndMargo via perl6-users wrote: Hi All, Now what am I doing wrong? -T   class Angle {    # has num64 $.degrees;    method AngleCosine( Rat:D: --> Rat:D )  {   my Numeric $radians = self*π/180;   print "self   = <" ~ self ~ "\n";

Re: I am having trouble declaring a method

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 5:01 AM, ToddAndMargo via perl6-users wrote: On 12/20/20 2:24 AM, ToddAndMargo via perl6-users wrote: Hi All, Now what am I doing wrong? -T    class Angle {     # has num64 $.degrees;     method AngleCosine( Rat:D: --> Rat:D )  {    my Numeric $radians = self*π/1

Found a wonderful tutorial on methods

2020-12-20 Thread ToddAndMargo via perl6-users
Hi All, I found a wonderful tutorial on methods: https://raku.guide/#_methods It is *very* well written. And not a refresher for those that already know what they are doing and don't need it. :-) :-) :-) -T

Re: I need help with cosine and ()

2020-12-20 Thread Bruce Gray
> On Dec 20, 2020, at 6:08 AM, ToddAndMargo via perl6-users > wrote: > >>> On Sun, Dec 20, 2020 at 02:05 ToddAndMargo via perl6-users >>> mailto:perl6-us...@perl.org>> wrote: >>>Hi All, >>>Why does this work? >>> say (45*π/180).cos >>> 0.7071067811865476 >>>And

Re: Checking for nil return

2020-12-20 Thread Joseph Brenner
yary wrote: > Is this a known issue, or my misunderstanding? > >> subset non-Nil where * !=== Nil; > (non-Nil) >> sub out-check($out) returns non-Nil { return $out } > &out-check >> out-check(44) > 44 >> out-check(Nil) > Nil > > ^ Huh, I expected an exception on "out-check(Nil)" saying the return

Re: Checking for nil return

2020-12-20 Thread yary
After writing that email, I remembered a bit of logic from a class long ago, that any assertion made on the empty set is true. Since Nil is a representation of no results, it would make sense to have assertions about it return true. I think this example shows an optimization to skip return type che

Re: Is the cosine page wrong?

2020-12-20 Thread Bruce Gray
> On Dec 20, 2020, at 2:54 AM, ToddAndMargo via perl6-users > wrote: —snip-- > I obviously can't feed it a string. Obviously you cannot, but actually you can! $ raku -e 'say .cos for 42, "42", ("4" ~ "2"), "5421".substr(1,2);' -0.3999853149883513 -0.3999853149883513

Re: I need help with cosine and ()

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 10:11 AM, Bruce Gray wrote: $a + $b - $c * $d / $e.foo , the .foo method is called on $e, not on the whole A-through-E sub-expression. That makes sense. It is the precidence. In college, we called it "algebraic operation". ** came before *; * came before +; etc In Raku, a m

Re: Is the cosine page wrong?

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 1:18 PM, Bruce Gray wrote: On Dec 20, 2020, at 2:54 AM, ToddAndMargo via perl6-users wrote: —snip-- I obviously can't feed it a string. Obviously you cannot, but actually you can! $ raku -e 'say .cos for 42, "42", ("4" ~ "2"), "5421".substr(1,2);' -0.39998531498835

Re: Checking for nil return

2020-12-20 Thread Brad Gilbert
Nil is always a valid return value regardless of any check. This is because it is the base of all failures. On Sat, Dec 19, 2020, 8:17 PM yary wrote: > Is this a known issue, or my misunderstanding? > > > subset non-Nil where * !=== Nil; > (non-Nil) > > sub out-check($out) returns non-Nil { ret

rakudo-pkg-2020.12-01 just hit

2020-12-20 Thread ToddAndMargo via perl6-users
Hi All, RakudoPkgFedora33-2020.12.x86_64.rpm just posted over at: https://github.com/nxadm/rakudo-pkg/releases :-) -T

Is self a C pointer?

2020-12-20 Thread ToddAndMargo via perl6-users
Hi All, In the following: Example 3: class PrintTest { has Str $.Msg; method PrintMsg() { print "self = <" ~ self.Msg ~ ">\n"; print "self = <" ~ self.Str ~ ">\n"; } } my $x = PrintTest.new(Msg => "abc"); $x.PrintMsg self = s

Re: Is self a C pointer?

2020-12-20 Thread Brad Gilbert
It doesn't matter if it is a C pointer. Unless you are working on Moarvm, you should consider them arbitrary unique numbers. Like GUID. That said, yes I'm sure that they represent a location in memory. On Sun, Dec 20, 2020, 6:45 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > H

Re: Is self a C pointer?

2020-12-20 Thread William Michels via perl6-users
On Sun, Dec 20, 2020 at 4:45 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > > Hi All, > > In the following: > > Example 3: > > class PrintTest { > has Str $.Msg; > > method PrintMsg() { >print "self = <" ~ self.Msg ~ ">\n"; >print "se

Re: Is self a C pointer?

2020-12-20 Thread ToddAndMargo via perl6-users
On 12/20/20 9:27 PM, Brad Gilbert wrote: It doesn't matter if it is a C pointer. Unless you are working on Moarvm, you should consider them arbitrary unique numbers. Like GUID. That said, yes I'm sure that they represent a location in memory. That explains it. Thank you! I used teh term

Two days to submit your talks to FOSDEM

2020-12-20 Thread JJ Merelo
Hi, https://news.perlfoundation.org/post/fosdem-2021-call-for-papers Any kind of talk is acceptable: from lightning talks to long talks (1 hour) Cheers -- JJ