🦋 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.
SmokeMachine m: sub foo($a, $b --> Hash()) { &?ROUTINE.signature.params.map: { .name.substr(1)=> ::(.name) } }; say foo 1, 2 01:07
camelia {a => 1, b => 2}
guifa MasterDuke: that one just replaces a few tokens. I mean, I guess I could hijack TOP. I’ll play around with it 01:50
AlexDaniel guifa: Slang::SQL is probably a better example? 02:53
patrickb o/ 08:45
tellable6 2020-03-16T10:13:25Z #raku-dev <rba> patrickb: rakubrew.org is on v6, running on the newest container build from rakubrew.org:master github repo.
patrickb rba: Great! Thanks for your work!
m: sub m() { { return 5; LEAVE {say 'L'} } }; say m();
camelia L
The 'ForeignCode' class is a Rakudo-specific
implementation detail and has no serviceable parts inside
patrickb ^ I can't explain that behavior. Not sure it's a bug or missing understanding on my side. 08:46
Comments welcome. 08:47
jjatria It looks like the latest version of `library/rakudo-star` in docker is 2019.03 09:11
I found this issue which seems related: github.com/perl6/docker/issues/20 09:12
Is this still the official image? Or is there some other I should be looking at?
patrickb jjatria: It's the official one. It's outdated. I think there are plans for creating updated ones. They just didn't happen yet. 09:15
jjatria: Thanks for the pointer!
jjatria I'll be happy to help if that needs volunteers. Not sure if I know how, but how hard can it be? :P 09:16
patrickb I think the right people to ask are tyil and jmerelo.
patrickb .tell tyil Do you need help with the rakudo star docker image? jjatria is willing to help! 09:17
tellable6 patrickb, I'll pass your message to tyil
patrickb .tell jmerelo Do you need help with the rakudo star docker image? jjatria is willing to help!
tellable6 patrickb, I'll pass your message to jmerelo
jjatria patrickb: Thanks! 09:18
El_Che hi patrickb 09:27
hi jjatria
(jjatria: I always read "jpatria", dunno why :) )
jjatria El_Che: :wave 09:28
I mean 👋
patrickb o/ 09:29
El_Che jjatria: it's been a while since we met at yapce-amsterdam
jjatria El_Che: I know! I'm not sure what will happen to this year's conference, but I was planning on going 09:30
El_Che: Now it seems all bets are off 09:31
El_Che I think NL is not the best place to be atm
but you live in the UK, so it's ok : 09:32
:)
while the rest of europe goes for containment, they are going for herd immunity as well
so I don't see a lot people from continental europe travelling to NL soon 09:33
chloekek It’s wonderful. So quiet and peaceful outside.
jjatria That was surprising to hear. I expect shoddy leadership in the UK, but NL? 09:34
chloekek And the weather is excellent.
El_Che I had registration/hotel/train for goconf in Berlin at the end of april but it's double cancelled :)
goconf moved it end of july and work cancelled as well 09:35
El_Che tripple: the .be governement announced a locked down banning travel 09:35
El_Che jjatria: the UK seems to be returning on their decision because their own model resulted in a prediction of 250 000 dead 09:36
now they are going for 20 000
jjatria El_Che: Yeah. That Imperial College study really put things into perspective 09:37
I'm surprised that NL is looking at a similar scenario and going "yeah, that sounds good"
El_Che I am disgusted though by the narrative game 09:38
how Kuenssberg states on the BBC how "the science changed", wtf
jjatria: the NL is closer to continental Europe than the UK though
somewhere in between
afk 09:40
chloekek I might be getting into Raku again soon. 09:46
chloekek I am very confused by docs.raku.org/language/list#Single...ument_Rule 10:09
chloekek What does it mean by “iterator”, what is list-or-array, and why would somebody think that it would be equivalent to (some-iterator(a))(b)...? 10:10
chloekek It’s not clear to me what construct this section is trying to convey. 10:28
lizmat I think the word iterator in that context is confusing
I would probably have said "syntax construct that uses an iterator" or something like that 10:29
chloekek: please make a doc issue :0(
chloekek OK
lizmat :-) rather :-)
chloekek An iterator iterator. 10:34
Because it iterates an iterator. 10:35
tadzik iteratorator 10:37
chloekek incubator 10:44
synthmeat quadriterator 11:21
Geth doc: ee4d988cf4 | (JJ Merelo)++ | doc/Language/subscripts.pod6
Deindent while doing #6232
12:08
doc: c638953e5e | (JJ Merelo)++ | doc/Language/subscripts.pod6
:delete on associative type objects, refs #6232
linkable6 Link: docs.raku.org/language/subscripts
tbrowder .tell tony-o the docker file failed with Inline::Perl5 as dependency in META6.json 12:24
tellable6 tbrowder, I'll pass your message to tony-o_
tbrowder .tell tony-o see my PR #4 for your rakudo-nightly 13:43
tellable6 tbrowder, I'll pass your message to tony-o_
rypervenche So I recently created a class with a $!foo attribute. To have an accessor (and bind it), I was told I could use "is built(:bind)" instead of creating the submethod BUILD. If I used $.foo instead, do I still need the "is built" part, or is there a different combination to bind it to the variable? 16:10
guifa AlexDaniel: yeah I had seen that. Maybe I could use that and instead of using the token ‘sql’ to initiate the slang, using \n. 99.99999% of people would say “use Fortran;” followed by a newline. It just feels hacky 17:21
lizmat rypervenche: $!foo means: no accessor, $.foo means: create an accessor and build 17:35
if you just use $.foo, it will not bind the value, but assign it to a container that is bound to the attribute
rypervenche lizmat: Gotcha. So no need to do any manual binding to speed things up. Thanks. 18:02
rypervenche I've got a subroutine that expects an object to be returned. If the subroutine returns Nil, it seems to pass it through and when I call the subroutine, it ends up returning a type object. Is this normal? gist.github.com/rypervenche/685908...567623afd8 18:36
wildtrees what does "Cannot invoke this object (REPR: Null; VMNull)" mean? it goes away when I change the guts of a method in a role from self!id to self.id 18:39
AlexDaniel wildtrees: I consider it to be a bug in most cases, but it depends on what you're doing 18:40
wildtrees yea I googled it, didn't find much, people were saying in most cases some sort of bug (in the linker?) 18:41
AlexDaniel what linker? 18:41
wildtrees so like raku couldn't figure out my method so stuck a null representation in for it? 18:42
just repeating what some comments said about the bug, think I closed the page
AlexDaniel wildtrees: yeah, you got a null somewhere, normally that shouldn't happen
but then again there's a lot of room to mess with internals and stuff, so sometimes it's user's fault to some extent :) 18:43
wildtrees so is self.id preferred over self!id ?
AlexDaniel wildtrees: can we see more code?
wildtrees I don't think I was doing anything too fancy , or arcane black magic guts
Xliff rypervenche: I almost said something silly, but you are specifying Credentials:D as the return type.
wildtrees sure, is there a preferred pastebin for this channel?
AlexDaniel wildtrees: gist.github.com works fine 18:44
Xliff If it was just --> Credentials, I would say that Nil is being coerced into the proper return type.
rypervenche: In this situation, if you want rakudo to throw if there is no returned object, I would suggest doing that manually.
You will probaly want to check if using a type smiley as a return type specified is currently supported. 18:45
timotimo rypervenche: Nil will always pass through return type checks, as will Failure; assignment of Nil to a scalar container will reset it to its default value, which is probably where the type object comes from 18:46
wildtrees AlexDaniel, gist.github.com/wildwildtrees/7772...595c867147 it's fixed but I put the bug in the description 18:47
rypervenche timotimo: Ahh, that's what is happening then. 18:48
guifa thinks Nil is one of those things that you shouldn’t use unless you really understand it. Empty, returning an undefined type object, or throwing is probably better (=does what people expect more often) in many cases
timotimo m: say Nil ~~ Failure; say Failure ~~ Nil
camelia False
True
AlexDaniel m: role Identifier { has $.id is rw; }; role Follow { method follow { say self!id } }; class Person is Item does Follow { }; Person.new.follow 18:49
camelia 5===SORRY!5=== Error while compiling <tmp>
'Person' cannot inherit from 'Item' because it is unknown.
at <tmp>:1
guifa If you ever did much Obj-C, you definitely understand Nil haha
wildtrees why is smartmatch not commutative?
rypervenche Nope. This is my first programming language.
guifa wildtrees: each object gets to decide how it smartmatches
AlexDaniel m: role Identifier { has $.id is rw; }; role Follow { method follow { say self!id } }; class Item does Identifier { }; class Person is Item does Follow { }; Person.new.follow
camelia No such private method '!id' for invocant of type 'Person'. Did you mean 'id'?
in method follow at <tmp> line 1
in block <unit> at <tmp> line 1
AlexDaniel hmmmm 18:50
guifa wildtrees: basically, each class has a method ACCEPTS(foo) { … }
the ~~ operator is just short for $right-hand-operator.ACCEPTS($left-hand-operator)
moritz ... plus setting $_ to $left-hand 18:51
AlexDaniel wildtrees: I can't reproduce it
guifa ^^ that too
mortiz++
moritz++
AlexDaniel wildtrees: can you gist a version that actually has a bug?
wildtrees just change the self.id on line 52 to self!id 18:52
AlexDaniel then we'll run it across releases and we'll see which rakudo version you have :)
wildtrees This is Rakudo version 2020.01 built on MoarVM version 2020.01.1
implementing Perl 6.d.
AlexDaniel 6c: gist.github.com/AlexDaniel/c97b428...7af7df1fb5
wildtrees think I used rakudobrew
committable6 AlexDaniel, ¦6c (42 commits): «Potential difficulties:␤ Useless use of hash composer on right side of hash assignment; did you mean := instead?␤ at /home/bisectable/git/whateverable/./sandbox/ootut2.pm6:1␤ ------> 03our %world = {}08⏏04 ;␤» 18:53
AlexDaniel wildtrees: ↑ can't reproduce on any rakudo release 18:53
wildtrees perl6 -I. -Mootut2 18:54
then at the repl: %world{100}.follow(200)
is it maybe a repl bug? I noticed I can't seem to use dynamic variables defined in the repl
rypervenche Ahhh, I didn't realize you could use :D on a type constraint for a variable. That's an easy way to get the behavior I was looking for. 18:55
AlexDaniel let's see
c: HEAD gist.github.com/AlexDaniel/c97b428...7af7df1fb5
committable6 AlexDaniel, Using file “runner.p6” as a main file, other files are placed in “./sandbox”
AlexDaniel, gist.github.com/b14cde17452678b0e1...c23a2fb2d9
AlexDaniel okay
6c: gist.github.com/AlexDaniel/c97b428...7af7df1fb5
committable6 AlexDaniel, Using file “runner.p6” as a main file, other files are placed in “./sandbox”
AlexDaniel, gist.github.com/3399ffd04bc5fcb9b6...0344336992 18:56
AlexDaniel I'm very confused by this output 18:57
wildtrees: I think it's right, there's no private method !id there 18:58
and it used to give the right error message
which later started saying “No such private method '!!id'”
but then there's also “Useless use of hash composer on right side of hash assignment ; did you mean := instead?”
which you no longer get on HEAD? 18:59
wildtrees I think it was doing it even when I did "role Follow does Identifier"
AlexDaniel lizmat: can you help figure this out?
lizmat: there are like 3 bugs in that gist
wildtrees oh
all from me? 19:00
AlexDaniel I mean, in rakudo, that gist just reveals them
wildtrees wow, hit a bunch of edge cases? 19:00
I think the way roles are handle in raku is pretty sweet so far
handled
AlexDaniel wildtrees: yeah, roles are cool 19:02
AlexDaniel ok the warning thing is just random 19:06
for whatever reason
wildtrees so it's fine other than self!id? 19:09
wildtrees goes afkish for a few
AlexDaniel wildtrees: github.com/rakudo/rakudo/issues/3556 19:17
chloekek lizmat: I wrote the documentation issue: github.com/Raku/doc/issues/3268 19:18
chloekek Oh, I think I understand now the reasoning of the author. 19:21
If you think if “for ...” so that ... is a syntactic list of arguments, then there is a special case of one element with no commas. 19:22
But I was just thinking of ... as any old expression, which can be a variable containing a list, or a list literal, or indeed anything else e.g. function call
On that page, the word “list” does not only refer to list objects, but also to comma-separated expressions, even in argument lists. 19:25
wildtrees AlexDaniel, so it's a regression and a two really weird bugs/warnings tied together? 19:37
Geth doc/master: 4 commits pushed by (Luis F. Uceta)++, (Juan Julián Merelo Guervós)++
AlexDaniel wildtrees: I'm not sure, it's weird 19:53