🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
ToddAndMargo Anyone on newbie duty? A question on the "use" in a class declaration. In "is $.x". does the dot have a special meaning or is it just to make the value ($.x) easier to access ($objectname.x)? 01:13
typo. "is $.x" should have been "use $.x". :'( 01:14
Xliff m: my @a = (2).Set; @a.append: 3, 4; @a.^name.say 01:22
camelia Array
Xliff m: my $a = (2).Set; $a.append: 3, 4; $a.^name.say
camelia Cannot resolve caller append(Set:D: Int:D, Int:D); none of these signatures match:
(Any:U \SELF: |values)
in block <unit> at <tmp> line 1
Xliff m: my $a = (2).Set; $a.push: 3, 4; $a.^name.say
camelia Cannot resolve caller push(Set:D: Int:D, Int:D); none of these signatures match:
(Any:U \SELF: |values)
in block <unit> at <tmp> line 1
Xliff m: Set.^methods(*.^name).say 01:23
camelia Too many positionals passed; expected 2 arguments but got 3
in block <unit> at <tmp> line 1
Xliff m: Set.^methods(*.name).say
camelia Too many positionals passed; expected 2 arguments but got 3
in block <unit> at <tmp> line 1
ToddAndMargo Are you guys writing to me or to each other? 01:24
Grinnz camelia is a bot 01:32
frost-lab m: run 'date' 01:33
camelia Thu Dec 31 02:33:40 CET 2020
RaycatWhoDat Hello. Currently working on day 04 of Advent of Code (because I forgot about it). 01:43
I think something is wrong with my grammar but, for some reason, it says 181 or 189 passports are correct. 01:44
But the correct answer is neither of these.
Not sure where I went wrong.
<github.com/RayMPerry/advent-of-cod...4.raku> 01:45
guifa2 ToddAndMargo: Where did you see "use $.x"? 'use' is normally followed by a module name, and '$.x' would normally be preceeded by "has" 01:55
ToddAndMargo I shortened things too much. Here is an example of the whole thing: class Fruit { has Str $.location is rw; has UInt $.apples is rw; has UInt $.oranges is rw; has UInt $.bananas is rw; } 01:58
my $FruitStand = Fruit.new( location => "Cucamonga", apples => 400, oranges => 200, bananas => 50 );
print $FruitStand.location ~ "has " ~ $FruitStand.apples ~" apples in stock\n";
I am just wondering if the dot in $FruitStand.apples is there just to make it easier to access or does the dot have a special meaning 01:59
guifa2 The dot itself is technically an operator, it means "call the method 'apples' on the preceeding object". So $FruitStand.apples translates to "call the method 'apples' on the object $FruitStand" 02:06
ToddAndMargo If I was to declare apples as "use $apples", instead of .apples, would it mess things up? 02:07
[Coke] has and use both have specific meanings, so yes. 02:10
guifa2 Yes, it would. $apples is not a module, which is what 'use' is for
[Coke] if you mean "has $apples", yes, attributes should be declared with a sigil and either a ! twigil (private) or . (public) 02:11
ToddAndMargo Okay, I think I understand now. Thank you! (And no wonder some examples I has seen did not work.) 02:12
guifa2 Is there any way to fake input to prompt for the purpose of testting? 02:35
I tried $*IN.say but that doesn't seem to work
[Coke] Could probably define a simple class and replace $*IN to return data when asked. 02:46
[Coke] m: temp $*IN = class { method get( ) { 'eek' } } say prompt "what?"; 02:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3$*IN = class { method get( ) { 'eek' } }7⏏5 say prompt "what?";
expecting any of:
infix
inf…
[Coke] m: temp $*IN = class { method get( ) { 'eek' }; }; say prompt "what?";
camelia what?eek
[Coke] guifa2: ^^
guifa2 [Coke]+++ Perfect. I ended up with class FakeInput { has $.response is rw; method get { $!response } } so I can play around with it easily 02:52
Xliff [Coke]++ 02:55
m: sub a { once { say 'OHAi!' }; say 'Beep!' }; a xx 4 02:59
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
xx used at line 1
Xliff m: sub a { once { say 'OHAi!' }; say 'Beep!' }; a() xx 4
camelia OHAi!
Beep!
Beep!
Beep!
Beep!
Xliff Oh, that's niiice.
guifa2 [Coke]: unfortunately zef doesn't seem to like it 03:09
boo 03:11
Geth ecosystem/alabamenhu-patch-3: d13624305b | L'Alabameñu++ (committed using GitHub Web editor) | META.list
Add Intl::Prompt::YesNo to ecosystem

Let's see if we can get this one the first try
03:13
ecosystem: alabamenhu++ created pull request #574:
Add Intl::Prompt::YesNo to ecosystem
guifa2 [Coke]: the module it was gonna be used in: github.com/alabamenhu/IntlPromptYesNo 03:14
tony-o guifa2: password prompt?
guifa2 tony-o no, just a yes/no prompt 03:15
Xliff m: say Q(2+2) 03:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Q used at line 1
Xliff m: say Q (2+2) 03:18
camelia 2+2
raku-bridge <sampersand> . 04:31
Geth ecosystem: d13624305b | L'Alabameñu++ (committed using GitHub Web editor) | META.list
Add Intl::Prompt::YesNo to ecosystem

Let's see if we can get this one the first try
06:38
ecosystem: 048b85b9b8 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #574 from Raku/alabamenhu-patch-3

Add Intl::Prompt::YesNo to ecosystem
jmerelo m: $FOO::bar = 33; say FOO::.^methods 08:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
FOO used at line 1
jmerelo That works from the REPL... 08:03
m: $foo::bar = 33; say foo::.^name 08:07
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
foo used at line 1
jmerelo m: $FOO::bar = 33; say FOO::.^name 08:08
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
FOO used at line 1
jmerelo Now this is weird
m: $Foo::bar = 33; say Foo::.^name
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Foo used at line 1
jmerelo m: $bar::baz = 33; say bar::.^name 08:13
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'bag', 'VAR'?
jmerelo m: package foo {}; $bar::baz = 33; say bar::.^name 08:16
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'VAR', 'bag'?
jmerelo m: my $bar = 33; package foo {}; $bar::baz = 33; say bar::.^name 08:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'bag', 'VAR'?
jmerelo m: $bar::baz = 33; say ::bar::.^name 08:21
camelia 5===SORRY!5=== Error while compiling <tmp>
No such symbol 'bar'
at <tmp>:1
------> 3$bar::baz = 33; say ::bar::7⏏5.^name
jmerelo m: $bar::baz = 33; say MY::bar::.^name 08:22
camelia Stash
jmerelo m: $bar::baz = 33; say ::bar::.^name
camelia 5===SORRY!5=== Error while compiling <tmp>
No such symbol 'bar'
at <tmp>:1
------> 3$bar::baz = 33; say ::bar::7⏏5.^name
jmerelo m: $bar::baz = 33; say MY::bar::.^name; say bar::.raku;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'VAR', 'bag'?
jmerelo m: $bar::baz = 33; say MY::bar::.^name, MY::bar::.raku 08:23
camelia Stash{}
jmerelo m: $bar::baz = 33; say MY::bar::.^name, MY::zyyz::.raku
camelia Stash{}
jmerelo m: $bar::baz = 33; my $p-bar = bar::; say $p-bar.raku; 08:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'VAR', 'bag'?
jmerelo m: $bar::baz = 33; say bar::.raku; 08:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'bag', 'VAR'?
jmerelo m: $bar::baz = 33; package bar {}; say bar::.raku;
camelia {"\$baz" => 33}
jmerelo m: $bar::baz = 33; say MY::bar.raku; say bar::.raku; 08:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'VAR', 'bag'?
jmerelo m: $bar::baz = 33; say MY::bar.^name; say bar::.raku; 08:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'bag', 'VAR'?
jmerelo m: $bar::baz = 33; say bar::.raku;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
bar used at line 1. Did you mean 'VAR', 'bag'?
jmerelo m: $bar::baz = 33; package bar {}; say bar::.raku; 08:37
camelia {"\$baz" => 33}
jmerelo m: $bar::baz = 33; package bar {}; say bar::.raku; 08:44
camelia {"\$baz" => 33}
jmerelo m: $bar::baz = 33; package bar {}; say bar::.raku; $baz::quux = 44; say baz::.raku
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
baz used at line 1. Did you mean 'bag'?
jmerelo m: role A { mutli method BUILD() { say "A" } }; class B does A { } } 09:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not instantiate role 'A':
Cannot invoke this object (REPR: Null; VMNull)
at <tmp>:1
jmerelo m: macro FOO { 'say 1' }; FOO; 09:06
camelia 5===SORRY!5=== Error while compiling <tmp>
Use of macros is experimental; please 'use experimental :macros'
at <tmp>:1
------> 3macro7⏏5 FOO { 'say 1' }; FOO;
jmerelo m: use experimental :macros; macro FOO { 'say 1' }; FOO;
camelia 5===SORRY!5=== Error while compiling <tmp>
Type check failed in macro application; expected AST but got Str ("say 1")
at <tmp>:1
------> 3ntal :macros; macro FOO { 'say 1' }; FOO7⏏5;
expecting any of:
argument list
raku-bridge <frost> m:run 'date' 11:18
evalable6 Thu 31 Dec 2020 12:18:20 PM CET
Geth ¦ problem-solving: JJ assigned to codesections Issue Name (and release date) proposal for 6.e github.com/Raku/problem-solving/issues/254 11:53
tib tony-o it is fixed for me 12:35
Geth ¦ problem-solving: AlexDaniel self-unassigned There's a huge PR/issue deficit in the Rakudo repo github.com/Raku/problem-solving/issues/5 13:15
m6locks anybody ever tried this? www.youtube.com/watch?v=6r7bNYVdUVw 19:11
Altai-man m6locks, it works, but is more buggy compared to moarvm, also is known to be much slower, due to less people actively maintaining it. 19:14
m6locks would have guessed it is faster because jvm 19:15
ok well they mention the speed issue right in the beginning 19:17
Altai-man m6locks, well, Java is a simple language and Raku is much more flexible, especially around its object model, but also a looot of other things. I mean, it all boils down to how nice you can project the abstractions from high-level to JVM level. More maintainers mean more speed. 19:18
m6locks aye 19:21
MasterDuke m6locks: the jvm backend can be faster than moarvm, but only after lots of iterations or for long-running tasks. pmurias is working on a truffle implementation of the jvm backend. it's not complete, but on one or two things is faster than both normal jvm backend and moravm 20:52
timotimo happy new year gmt+1folks 23:11
moritz same to you, timotimo! 23:12