🦋 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.
rifkin i installed raku via the new rakubrew - but there is no p6doc. I tried zef install p6doc but i can't find the file p6doc 03:46
elcaro I don't have a good answer, but since it's pretty quiet here... i'll take a shot 03:48
I seem to recall someone else having issues with installing p6doc via zef recently. I think it required some work
for now, probably the quickest way to install it would be to clone the repo 03:49
then you `cd` into the repo folder and `zef install .`
should work... i think
rifkin docs.raku.org/programs/02-reading-docs shows to install rakudoc
but there is no match for rakudoc
elcaro yeah, so i think it broke due to renaming... which is why it's probably easiest to manually install (ie. clone repo, etc) 03:50
github.com/raku/rakudoc 03:52
here's the new repo... installation instructions are clone the repo and install locally :)
rifkin i'll try it 03:53
kylese Greetings, I've problems to understand why "the if-clause seems to cause an implicit data type conversion" ... Could some point me in the direction, pls? 11:28
moritz kylese: context?
kylese Sorry, OUTPUT: «2 :: 3␤True ???␤»
moritz, ??
moritz kylese: where did you read that sentence you quoted? 11:29
kylese moritz, I'm not sure what do mean by sentence? (The code is my minimal example.) 11:30
moritz, ... the quotation is my "interpretation"
moritz kylese: I understand even less now :-( 11:32
let's wait for somebody else to pick up, maybe I'm just dumb right now
kylese I try to understand why "$^b" is not "3" anymore, in the if-clause "???"
moritz and where's the code that demonstrates the problem? 11:33
kylese my $block := { my Int $i = $^a; put "$^a :: $^b"; if ($^b > $i) { put "$^b ???"; } }; my $int_2 = 2; my $int_3 = 3; $block($int_2, $int_3); 11:34
evalable6 2 :: 3
True ???
kylese Sorry, maybe i posted it only to camelia... ?!?
moritz maybe :D
moritz kylese: ok, I can answer your question :-) 11:36
kylese: if ($^b > $i) { put "$^b ???"; } the block here is a new block
and $^b is its formal parameter
so it's the same as if you wrote
if $^b > $i -> $NEWVAR { put "$NEWVAR ???" } 11:37
if you want to access the outer value of $^b, you can just write $b
but at this point, it's less confusing if you write your block as
my $block = -> $a, $b { use $a instead of $^a here } 11:38
kylese moritz, ok. Thank you for that so far. It seems that I have something to read now ... :) 11:39
moritz the feature that `if` makes it value availalbe is useful in such a case:
m: sub f() { 42 }; if f() -> $x { say "f returned $x" } 11:40
camelia f returned 42
moritz you don't have to duplicate the f() call
kylese moritz, ok. That sounds reasonable.. 11:41
lizmat hmmm.. looks like we lost the module update announcer 11:56
modules.raku.org/dist/Text::Mathem...:ELIZABETH
cpan-raku New module released to CPAN! Text::MathematicalCase (0.0.1) by 03ELIZABETH 11:58
lizmat Ah, I was merely impatient :-) 12:00
cpan-raku New module released to CPAN! Text::MathematicalCase (0.0.2) by 03ELIZABETH 12:44
[Coke] yawns. 12:57
lizmat: seems like a much more useful version of github.com/coke/raku-unicode-mangler! 12:58
lizmat but with fewer options 13:02
[Coke] I was only thinking command line usage when I threw mine together. 13:03
lizmat hmmm... looks like my .trans approach doesn't handle accented cases well: 13:06
$ mc --monospace "përl"
𝚙ë𝚛𝚕
[Coke] adds a reference to liz's module in his readme. 13:09
lizmat: I basically check for combinors in the string, pull them out, do the transform, then put them back. 13:10
lizmat hmmm I guess I could just NFD the mapper, and only handle codepoints for which there is a translation 13:11
and than un-NFD the result
lizmat will sleep a night on that 13:13
in any case, will also put a ref in to App::Unicode::Mangle
[Coke] if you like. no worries 13:14
El_Che Has anyone more info about the work by a student to get raku to deliver binaries? While fatpacker is a godsend (thx mst++), I spent quite sone time getting the perl app deployable right. It's painful compared to projects in other langs 14:09
I don't know if it was a grant of a Google Summer of Code project 14:10
MasterDuke pamplemousse was the nick i believe 14:11
El_Che googling 14:12
this seems to work: perl6 -e 'CompUnit::Loader.load-precompilation-file("test.moarvm".IO)' 14:18
raku --target=mbc --output=test.moarvm -e 'say 42' ; raku -e 'CompUnit::Loader.load-precompilation-file("test.moarvm".IO)'
dunno if it works with bigger programs using libs
m: raku --target=mbc --output=test.moarvm -e 'say 42' ; raku -e 'CompUnit::Loader.load-precompilation-file("test.moarvm".IO)'
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3ku --target=mbc --output=test.moarvm -e7⏏5 'say 42' ; raku -e 'CompUnit::Loader.lo
expecting any of:
infix
infix stopper
timotimo El_Che: have you looked at my appimage work? 14:44
that's linux-only of course
El_Che timotimo: It's a different scope (deploying on servers and containers) 15:11
timotimo ok but what prevents you from just deploying an appimage on a server :D 15:15
El_Che timotimo: fear of being lynched :) 15:17
timotimo if the people in question don't like appimage, maybe run a snapd from an appimage and install the rakudo program through that 15:18
El_Che yes, users loves the umsollicited snap directory in they home :) 15:19
timotimo ok, flatpak then? 15:23
El_Che hehe 15:27
patrickb . 15:43
Xliff timotimo/vrurg - You around? 15:57
timotimo one hand on kb, one on cat 15:59
rir I would like to make classes that are final (C++) or concrete (Sather) or non-inheritable (Raku). Has anyone done this? For my purposes: compile time control would be efficient, runtime--adequate. 16:00
timotimo i'm sorry, what is `Sather`? 16:03
moritz has no idea how to make a class non-inheritable, nor why you'd need that 16:09
rir A thesis/grad project out of Berkeley, I think. It was a study in typing by, primarily, Omohundro. 16:10
[Coke] I assume you could muck with the metamodel 16:13
Altreus restricting inheritance defeats OOP, don't do that 16:14
rir moritz: Generally, I think it is reasonable where a class has not been designed with inheritance in mind. Classes that embody interfaces to non-raku artifacts seem like a case.
[Coke] and maybe trigger that mucking with an "is final" keyword that gave you a classHOW that disallowed inheritance somehow, but I'm afraid I'm all handwavy on this.
Altreus Just because you didn't have something in mind doesn't mean people won't find a reason to do it
all you prevent is innovation
example: this pesky `multi` keyword in raku 16:15
[Coke] if runtime is ok, you could put a validation call in each method in your class that exploded if actual class calling method wasn't expected class.
but you're not going to get speed increases like you might with a 'final' class in Java.
(in fact you're going to be jumping through more hoops to enforce)
Altreus raku inherits many perl principles, and one of them seems to be not to prevent people doing stuff just because they might hurt themselves 16:16
rir One can also prevent a waste of time, by drawing attention to the fact that a class is tightly focused on an implementation detail.
Altreus write a comment and move on :)
plenty of rope to hang yourself
[Coke] m: class foo { method x is implementation-detail { say "hello"} } 16:17
camelia ( no output )
rir Hanging yourself is not a great argument. 16:17
[Coke] m: class foo is implementation-detail { method x { say "hello"} }
camelia 5===SORRY!5=== Error while compiling <tmp>
'foo' cannot inherit from 'implementation-detail' because it is unknown.
at <tmp>:1
16:18
[Coke] (right, is doesn't mean trait there.) - rakudo does have a method level trait to track that one particular type.
so, short version: there isn't a builtin way to do it. You can probably construct one and put it in module space by mucking with metamodel.
lizmat I guess one could make a "is not-inheritable" Method trait that would wrap the method and check the invocant and die if it is not the class itself 16:20
[Coke] if you're OK with purely advisory but still in code, you could use a Final role.
lizmat and the meta-model could apply such a trait
[Coke] how to do :exists in NQP? 16:22
lizmat nqp::existskey ?
rir Thanks Altreus, Coke, lizmat. Thanks, all. I do get Altreus' point but think there are clearly exceptional cases. As an amateur learning Raku, I'll file Liz's idea away. I see the beauty of the 16:32
cpan-raku New module released to CPAN! Text::MathematicalCase (0.0.3) by 03ELIZABETH 16:33
lizmat ^^^ that one also does accents correctly, [Coke]++ for the nudge 16:34
rir ^ Meta-classes coming into the Docs and the invitation that it implies. But it is a big shift from the behaviorally descriptive documentation style. 16:35
lizmat afk for a few hours&
[Coke] lizmat++ 16:36
rir ^ I expect that all my code will be open. 16:38
Xliff timotimo: If you have some free time, can I borrow some of it? 16:46
I am experiencing a weird error that, if holds, means a serious bug in rakudo
I just want another set of eyes on it before I create an issue. Just in case this bug isn't mine.
jmerelo Xliff: you've probably seen this, but just in case www.flickr.com/photos/atalaya/50509188396 17:21
timotimo Xliff: wanna try now? 19:15
cpan-raku New module released to CPAN! Gnome::Gtk3 (0.31.0) by 03MARTIMM 19:52
Xliff timotimo: Sorry. Still busy with work. Will you have time in about 30 minutes or so? 19:56
timotimo may be very distracted, but i'll have a quick look anyway
Xliff Thanks. 19:57
jmerelo: Oh wow! Thank you!
tellable6 Xliff, I'll pass your message to jmerelo
Xliff timotimo: In case you want to get a head start, I'm trying to check out why a role-based attribute doesn't appear to set properly and STAY set. 20:02
timotimo roles aren't closures, maybe that's you rproblem 20:03
Xliff Clone or down load p6-GLib and p6-GIO into the same directory.
cd into p6-GIO and then run the following: ./p6gtkexec -e 'use GIO::Roles::GFile; my $iostream; my $t = GIO::File.new_tmp("g_file_writev_XXXXXX", $iostream); say $t; say $iostream' 20:04
timotimo m: sub attribute-with($obj, $num) { role Test { has $.blorp = $num }; $obj does Test }; my $one = attribute-with "Hello", "first"; say $one.blorp; my $two = attribute-with "Goodbye", "second"; say $two.blorp; say $one.blorp 20:05
camelia first
second
first
timotimo that doesn't do it, hold on
m: sub attribute-with($obj, $num) { role Test { method blorp { $num } }; $obj does Test }; my $one = attribute-with "Hello", "first"; say $one.blorp; my $two = attribute-with "Goodbye", "second"; say $two.blorp; say $one.blorp
camelia first
second
second
timotimo there you go
Xliff I'll be back in another 15 to go over the details. 20:06
Yes, but that test doesn't have an attriubute, which I understand IS added to the composing class, so would be considered a closure, yes?
timotimo doesn't have to be an attribute 20:08
the reason why that worked is - i guess - because the attribute was added and immediately had its default value set
Xliff Ah. OK. Back in 15.
timotimo so it couldn't retroactively fail to stay correct
rindolf Hi all! how can I get «zef install Math::Primesieve» to work on fedora 33 beta or mageia linux 8 x86-64? 20:11
rindolf see modules.raku.org/dist/Math::Primes...an:CTILMES 20:17
+the <title> there is too generic
Xliff OK, back. 20:37
Wow. Took longer than I thought.
Xliff timotimo: gist.github.com/Xliff/44691ee3a050...dcff42970a 20:56
timotimo having trouble getting it to work 20:59
cmpiling now 21:01
Xliff OK 21:04
guifa o/ 21:17
timotimo FIOS: GIO::Raw::Definitions::GFileIOStream<5407500160> 21:22
!FIOS: GIO::Raw::Definitions::GFileIOStream<5407500160>
GIO::File.new
GIO::FileIOStream.new
what am i supposed to be seeing?
Xliff timotimo: The object GIO::FileIOStream is a GIO::Stream that does GLib::Roles::Object 21:35
GLib::Roles::Object puns $!o on any composing class.
The only time I've ever had a problem with this patterm is with GIO:;FileIOStram. The punned $!o attribute is not getting set. 21:36
I'm doing the same thing I'm doing with every other object.
I can set $!o in a block, but the moment execution leaves that block $!o goes back to being unset. 21:37
timotimo where's the code i should look at? 21:39
FileIOStream?
Xliff Follow GIO::FileIOStream.setGFileIOStream
The litmus test is that an instance of GIO::FileIOStream should have a non-nil return value for .GObject 21:40
.GObject -> GLib::Roles::Object -> GIO::Stream -> GIO::FileIOStream 21:41
timotimo testing an idea that it might have been something very simple 21:50
but compile times are big :)
Stage parse : 589.211
i could skip all of this trouble if i just used the debugger :D
Xliff I know. 21:53
The sucky compile times are the one reason I haven't released this, yet.
timotimo that tool really wants to be sugared up a whole bunch
for example, by launching both the program you have and an extra terminal with the debugger in it
Xliff Which tool?
timotimo that's already properly connected
Xliff Hmm....if I knew what was involved, I could be talked into taking a stab at it. 21:54
timotimo oh, just launch perl6/rakudo/raku with --debug-port=$n and launch another terminal with moar-remote localhost $n 21:58
and usually also --debug-suspend
Xliff OK. Will look into it. 21:59
Xliff Rebooting into Windows. 22:54