🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
jjatria Altreus: while on the topic of games written in Raku, I've been playing around with Pop and implementing a clone of the Pico-8 version of Celeste, and that's felt very smooth: gitlab.com/jjatria/celeste-clone 08:16
I'm currently stuck on a collision bug, though, but other than that, pretty smooth :P
Altreus jjatria: nice 08:19
I followed the link to the emulator and soft-locked myself by turning around somehow
(Since I'd never heard of it I wanted to see what it was)
(I didn't expect a playable version!)
jjatria Pico-8 is great 08:20
japhb Altreus: Join us over in #raku-gamedev ? :-) 08:23
Altreus sure
patrickb % 09:20
moon-child @ 09:21
raydiak Useless use of unnamed % variable in sink context (line 1)
lizmat ! 09:28
raydiak not sure whether to call that negative or complementary :) 09:37
Altreus Take it as a complement 09:43
raydiak was perhaps an overly-obscure logic joke. negation is also called the complement 09:50
heh, raku's ! twigil is specifically mentioned in en.wikipedia.org/wiki/Exclamation_mark
Altreus Perhaps my own pun ("Take it as a compliment") was itself obscure ;) 09:58
maybe it was the same joke
I approve of the Wikipedia article being exclamation mark, not exclamation point 09:59
raydiak of course...you win this time :)
lizmat :-) 10:05
raydiak if ! by itself is the complement of nothing, does that make it a concise expression of all possible things? 10:07
Altreus It is easy to go from this concept to that of being overwhelmed to the point of wordlessness 10:09
raydiak ...which takes us back to nothing 10:12
this is why empty text files and blank paper give me writer's block. I immediately realize it simultaneously represents nothing and the possibility of all things. then I need a nap :)
Altreus Imagination requires constraints 10:13
I should say s/Imagination/Creativity/ 10:14
raydiak creating a defined thing does imply that it's defined as not some other thing 10:19
Altreus You shouldn't open the file or take up the paper until you have spontaneously imagined a constraint in which to work 10:21
raydiak or not do it at all, which apparently is the least destructive thing possible 10:23
Altreus And the least constructive 10:24
If you choose inaction you still have made a choice
raydiak but the possibilities from that point are endless, which doesn't sound like a bad point to be at 10:25
Altreus At rock bottom, the only way is up 10:26
raydiak I wouldn't call inaction rock bottom. often our first compulsion is to do something which ends up making a situation worse. in other words up is not the only way to go from rock bottom if you pull out a jackhammer 10:30
raydiak Buddhism holds nothingness in very high regard, from what I understand 10:34
lizmat and then there's Mu :-)
raydiak ha! we're on topic after all 10:36
raydiak time for sleep. I'm going to go contemplate nothingness...or everythingness...or whatever it is(n't)... 10:49
lizmat sleep well! 10:50
raydiak ty :) 10:51
lizmat says something 11:18
lizmat logs.liz.nl now shows live logs from now on (although today will still be incomplete, to be fixed tomorrow) 11:34
Altreus I know Mu from Gödel, Escher, Bach 11:57
Maybe I should read that again so I have some tangible knowledge in that slot 11:58
Woodi hi 15:21
just upgraded Debian host and "perl6-*" packages was *very* slow to upgrade... probably it is like that since few years. maybe packaging could be improved ? 15:23
probably related to zef and modules
Woodi assumes "perl6-*" are Raku but just naming... 15:24
El_Che Woodi: I offer this as an alternative github.com/nxadm/rakudo-pkg 15:25
(if you need a more recent pkg)
nine Woodi: is there an open Debian bugreport on this? I seem to remember them doing precompilation in a post-install script which is just not how it's meant to be done. Precompilation should be done as part of packaging and it'd be about time they fix this 15:26
Woodi nine: possible 15:27
El_Che: sorry, but I prefer distros packages or compiling from sources. except on Windows I totally do not care :) 15:28
El_Che Woodi: no sorry, just a pointer :) 15:30
Altreus If there's one thing I appreciate about raku it's that - is a valid part of an identifier 16:11
I'm so often failing at shift when using _ that it's just not fun any more
in fact can someone make a slang that just guesses what I mean by [], and then I don't have to use shift at all 16:12
Geth doc: 5e1480f7db | (JJ Merelo)++ | doc/Type/Proc.pod6
Changes «old style» links, fixes #3895
16:26
linkable6 Link: docs.raku.org/type/Proc
Altreus you broke the link bot 16:29
Geth doc: a5acf6a1aa | (JJ Merelo)++ | type-graph.txt
Types need to go to typegraph too
16:37
codesections Altreus: don't plan to use any sigils? 16:59
Geth doc: 45a5f0a868 | (JJ Merelo)++ | type-graph.txt
Reverting last commit after @stoned found it was done already
17:07
Altreus codesections: \ is not a shift 17:18
:D
oh wait, colon
codesections Altreus: but \ creates a *sigil-less* variable (that's why I said "sigils" instead of "variables") 17:23
Altreus so splendid 17:24
m6locks ok guise 19:44
how does Comma's projects structure work?
I created a project with a .pm6 file in the lib/ directory, there's a .p6 file in the bin/ directory 19:45
but when I do raku Peli.p6 it says could not find the .pm6 file 19:46
tonyo do raku -Ilib Peli.p6 19:49
m6locks nope, still the same error 19:50
tonyo what's your code look like? the `-I` flag is adding that directory to the module search path
m6locks it's literally 3 lines 19:51
tonyo oh now i know what they are.
m6locks the basic setup for a project does use module (in my case Kasino.pm6 is the module file name, use Kasino;) and the I create a class and try to say the class contents 19:53
the module name lib/Kasino.pm6 is listed in the META6.json file thee 19:54
+r
tonyo in your Kasino.pm6 you have either `module Kasino` or `class Kasino` ?
m6locks ah, no
trying
I added the module Kasino; line in Kasino.pm6 but no 19:55
still the same error
tonyo with the -I flag? 19:56
m6locks aye, with the -I flag
gfldex m6locks: `raku -e 'say $*CWD;'` might help 19:57
m6locks it's the /bin dir 19:58
gfldex try -I../lib then
tonyo ^
m6locks ah, now it does something 19:59
thank you
should I do java-style one-class-in-one-pm6-file or how does that work? 20:02
it's now saying Undeclare name although I have a class of that name in the pm6
+d
gfldex did you export it?
m6locks hmm no 20:03
tonyo m6locks: gist.github.com/tony-o/ffb28eaad98...62949fd2e7
m6locks it appears the naming convention would need to have the module name in fron of the class name 20:04
tonyo if you have a class embedded in a module then yes 20:08
m6locks yes, now it works
what about classes as method arguments, it says invalid typename 20:09
(I'm literally re-doing an old Java project in Raku) 20:10
lizmat m: class Foo { }; sub a(Foo $b) { dd $b }; a Foo 20:11
camelia Foo
lizmat m6locks: we need more to go on :-)
tonyo if you want the entire file to be a class then use `unit class Kasino;` at the top of the file rather than putting the lcass inside a module
m6locks do I need to add the Kasino:: in front of the class name in the argument field? 20:12
they are both found in the same unit module
the classes that is
tonyo you want the class itself as an argument or you want a typed parameter?
m6locks it's just a type, yes 20:13
tonyo m: class A {has $.x = 5; }; sub say-a(A $x) { dd $x; }; say-a(A.new);
camelia A.new(x => 5)
m6locks hmm 20:14
tonyo m: class A {has $.x = 5; }; sub say-a(A $x) { dd $x; }; say-a(A); 20:16
camelia A
tonyo m: class A {has $.x = 5; }; sub say-a(A:D $x) { dd $x; }; say-a(A);
camelia Parameter '$x' of routine 'say-a' must be an object instance of type
'A', not a type object of type 'A'. Did you forget a '.new'?
in sub say-a at <tmp> line 1
in block <unit> at <tmp> line 1
tonyo m: class A {has $.x = 5; }; sub say-a(A:D $x) { dd $x; }; say-a(A.new);
camelia A.new(x => 5)
raydiak I'm with lizmat on this one: it would help a lot if we could see the code in a gist or pastebin or something so we know exactly how things are arranged and declared instead of playing 20 questions :) 20:22
m6locks just a sec
dpaste.com/2RE2HEY8N 20:24
that's the two files in one paste
lizmat X::AdHox looks like a typo for X::AdHoc ? 20:25
m6locks I can fix it, it's not complaining about that tho 20:26
lizmat @!pino = Array.new; # is a noop, you can remove that line
m6locks aye, good
my error is Invalid typename 'Kortti' in parameter declaration.
row 66 in the paste 20:27
lizmat Kortti inside Kasino::Pino is short for Kasino::Pino::Kortti
which doesn't exist 20:28
so you should fully qualify it inside Kasino::Pino
m6locks aye, yes that seems to do the trick 20:29
thank you
lizmat yw 20:30
gfldex m: constant hidden = class { role R }; sub s(hidden::("R") $p) {}; 20:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse role definition
at <tmp>:1
------> 3constant hidden = class { role R 7⏏5}; sub s(hidden::("R") $p) {};
expecting any of:
generic role
gfldex m: constant hidden = class { role R {} }; sub s(hidden::("R") $p) {};
camelia ( no output )
gfldex when is `hidden::("R")` evaluated?
in this example that is
[Coke] wouldn't it be runtime because of the dynamic lookup? 20:40
raydiak I thought ::() was interpolated at runtime, though I can't currently find the doc I read it in, so can't confirm 20:41
[Coke] ... oh, misread the example, it's in the signature. hurm.
m: constant hidden = class { role R {} }; sub s(hidden::("R") $p) {}; s(); # it knows the sig is required... 20:42
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling s() will never work with declared signature (<anon|1>::R $p)
at <tmp>:1
------> 3ole R {} }; sub s(hidden::("R") $p) {}; 7⏏5s(); # it knows the sig is required...
raydiak apparently if it can't be resolved at compile time, you'll get this error: 20:49
m: constant hidden = class { role R {} }; sub s(hidden::(say 0 and "R") $p) {}; s(hidden::R)
camelia ===SORRY!===
Name hidden::(say 0 and "R") is not compile-time known, and can not serve as a type name
gfldex m: constant hidden = class { role R {} }; sub s(hidden::("R") $p) {}; s.signature.say; 21:05
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling s() will never work with declared signature (<anon|1>::R $p)
at <tmp>:1
------> 3ole R {} }; sub s(hidden::("R") $p) {}; 7⏏5s.signature.say;
gfldex m: constant hidden = class { role R {} }; sub s(hidden::("R") $p) {}; &s.signature.say;
camelia (<anon|1>::R $p)
gfldex so it is compile time with a funky full name
raydiak yes though the funk is from the unnamed class, not the ::() 21:07
m: my class hidden { role R {} }; sub s(hidden::("R") $p) {}; &s.signature.say 21:09
camelia (hidden::R $p)
raydiak ^ is still hidden as long as you lexicalize it with my 21:13
m: { class not-hidden { } }; say not-hidden
camelia (not-hidden)
raydiak vs
m: { my class hidden {} }; say hidden
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
hidden used at line 1
raydiak imo feels cleaner, and no funky anon 21:14
raydiak I guess I don't really know what kind of hiding you're trying to do though. same is true for constant scoping, so maybe your goal was something entirely different 21:26
m: { constant hidden = class {} }; say hidden
camelia (<anon|1>)
kraxn hi there. New to raku - i just installed raku for ubuntu, using "sudo apt-get install rakudo" via rakudo.org/downloads. To get the repl, I can use 'Perl6', but most examples use 'raku'. Did I miss something in the configuration? In addition I also tried to use 'zef' to install a package, but it wasn't recognised. Did I miss something on the 22:28
install here too?
juanfra kraxn, do you have the file "/usr/share/perl6/site/bin/zef"? 22:43
phogg kraxn: per packages.ubuntu.org there is a package called perl6-zef, maybe that's it 22:44
s/org/com
juanfra if he installed raku using the packages from rakudo.org, then he shouldn't install the zef package from the ubuntu repo 22:45
kraxn juanfra - no I don't, phogg: sorry, I working from Linux. I just realised I i didn't install the star bundle, would this have the modules I need? 22:46
phogg kraxn: probably best to ignore me 22:47
kraxn phogg: no worries, any help is appreciated! 22:48
m6locks aye, star has modules 22:49
kraxn thanks, I will give this a shot now. 22:50
juanfra kraxn, ok, i think i understand now. you just ran the command "sudo apt-get install rakudo" because rakudo.org says that. you are using the official ubuntu package then. try installing perl6-zef as phogg said 22:52
i thought that rakudo had some kind of official rakudo build for ubuntu. 22:53
phogg it might have had that, but I guess not
m6locks well it is confusing tbh, since the webpage says that rakudo moar includes zef (implying you could install modules with it) 23:01
rakubrew worked nice for me 23:02
tonyo if the ubuntu package comes without zef then zef's readme has how to install it naturally 23:03