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
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
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
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
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
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
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";
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
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
> 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
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
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
> 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
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
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
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
Hi All,
RakudoPkgFedora33-2020.12.x86_64.rpm just posted
over at:
https://github.com/nxadm/rakudo-pkg/releases
:-)
-T
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
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
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
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
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
22 matches
Mail list logo