»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
b2gills array and hash variables get initialized for you ( by default ) 00:00
m: my @a := my Array $a; say defined $a; say defined @a # you can make it undefined though
camelia rakudo-moar a436fe: OUTPUT«False␤False␤»
lucasb b2gills: understood, thanks 00:02
b2gills `defined` back in Perl 5 would always return true if you declared, or used array or hash variables beforehand.
which means if you had `use strict` then calling defined on them was pointless 00:03
lucasb yeah, I never used defined on arrays/hashes in P5 because perldoc says it is deprecated 00:04
dalek kudo/nom: 4741d89 | hoelzro++ | INSTALL.txt:
Remove reference to readline in INSTALL.txt
03:37
kudo/nom: 1ea7b37 | hoelzro++ | INSTALL.txt:
Mention Linenoise for line editing features
ugexe sorry, looks like the comp unit pr i sent is failing jvm. it should work, but on jvm run/shell give a bad exitcode *if* any of :out/:err/:merge are used. However, the command still is executed properly and (for instance) stores the stdout in $proc.out properly 04:27
so precompilation still finishes successfully... its just marked as a failure because of the status check -> github.com/rakudo/rakudo/blob/bf71...it.pm#L133 04:28
perl6-j -e "my $proc = run('perl', '-v', :out, :!chomp); say $proc.status" # returns 65280 04:29
# but $proc.out.lines outputs the perl -v output 04:30
ugexe perl6-j -e "my $proc = run('perl', '-v', :!chomp); say $proc.status" # returns 0 04:31
ugexe actually im not sure if there is any fallout. i just expect there may be 05:04
kanl i'm experiencing a hash slice oddity. 05:17
gist.github.com/anonymous/0fdb5c3da8c7b0d80934
while i think i can understand any justification of the different behaviors, i find it quite counterintuitive. 05:18
is this by design or might this be a known issue? 05:19
or it also could simply be me using it all wrong :) 05:21
ugexe id say you are correct. not sure if its a known issue, but it looks like the type of thing that may be a side effect of the list refactor 05:35
kanl this apart, it'd be pretty magical to { say %h<1 2><a> } and get "1 (Any)" instead of errors, and be consistent with { %h<1><a> } getting 1.
ugexe unless its some autovivification thing 05:36
but they all have the same .perl output
kanl but if that can't be had, at least %h<...><foo> should be made consistent :) 05:37
ugexe %h{1|2}<a> might work
kanl err, .map i mean
m: my %h = 1 => $%( a => 1 ), 2 => $%( e => 4 ); say %h<1|2><a>; 05:39
camelia rakudo-moar 1ea7b3: OUTPUT«(Any)␤»
kanl m: my %h = 1 => $%( a => 1 ), 2 => $%( e => 4 ); say %h{1|2}<a>;
camelia rakudo-moar 1ea7b3: OUTPUT«any(1, (Any))␤»
kanl cool, thanks ugexe! 05:40
ugexe m: my %h = 1 => $%( a => 1 ), 2 => $%( e => 4 ); say %h{1&2}<a>;
camelia rakudo-moar 1ea7b3: OUTPUT«all(1, (Any))␤»
kanl as for the oddity in the gist, do i need to ticket it or just wait for GLR to automagically fix it? 05:42
Quom m: my %h = 1 => $%( a => 1, b => 2, c => 3 ), 2 => $%( e => 4, f => 5, g => 6 ); say %h{1,}.map: *<a> 07:12
camelia rakudo-moar 1ea7b3: OUTPUT«1␤»
Quom ^^
err
kanl: ^^
Also, when you did %h{[1]}, that did a lookup of %h{1}, but only because it did %h{[1].length}. My understanding is that this will be more intuitive post-GLR 07:13
Quom (In that [1] will be more like @([1]) instead of $[1]) 07:15
Quom kanl: However it looks like all these cases will work with multi-dim syntax, %h{@i;<a>} 07:19
RabidGravy morning! 07:28
masak \o
DrForr Morning all... 07:36
masak ahoy, DrForr 07:38
lizmat good *, #perl6! 07:39
jnthn: line 542 in Str.pm causes breakage on JVM with Str.perl: if $opener >= 256 && +uniprop($opener, 'Canonical_Combining_Class')
uniprop not being implemented on the JVM 07:40
DrForr o/ 07:42
lizmat DrForr \o
DrForr \o/ ,o/ ,o. \o. \o/ 07:44
jnthn morning, #perl6 07:47
yay, a decent-er night of sleep at last...
lizmat: d'oh, I knew .NFC wasn't on JVM, didn't realize uniprop wasn't either
lizmat I'm just making that if conditional on moar, seems to pass the tests 07:48
dalek kudo/nom: 0347787 | lizmat++ | src/core/Str.pm:
We no haz uniprop on JVM
07:49
jnthn lizmat++ 07:50
lizmat m: my $a; { $a = ENTER 42 }; say $a # now works 08:12
camelia rakudo-moar 1ea7b3: OUTPUT«42␤»
lizmat m: my $a; { $a = LEAVE 42 }; say $a # shouldn't this work also?
camelia rakudo-moar 1ea7b3: OUTPUT«(Any)␤»
masak lizmat: I can't see why not. 08:16
lizmat more generally, I guess that goes for all phasers,no? 08:17
masak sorry, my mind fails to generalize. what goes for all phasers? 08:18
lizmat to be usable as a r-value
jnthn No, it shoudln't work.
S04 has a list. It tells you exactly which ones work that way. 08:19
lizmat checks 08:19
jnthn Also, think about when a LEAVE executes
That $a = ... happens *before*
So it'd be utterly useless
masak oh, troo
m: my $a; { LEAVE $a = 42 }; say $a
camelia rakudo-moar 1ea7b3: OUTPUT«42␤»
masak already works.
jnthn I think there's one phaser in the list now that should be r-value but ain't
And that's FIRST 08:20
lizmat m: my $a; { $a = LEAVE 42 }; say $a # shouldn't this be a compile time error then ?
camelia rakudo-moar 1ea7b3: OUTPUT«(Any)␤»
jnthn And I have no darn clue where we're meant to keep the state
masak we could probably offer a warning when the phaser result can never be ready in time.
jnthn lizmat: Not worth the bloat
Maybe something for a lint tool
masak funny that lizmat and I had the idea at the same time, though :)
I agree that it might be too insignificatnt to merit a warning 08:21
lizmat m: my $a; for ^1 { $a = FIRST say "first" }; say $a # so this one is not up to spec yet, then 08:22
camelia rakudo-moar 034778: OUTPUT«first␤(Any)␤»
jnthn lizmat: Correct.
I actually went through the list yesterday
uh, 2-3 days ago I guess
'cus I was fixing ENTER
I don't know how on earth to implement FIRST as an r-value.
Probably something horrible with dynamic scoping... :)
lizmat perhaps FIRST should be implemented as a sort of "once" ? 08:23
jnthn Lets wait until after GLR with it 08:24
Because the code-gen for loops is going to be changing.
(all of them)
lizmat yeah, fair enough :-) 08:26
hmmm... on what is most likely going to be the hottest day ever in NL, our tap water just turned brown :-( 08:30
jnthn :-( 08:31
lizmat it appears to be just excess Fe and Mn, drinkable they say, just don't do your washing with it 08:35
lizmat still, having tea coloured water coming out of your tap 08:36
sorta weird
masak .oO( excess of Fe... oh, the irony )
DrForr Beat me by -><- that much.
masak DrForr: don't worry, I'll let you do a pun on magnesium :P 08:38
DrForr Elementary, my dear. 08:39
arnsholt Isn't Mn manganese though? =) 08:41
DrForr (╯°□°)╯︵ ┻━periodic┻ 08:42
lizmat yeah, although the Mn is not as animated as one would expect 08:43
Mg in the water would be rather explosive and not brown at all
(having tried that once in high school) 08:44
(under semi-controlled conditions)
masak oh, my bad. manganese.
much nicer to have in water, as lizmat++ points out. 08:45
lizmat
.oO( chinese manga )
masak generally, the things on the far left in the table are quite reactive.
DrForr Mostly white, excluding the bits of porcelain from the toilet you chucked it in...though of course I have no experience of that.
ShimmerFairy I'm guessing there's no way for an inner class to access the outer class' attributes, is there? That is, class A { has $.foo; class B { method bar { do-stuff-with($!foo); } } } 08:46
DrForr Na,Ce,Mg,Rb...
lizmat ShimmerFairy: do stuff with $.foo ?
lizmat so . instead of ! 08:47
ShimmerFairy I need to restart hexchat O_O
ShimmerFairy There we go; my font became all boxes everywhere, and now my usual monospace font looks different. Hm. 08:49
lizmat: ah, that makes sense. I'm used to using $!foo whenever I'm in a class. 08:50
masak ShimmerFairy: no, even `$.foo` would try to find that accessor in B.
jnthn Um, also no, there's no inner/outer class relationahip
ShimmerFairy masak: yeah, I found that out just now :)
masak ShimmerFairy: I've come to realize that if you really want inner classes in Perl 6, what you need to do is have an attribute in the inner class pointing to an instance of the outer class. 08:51
ShimmerFairy: and then go through it. I do that sometimes.
ShimmerFairy jnthn: darn, I was hoping I could avoid duplicating attributes between two classes
masak to be honest, that's probably a cleaner solution than Java's A.this.foo syntax :)
ShimmerFairy Well, that sucks then, though I'm not surprised. 08:52
masak oh! had this thought about PDL autolooping yesterday that I didn't share: 08:53
it feels like this problem is less about custom keywords and slangs, and more about custom data containers.
that is, the solution might rest purely in OO space.
we certainly have the operator flexibility to handle it. don't have to make it all about methods. 08:54
ShimmerFairy masak: The "reference to another class" thing feels too C-like for my taste in Perl 6, so I'd like to avoid that if possible. I don't know why it feels C-like to me, it just does. 08:55
lizmat wouldn't a simple 'class B is A', and then use $.foo do it then ?
ShimmerFairy: or is that not what you meant?
masak that wouldn't create a link between the original A object and the B object, though. 08:56
ShimmerFairy lizmat: sure, but it's not really appropriate in this case. I have a "Board" class and a "Piece" class. The Board has an array of 'Piece's
RabidGravy I blame the weather 08:56
is the API of IO::Socket::Async stable enough to merit documenting it?
masak ShimmerFairy: why do you feel a need for a piece to know about its board?
ShimmerFairy masak: The piece has a "barriers" method to calculate what spots it's always in, which necessitates knowing the current bounds. (The edges of the board being a first pass, at least.) 08:57
jnthn RabidGravy: Well, it's been pointed out that it has some inconsistencies with some other places, though I suspect that'll boil down to renaming at most 08:58
dalek kudo/nom: 2f61e18 | lizmat++ | src/core/Exception.pm:
Grammar (english) fix
08:58
masak ShimmerFairy: I'd be inclined to make the board->piece link unidirectional. then maybe that method/knowledge belongs on the board object.
ShimmerFairy masak: That's what I thought initially, but being able to do something like @!pieces».barriers seems too nice to not have 08:59
RabidGravy jnthn, cool. I have a medium term view to making a networking page in /language
lizmat list of JVM problems (on OSX at least) updated: gist.github.com/lizmat/573712315223a7bbca11 09:01
masak ShimmerFairy: well, design is about making that kind of tradeoff. the niceness of your application hinges on you making them well, so I'd stop and think carefully about this bit before proceeding. 09:03
s/application/game/
lizmat afk& 09:04
ShimmerFairy masak: The ultimate goal is a program that figures out how to divide a hexslide (or in my case right now, the square version) board into partitions. And it's very early in the coding process, of course :)
masak unidirectional links simplify things a great deal, but I agree there's also a cost. the @!pieces».barriers reason you mentioned above wouldn't be enough to sway me from using unidirectional links.
ooh 09:05
right, because the partitions can be analyzed independently
ShimmerFairy masak: yeah, I don't know if that will ever actually happen, it's just that in general it seemed natural to define the method for one Piece and then loop over Pieces, and the natural way to define a function on one Piece is as a method :)
masak actually, if you still retain the criterion of a bullet slide reaching the far end, only one partition will matter
ShimmerFairy masak: For cutting down on duplicate boards, you need to know partitions; Knowing the contents of each groove isn't sufficient, it's the contents of each partition that lets you determine that. (At least, that's what I've worked out in my head, who knows how true that is? :P) 09:07
masak sounds about right. 09:08
but also, see above: only the partition with the bullet ever matters if your goal is to "solve" the board. 09:09
masak actually, I had another idea long ago: to divide all the possible boards into "classes". each class has a description like "2-piece, 3-piece in groove d, 3-piece in groove k" and contains all possible configurations that match that description. 09:11
the configurations make up the nodes in a graph, with the edges being possible moves. 09:12
ShimmerFairy masak: Yeah, I think perhaps the goal is "is the space in front of the bullet one partition (solvable) or more (unsolvable)"? Interesting idea if that holds true.
masak and then you can break down the problem, solving it per class. 09:12
though the classes might be very large, I don't know.
there's certainly quite a few of them :>
ShimmerFairy masak: Here's a simple example of how the groove contents aren't sufficient for finding unique boards, in case you're interested: gist.github.com/lue/0d5b7d5b2608c2120ee9 09:13
BTW, in case it's not clear, or there can be multiple definitions, my definition of "equivalent boards" is "one can be rearranged to be the other, using only legal moves" 09:15
ShimmerFairy masak: with that classes idea, it certainly depends on how far you want to go classify, and if you want to try defining inheritance between classes :P (class 2-piece, 3-piece in groove d 'is' class 2-piece) 09:19
masak oh, that's what you mean by barriers. 09:20
well, I prefer to think of it in terms of graphs. your "equivalent boards" becomes my "component of a graph".
a given class graph can certainly have more than one component.
ShimmerFairy (The barriers method should probably take a list of bounds anyway, and be more generalized like that.) 09:21
I don't know where I came up with the term "barriers", by the way. "dividers" would be much more appropriate. 09:22
sergot hiho
masak sergocie! \o/ 09:25
tadzik hello hello 09:26
DrForr Morning. 09:27
RabidGravy I'm just going to kebab IO::Socket::Async right now unless anyone has any objections?
DrForr Only if you don't add onions and peppers. 09:28
RabidGravy but plenty of chilli sauce? 09:29
DrForr Oo, true, don't forget the sriracha.
DrForr ShimmerFairy: If I understand what you're after, maybe partitions would be more appropriate? 09:33
ShimmerFairy DrForr: "partitions" is for the space that gets divided by the dividers :) 09:34
DrForr Oh, true. I tend to think of 'partitioning the search space' in these cases.
lizmat hmmm, looks like a436fecb0c9143d6f49c9bd breaks t/spec/S24-testing/line-numbers.t
BooK where can I find out about perl6 and threads? 09:35
lizmat S17 09:36
lizmat S17:01 09:36
synbot6 Link: design.perl6.org/S17.html#line_01
BooK thanks 09:37
lizmat yw :-)
BooK lizmat: and do they work better than in perl 5? 09:38
lizmat they can't really be compared, I would say
Perl ithreads are not really threads
they're really old-Unix style, pre COW, forks 09:39
P6 concurrency *is* true concurrency, without copying anything
RabidGravy BooK, see also docs.perl6.org/language/concurrency which has somewhat of an overview
lizmat but with more responsiblity for developers 09:39
tadzik where is pmichaud's writeup on GLR? 09:40
lizmat github.com/perl6/specs/blob/master...-draft.pod 09:41
tadzik thanks lizmat
oha: ^
RabidGravy KEBABED! github.com/rakudo/rakudo/pull/456 09:54
dalek ast: 974e459 | lizmat++ | S12-class/stubs.t:
Make test grammar correction free
kudo/nom: 1950206 | RabidGravy++ | src/core/IO/Socket/Async.pm:
Kebab case and deprecate chars_supply, bytes_supply
09:55
kudo/nom: d9e3070 | lizmat++ | src/core/IO/Socket/Async.pm:
Merge pull request #456 from jonathanstowe/kebab-io-socket-async

Kebab case and deprecate chars_supply, bytes_supply
lizmat .tell FROGGS there's something weird going on with repeated qqx[], it seems 10:07
yoleaux lizmat: I'll pass your message to FROGGS.
timotimo DEPRECATED always makes stuff sooooo slow, but in this case it's methods that you only call every now and then, so it's fine
lizmat DEPRECATED is a lot faster nowadays, now that we have lazy backtraces
lizmat but yeah, there should be an incentive to migrate :-) 10:07
timotimo oh, cool
lizmat is looking at her screen and the only thing she can think of is "siesta" 10:08
cognominal more like coma here :( 10:10
lizmat .tell FROGGS looking at failures in t/spec/S24-testing/line-numbers.t and t/spec/S32-io/IO-Socket-INET.t 10:13
yoleaux lizmat: I'll pass your message to FROGGS.
virtualsue gets the latests rakudo star after noticing that moarvm isn't building today 10:13
jnthn virtualsue: "isn't building"? 10:14
virtualsue well, isn't linking
jnthn Hm...if you still have it, could you gist the failure mode? 10:14
timotimo si, esta bene 10:15
virtualsue gist.github.com/virtualsue/0b757b139f3946c2515e 10:16
timotimo virtualsue: that's probably from a fresh extraction and clean build? 10:20
virtualsue yes 10:21
well, after a pull and a make clean
jnthn Presume a re-Configure too? 10:22
virtualsue nope, will do that after i get back
timotimo ah
that'll be the problem; new files were added
that requires a re-configure
itz morning 10:27
nwc10 ^good :-) 10:29
masak have the appropriate amount of morning goodness 10:30
nwc10 test!
blackbolt morning, timotimo, can you help me with "exit" method in GTK::Simple? 10:33
timotimo i haven't touched GTK::Simple in a long time 10:53
what's the problem?
blackbolt 4 dec 2014: "quick and dirty implementation of GTK::Simple::Window" 10:54
i need secend window, and there is problem with method exit 10:55
can you run this: pastebin.com/Ajqh1CpH 10:59
ShimmerFairy m: my @a = [1,2],[3,4]; my @b = [3,4],[5,6]; say @a (&) @b # it's very annoying that this doesn't DWIM 11:06
camelia rakudo-moar d9e307: OUTPUT«set()␤»
ShimmerFairy I can see why it happens (=== right?), but that doesn't mean I like it :) 11:08
ShimmerFairy Is there any good reason why it _shouldn't_ do what I want it to? 11:15
timotimo you want the result to be [3,4], correct? 11:16
it's hard to do when you have mutable lists involved :\
Ulti jnthn just tried running your golf helper demo and got "Invalid GC status observed; aborting" 11:17
on OSX with rakudo moar built about 5 minutes ago 11:18
ShimmerFairy timotimo: yes, and considering [3,4] ~~ [3,4] , I'm tempted to say it's not that hard (but I imagine it's not as easy as ~~ makes it seem :P)
timotimo mhh
ShimmerFairy The only solution I see so far would be to turn those two-element lists into complex numbers, but that's really ugly. 11:21
timotimo m: my @a = [1,2],[3,4]; my @b = [3,4],[5,6]; say @a.grep(@b) 11:22
camelia rakudo-moar d9e307: OUTPUT«␤»
oha if i die [1,2,3] how can i distinguish it in a catch from a die "string" ?
timotimo m: my @a = [1,2],[3,4]; my @b = [3,4],[5,6]; say @a.grep(any(@b))
camelia rakudo-moar d9e307: OUTPUT«3 4␤»
ShimmerFairy Heh, that actually would work. Shame I can't use setops for the same thing, though. 11:23
timotimo yeah :| 11:25
you can redefine the set ops lexically
ShimmerFairy Considering I'm only doing this once (at least so far), I don't think it's quite worth redefining the setops :) 11:27
Oh, that reminds me, does the CORE setting still have that "no unicode characters" limitation?
timotimo OK 11:28
not sure 11:29
ShimmerFairy m: my @a = [1,2],[3,4]; my @b = @a[0]; say @a.perl; say @b.perl; 11:33
camelia rakudo-moar d9e307: OUTPUT«[[1, 2], [3, 4]]<>␤[[1, 2]]<>␤»
ShimmerFairy I don't think @b is supposed to be nested like that (but I just realized I may be the one who's mistaken)
gfldex m: my @a = [1,2],[3,4]; my $b = @a[0]; say @a.perl; say $b.perl; 11:35
camelia rakudo-moar d9e307: OUTPUT«[[1, 2], [3, 4]]<>␤[1, 2]␤»
ShimmerFairy I get why it happened, but I still want to say it's a bug that assigning a 1D row from a 2D array to an array results in a 2D array. 11:36
gfldex m: my @a = [1,2],[3,4]; my $b = @a[0]; my @c; @c.push($b); say @a.perl; say $b.perl; say @c.perl; 11:37
camelia rakudo-moar d9e307: OUTPUT«[[1, 2], [3, 4]]<>␤[1, 2]␤[[1, 2]]<>␤»
timotimo it's hard to put something into the initial @a that would flatten when you take it out but not flatten it into the original @a directly
m: my @a = [1,2]<>, [3,4]<>; say @a.perl; my @b = @a[0]; say @b.perl
camelia rakudo-moar d9e307: OUTPUT«[1, 2, 3, 4]<>␤[1]<>␤»
gfldex i think rakudo is right because (in my eyes) my @b = @a[0] is the same as @b.push(@a[0]) 11:38
sjn also gets surprised by ShimmerFairy's example
ShimmerFairy timotimo: Yeah, but it's still a bit of a WAT that I my 1D row became a 2D array inside @b (it caused a bug when @b[0] += $var became 2 (where $var == 0)) 11:39
s/I//
timotimo mhm
i need to run now :)
masak ShimmerFairy: I don't think it's surprising.
ShimmerFairy masak: surprised me :) 11:39
gfldex m: my @a = [1,2],[3,4]; my @b := @a[0]; say @a.perl; say @b.perl; 11:40
camelia rakudo-moar d9e307: OUTPUT«[[1, 2], [3, 4]]<>␤[1, 2]<>␤»
masak ShimmerFairy: you need to realize that assignment to an array assigns to the *insides* of that array.
ShimmerFairy: like `my @a = 1, 2, 3;`
gfldex = is not the same then = as found in most languages
masak ShimmerFairy: there's no mention of the actual array there. you just get it for free.
gfldex we have := that does most of the = in non-perl6
ShimmerFairy gfldex: except := allows me to modify the original array, which I do _not_ want in this case.
masak ShimmerFairy: same thing with `my @b = @a[0];` -- there's two arrays in play here: @a[0], and the surrounding, implicit array. 11:41
gfldex if you want to clone, you should clone
m: my @a = [1,2],[3,4]; my @b = @a[0].clone; say @a.perl; say @b.perl;
camelia rakudo-moar d9e307: OUTPUT«[[1, 2], [3, 4]]<>␤[1, 2]<>␤»
ShimmerFairy I have never used (or even really known about) .clone in my life. What good is it?
masak: I still maintain that my expectation is more correct than what happened. I really hope this isn't going to stay the same post-GLR :P 11:42
masak gfldex: heh, that one surprised me :) why is it only one layer of array there?
gfldex it garantees to make a copy (that may be CoW tho)
moritz ShimmerFairy: DateTime uses it internally for creating derived objects
gfldex masak: i have no idea
gfldex .clone may even flatten at a spot where it shouldn't 11:43
ShimmerFairy masak: the implicit outer [] on assigning to @a vars used to trip me up when I started out with Perl 6, and I'm surprised it tripped me up again. I _really_ don't like it whenever it does.
gfldex m: my @a = [1,2,[5,6]],[3,4]; my @b = @a[0].clone; say @a.perl; say @b.perl; 11:44
camelia rakudo-moar d9e307: OUTPUT«[[1, 2, [5, 6]], [3, 4]]<>␤[1, 2, [5, 6]]<>␤»
masak ShimmerFairy: I kind of like it. 11:45
ShimmerFairy: it's one of the benefits of using the @ sigil
ShimmerFairy: bit less clutter.
ShimmerFairy masak: I've gotten used to it, but I wouldn't say I like it (esp. right now) :)
masak *nod*
it is quite unusual, I'll give you that.
and in that sense, it's definitely not Least Susrprise.
ShimmerFairy masak: I especially think it's bad that I can't easily take a 1D slice of a 2D array in this case; the fact that I have to do some kind of trick (mine is @a[0].flat) feels wrong here. 11:46
masak *nod*
Perl 5 has it easier there, because it flattens everything. 11:47
ShimmerFairy I really hope the GLR will eliminate most, if not all, of the problems I've run into with lists over the years :) . It's the one part of Perl 6 I've never been able to navigate without one or two frustrations (see the failure of set intersection earlier for another example) 11:48
gfldex I like that fact that i have to keep := and .clone in mind because I found myself on the wrong end of a stick that filled all my RAMs a few times in the past
gfldex please dont fill all my RAMs :( 11:48
ShimmerFairy $a := $b is more akin to T& a = b , in my mind 11:49
kanl Quom: thanks. 11:50
lizmat ShimmerFairy, timotimo : re irclog.perlgeek.de/perl6/2015-07-02#i_10838986 , no the CORE settings can haz unicode (now that parrot is no longer supported) 12:08
ShimmerFairy lizmat: that's what I thought. Maybe someone should go through and unicode-ify the CORE at some point, now that there's no real reason not to. 12:10
lizmat wrt to set operators, I've already done that
ShimmerFairy That you did. I forgot the last set_operators.pm I looked at was a quite old one :)
lizmat it was f4de5f36 12:11
RabidGravy anyone fancy golfing this async echo client example: gist.github.com/jonathanstowe/40ae...342d3ac244 - it works with the example echo server in the IO::Socket::INET but I can't get it shorter and work reliably
lizmat goes back to siestaing
BooK just ran my first perl6 oneliner 12:30
or at least my first since 2007
RabidGravy and did you get sucked into an alternate dimension? 12:31
BooK I'm still waiting for the ship to pick me up
RabidGravy cool
BooK I think I'll try to see if I can port Git::Repository to perl 6 12:32
I sure hope there won't be any ugly implementation details as there are in the perl 5 version
RabidGravy there probably will be but you can just hide them better ;-) 12:35
hoelzro morning #perl6 13:04
masak morning, hoelzro 13:12
hoelzro morning masak
BooK so, where do I find the methods for an IO::Pipe object? 13:13
doc.perl6.org/type/IO%3A%3APipe 13:14
Juerd 404
sjn doc.perl6.org/type.html # has no IO::Pipe listed 13:16
BooK perl6 -e 'say run( "ls" ).out.^methods' # introspection can help, in the absence of docs :-) 13:16
moritz m: say IO::Pipe.^mro 13:17
camelia rakudo-moar d9e307: OUTPUT«IO::Pipe is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:1␤ in method gist at src/RESTRICTED.setting:33␤ in block <unit> at /tmp/Xdb3nlX3Ng:1␤␤»
moritz BooK: I think IO::Pipe isa IO::Handle, so doc.perl6.org/type/IO::Handle might be of some interest 13:18
BooK perl6 -e 'say run( "ls" ).out.^parents' 13:19
(IO::Handle)
perl6 -e 'say run( "ls" ).out.lines' # dies loudly 13:20
moritz uhm 13:21
don't you need to say run("ls", :out) to make .out a Pipe? 13:22
otherwise it might be just a type object
BooK I don't know, this is my first hour coding in perl 6
moritz plesae try say run( "ls", :out ).out.lines 13:23
BooK yes, that worked, except for the newlines
.say for run( "ls", :out ).out.lines # DWIM 13:24
moritz it chomps by default; add a :!chomp if you don't want it to chomp
run('ls', :out, :!chomp)
BooK where do I find those adverbs ?
moritz doc.perl6.org/type/Proc 13:25
it's documented for &run and Proc.new together
BooK yes, just saw that
moritz maybe I should add a heading for 'sub run', just to have it searchable 13:26
BooK "Setting one (or more) of them to True makes the stream available as an IO::Pipe object of the same name, so for example $proc.out." # this is why I need the :out ?
moritz right
BooK oooh, because if I say :out = $some_other_pipe, then it will just pipe the data to the other? 13:27
moritz :out($some_other_pipe) or out => $some_other_pipe
yes
BooK ok, let me try to run ls | sort this wya
moritz the synopsis has an example for that 13:28
moritz well, echo | cat -n 13:28
but same principle
BooK just trying to figure it out by myself
to see how intuitive it is for this perl 5 dinosaur
moritz BooK: fwiw if you have feedback on how to improve the docs, feel free to share here and/or on github.com/perl6/doc/issues/ 13:29
BooK I guess I first need to understand how they are organized
BooK of course, my first attempts hangs 13:31
dalek kudo-star-daily: 33a7392 | coke++ | log/ (9 files):
today (automated commit)
rl6-roast-data: 549528f | coke++ | / (9 files):
today (automated commit)
BooK so, let's say I have a class with a $.dir attribute, which is a IO::Path. I want to be able to call new with a Str, and get a IO::Path in my object 13:50
is that done with BUILD ?
masak yes
BooK but can I do something like $!dir = IO::Path.new($.dir) if $.dir.isa(Str) ? 13:51
masak $!dir = $!dir.IO if $!dir ~~ Str 13:52
Juerd If you're going to use the $!, why not all the way?
masak you should all the way in submethods
[Coke] yawns
masak BooK: might even be able to skip the `if`, given that .IO will tend to do the right thing if you already have an IO::Path 13:53
BooK: also might be possible to do this with a coercion type in the param list: IO::Path(Str)
m: sub foo( IO::Path(Str) $file ) { say $file }; foo( "file1" ) 13:54
camelia rakudo-moar d9e307: OUTPUT«Method 'IO::Path' not found for invocant of class 'Str'␤ in sub foo at /tmp/9Ay0c0HlFO:1␤ in block <unit> at /tmp/9Ay0c0HlFO:1␤␤»
masak meh :/
masak m: sub foo( IO(Str) $file ) { say $file }; foo( "file1" ) 13:54
camelia rakudo-moar d9e307: OUTPUT«"/home/camelia/file1".IO␤»
masak oh, that works.
m: sub foo( IO() $file ) { say $file }; foo( "file1" )
camelia rakudo-moar d9e307: OUTPUT«"/home/camelia/file1".IO␤»
masak BooK: ^ 13:55
BooK I see 13:56
hoelzro when I was building the docker 2015.06 rakudo star image yesterday, I was bitten by the lack of readline facilities. Any chance we could add Linenoise to rakudo star?
moritz does it work on Windows?
does it need a C compiler? 13:57
oha m: "abc" ~~ m{()}; 13:58
camelia rakudo-moar d9e307: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VUxsZTEF1F␤Null regex not allowed␤at /tmp/VUxsZTEF1F:1␤------> 3"abc" ~~ m{(7⏏5)};␤»
jnthn So putting it together, submethod BUILD(IO() :$!dir) { } 13:59
BooK not sure I understand what that means 14:00
also, I have two such attributes and one of them is optional
hoelzro moritz: it does indeed need a C compiler
hoelzro I haven't tried it on Windows, but I recently updated the included linenoise.c file to use MoarVM/linenoise, which has Windows patches 14:01
BooK jnthn: basically signatures are so powerful you don't need any code :-) 14:02
moritz hoelzro: it should be tested on windows before we add it to star
hoelzro moritz: works for me
"A successful match always returns a C<Match> object, which is generally also put into C<$/>..." is there a context in which $/ is *not* populated by a regex match? 14:08
BooK how do I actually load IO::Path, so that I can do things like IO::Path.new( "foo" ) ? 14:09
moritz BooK: it's already loaded
moritz m: sub f($/) { say $/ }; say f "foo" 14:09
camelia rakudo-moar d9e307: OUTPUT«foo␤True␤»
moritz hoelzro: ^^
or the other way round
m: grammar A { token TOP { .* } }; A.parse('foo'); say $/ 14:10
camelia rakudo-moar d9e307: OUTPUT«「foo」␤»
moritz huh
timotimo did some errands in the city and had a piece of watermelon, too 14:22
hoelzro m: my $s = 'the quick fox jumped over the lazy dog'; my $m = $s ~~ m:s/$<one>=[\w+] $<two>=[\w+] $<three>=[\w+]/; say ( :one($<one>.Str), :three(do { ($m<three> ~~ /'fox' || 'dog'/).Bool }), :two($<two>.Str),).hash; 14:26
camelia rakudo-moar d9e307: OUTPUT«Use of Nil in string context in block <unit> at /tmp/d1cCnrK4i2:1␤one => the, three => True, two => ␤»
hoelzro ^^ shouldn't the do block above get its own $/ variable? 14:27
jnthn $/ is per routine
YOu can declare your own $/
hoelzro ah, ok
masak <BooK> jnthn: basically signatures are so powerful you don't need any code :-)
BooK: in 2024, we'll be able to auto-generate signatures, thus eliminating programming altogether :P
moritz masak: oh, you still write your signatures by hand? 14:28
:-) 14:29
masak lovingly hand-crafter, yessir
crafted*
hoelzro m: my $x = 1; do { my $x = $x; say $x }
camelia rakudo-moar d9e307: OUTPUT«(Any)␤»
hoelzro ^ should the RHS of the inner my be able to consult the outer $x? 14:30
masak most certainly not
jnthn OUTER::<$x>
masak after the `my $x`, a new $x is visible in the scope.
shadowing the old one.
hoelzro ok, got it 14:32
timotimo m: my $x = 1; do { say $x; my $x = 5; say $x } 14:33
camelia rakudo-moar d9e307: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Qm2AVx2HOE␤Lexical symbol '$x' is already bound to an outer symbol;␤the implicit outer binding must be rewritten as OUTER::<$x>␤before you can unambiguously declare a new '$x' in this scope␤at /tmp/Qm2A…»
timotimo "after the my $x", but also before it :)
moritz this allows one to write recursion into anonymous subs more easily 14:39
m: my $f = sub ($x) { $x == 0 ?? 1 !! $x * $f($x - 1) }; say $f(4)
camelia rakudo-moar d9e307: OUTPUT«24␤»
moritz you can't do that in p5 14:40
jnthn m: my $f = anon sub fac($x) { $x == 0 ?? 1 !! $x * fac($x - 1) }; say $f(4)
camelia rakudo-moar d9e307: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7mSxdS4Ic7␤Undeclared routine:␤ fac used at line 1␤␤»
jnthn aww, thought you could do that...
moritz m: my $f = anon sub fac($x) { $x == 0 ?? 1 !! $x * &::ROUTINE($x - 1) }; say $f(5) 14:44
camelia rakudo-moar d9e307: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AkBBzzqLap␤Undeclared routine:␤ &ROUTINE used at line 1␤␤»
moritz m: my $f = anon sub fac($x) { $x == 0 ?? 1 !! $x * &?ROUTINE($x - 1) }; say $f(5)
camelia rakudo-moar d9e307: OUTPUT«120␤»
timotimo hm, we can't do a levenshtein to find $? variables yet? 14:51
because they only get installed as soon as you mention them, perhaps?
LWP::Simple has a Sub isa_ok (from Test) seen at: 14:52
t/parse-url.t, line 48
lucasb Hello. Does it makes sense to say "given @a" or "given %h"? Will it bind the array/hash into $_ inside the block? 14:55
timotimo m: sub foobar(num $foo = 0e0) { } 14:56
camelia rakudo-moar d9e307: OUTPUT«5===SORRY!5=== Error while compiling /tmp/i90XTHojDs␤Default value '0' will never bind to a parameter of type num␤at /tmp/i90XTHojDs:1␤------> 3sub foobar(num $foo = 0e07⏏5) { }␤ expecting any of:␤ constraint␤»
timotimo lucasb: that's right
lucasb m: my @a = 1,2,3; given @a { .perl.say }
camelia rakudo-moar d9e307: OUTPUT«[1, 2, 3]<>␤»
lucasb m: my @a = 1,2,3; given @a { $_ = 42 }
camelia rakudo-moar d9e307: OUTPUT«Cannot assign to an immutable value␤ in block <unit> at /tmp/99RfBY9ulI:1␤␤»
timotimo hm, given probably doesn't set $_ to rw? 14:57
lucasb ^^ Any reason I can't assign to them?
dalek c: 0caf9d5 | RabidGravy++ | lib/Type/IO/Socket/Async.pod:
Add documentation for IO::Socket::Async
c: 319ddfb | RabidGravy++ | lib/Type/IO/Socket/Async.pod:
Merge branch 'io-socket-async'
masak m: my @a = 1, 2, 3; for @a { $_ = 42 }; say @a
camelia rakudo-moar d9e307: OUTPUT«42 42 42␤»
masak lucasb: you can, if you use `for` 14:58
m: my @a = 1, 2, 3; given @a[1] <-> $_ { $_ = 42 }; say @a
camelia rakudo-moar d9e307: OUTPUT«1 42 3␤»
masak m: my @a = 1, 2, 3; given @a[1] { $_ = 42 }; say @a
camelia rakudo-moar d9e307: OUTPUT«1 42 3␤»
timotimo m: nqp::istype(0e0, num)
camelia rakudo-moar d9e307: OUTPUT«===============================================================================␤The use of nqp::operations has been deprecated for non-CORE code. Please␤change your code to not use these non-portable functions. If you really want␤to keep using nqp:…»
timotimo m: use nqp; nqp::istype(0e0, num)
camelia ( no output )
timotimo m: use nqp; say nqp::istype(0e0, num)
camelia rakudo-moar d9e307: OUTPUT«0␤»
masak lucasb: or if you do `given` on a single element of the list.
timotimo that'd be the reason.
RabidGravy someone might want to make better examples for that as I struggled to make a sensible client 14:59
timotimo m: say nqp::objprimspec(my num $foo)
camelia rakudo-moar d9e307: OUTPUT«===============================================================================␤The use of nqp::operations has been deprecated for non-CORE code. Please␤change your code to not use these non-portable functions. If you really want␤to keep using nqp:…»
timotimo m: use nqp; say nqp::objprimspec(my num $foo)
camelia rakudo-moar d9e307: OUTPUT«0␤»
timotimo m: use nqp; say nqp::objprimspec(num)
camelia rakudo-moar d9e307: OUTPUT«2␤»
timotimo m: use nqp; say nqp::objprimspec(nqp::decont(my num $foo))
camelia rakudo-moar d9e307: OUTPUT«0␤»
timotimo m: use nqp; say nqp::objprimspec(Str) 15:00
camelia rakudo-moar d9e307: OUTPUT«0␤»
timotimo ok
lucasb I was trying to assign a new array as a whole, not an individual element
more like "given @a <-> $_"
dalek kudo/nom: 9b4463d | timotimo++ | src/Perl6/Actions.nqp:
work around X::Parameter::Default::TypeCheck not understanding native parameters
lucasb but maybe it doesn't work, that's ok
timotimo ^- should i file a bug & build a test for this? 15:01
hoelzro === is object identity equivalence, and eqv is structural equivalence, right?
timotimo i think so, yeah 15:02
and =:= is container equivalence
er ... container identity check
hoelzro alright, thanks for the sanity check! 15:02
ugexe i think i see the jvm shell/run exitcode bug. now i uh... just have to learn java 15:17
jnthn There's not very much Java to learn... 15:18
ugexe that what it looks like, but you shouldnt overestimate my abilities either heh 15:19
RabidGravy :) 15:20
nnms добрый день, у меня есть список названий тегов, как лучше и изящнее сопроставить их с существующими тегами в документе, по классике пользоваться модулями нет желания 15:34
nine nnms: Good afternoon, could you repeat your question in English? I'm not sure anyone on the channel speaks Russian. 15:40
timotimo google translate does not help :( 15:43
RabidGravy (and even google translate doesn't help much)
timotimo nnms: is this a question about perl5 or perl6? 15:44
itz yeah I lost it at "sleeker soprostavit their existing tags" 15:44
nnms perl6
Sorry
Good afternoon, I have a list of tag names as better and sleeker soprostavit their existing tags in the document, use the modules on the classics is no desire
nine That's what Google translate produces :)
hoelzro soprostavit = juxtapose, I believe 15:45
nnms *
matching
hoelzro heh
thanks, Yandex!</sarcasm>
nnms :)
sub htmp(@html){ 15:46
my @tags = <article aside command datalist details figcaption figure footer header hgroup keygen main mark menu meter nav output progress rp rt ruby section source summary time video wbr>;
for @tags -> $cur {
if $cur in @html {
$cur.say;
};
}
}
colomon in? 15:47
hoelzro you have a list of tags, and you want to know how to intelligently match them with existing tags in a document?
virtualsue time for pastebin
nnms my $novitates = open 'ind.html';
my @shabl = $novitates.lines;
htmp(@shabl);
hoelzro and something about not wishing to use classic modules?
this is a reoccurring pattern with Russian and me; I'll understand 80% of the words by themselves, but not the sentence =/ 15:48
nine Well the code is pretty clear I'd say. Seems like what's wanted is a grep for HTML tags.
ugexe possibly a transliteration 15:49
nnms No, i dont need classic module, Unlearning my python programming :)
hoelzro nnms: "по классике пользоваться модулями нет желания" is the bit I don't understand =)
hoelzro "нет желания" I get (I think) 15:50
nnms yes
TimToady that would be a great book title: "Unlearning Python"
nnms :)
hoelzro maybe I'm misunderstanding the usage of по here?
regarding the actual problem, instead of my problems with the Russian language, you could probably do $cur eq any(@tags) 15:51
tony-o m: dd 15:52
camelia ( no output )
nnms in PL/pgSQL have EXCEPT, her return difference for any query 15:53
tony-o m: dd (1,2,3)
camelia rakudo-moar 9b4463: OUTPUT«(1, 2, 3)␤»
TimToady my $html = set(@html); for @tags -> $cur { $cur.say if $cur (elem) $html) } 15:53
we have set difference too 15:54
ShimmerFairy I think maybe say $_ for @html.grep(any(@tags)); would also do the trick?
tony-o m: $_.say for (1..5).grep(any(1,2)) 15:55
camelia rakudo-moar 9b4463: OUTPUT«1␤2␤»
phdphil Stupid question time: Given a string, how do I get a list of the characters in the string, or something I can iterate over/map with? 'abcde'.chars gives me a char count, which is pleasant... 15:56
TimToady .comb
nnms and that difference written to %hash tag_key: html_name
ugexe all($cur.words) ~~ any(@tags) if you are feeling frisky 15:57
tony-o m: $_.say for (a=>'b',c=>'d').keys.grep(any('a','e'))
camelia ( no output )
nnms Thank you Ж) 15:58
:)
RabidGravy phdphil, split will work too: 16:02
m: for "abcd".split("") { .say }
camelia rakudo-moar 9b4463: OUTPUT«a␤b␤c␤d␤»
timotimo better to use .comb() 16:04
RabidGravy oh yeah for sure, fewer characters to mistype for one :) 16:06
timotimo and it has the right default value for its parameter
RabidGravy or (in ant-golf ) 16:08
m: for "abcd".encode.list>>.chr { .say }
camelia rakudo-moar 9b4463: OUTPUT«a␤b␤c␤d␤»
phdphil Cool, thanks 16:10
timotimo what is this, a golf for ants!?
TimToady RabidGravy: that's a bit...ASCII-centric 16:11
TimToady m: for "°«»ª".encode.list>>.chr { .say } 16:13
camelia rakudo-moar 9b4463: OUTPUT«Â␤°␤Â␤«␤Â␤»␤Â␤ª␤»
TimToady m: for "Â".encode.list>>.chr { .say } 16:14
camelia rakudo-moar 9b4463: OUTPUT«Ã␤␤»
TimToady m: for "Ã".encode.list>>.chr { .say }
camelia rakudo-moar 9b4463: OUTPUT«Ã␤␤»
hoelzro is DESTROY NYI? 16:14
nine hoelzro: DESTROY is implemented 16:16
TimToady but it's not reliable in the sense that a P5 programmer would expect
hoelzro hmmm...I take it there's no guarantee on when it will run?
nine or even if 16:17
hoelzro nine: the "if" seems to be what I'm observing =) 16:18
hoelzro I figured that DESTROY would run on global VM shutdown, but I take it that's up to the VM? 16:18
RabidGravy TimToady, oh ok ;-) 16:22
m: for "ö™¥".encode("UTF-16").list>>.chr { .say }
camelia rakudo-moar 9b4463: OUTPUT«ö␤™␤¥␤»
TimToady a bit BMP-centric :) 16:23
timotimo moarvm does not run destroy on shutdown 16:24
TimToady m: for "🐼".encode("UTF-16").list>>.chr { .say } 16:25
camelia rakudo-moar 9b4463: OUTPUT«Error encoding UTF-8 string: could not encode codepoint 55357␤ in block <unit> at /tmp/Qys4x7DqiX:1␤␤»
TimToady m: for "\c[PANDA FACE]".encode("UTF-16").list>>.chr { .say } 16:26
camelia rakudo-moar 9b4463: OUTPUT«Error encoding UTF-8 string: could not encode codepoint 55357␤ in block <unit> at /tmp/Ko3SEHFLZX:1␤␤»
TimToady huh
m: say 55357.uniprop 16:27
camelia rakudo-moar 9b4463: OUTPUT«Cs␤»
TimToady m: say 55357.uniname
camelia rakudo-moar 9b4463: OUTPUT«<Non Private Use High Surrogate>␤»
TimToady ah
of course
TimToady obviously needs a 3rd cuppa
m: for "\c[PANDA FACE]".encode("UTF-32").list>>.chr { .say } 16:28
camelia rakudo-moar 9b4463: OUTPUT«Unknown string encoding: 'utf32'␤ in block <unit> at /tmp/_n1PVojWTQ:1␤␤»
TimToady that's probably some LHF 16:29
b2gills m: for 0, 0e0, 'a', 'a' { say $^a cmp $^b ~~ Same } # is there an operator for this? 16:41
camelia rakudo-moar 9b4463: OUTPUT«True␤True␤»
b2gills m: for 0, 0e0, 'a', 'a' { say $^a eqv $^b }
camelia rakudo-moar 9b4463: OUTPUT«False␤True␤»
lucasb since there is "before" and "after", there could exist also a "same" :) 16:44
ugexe m: for 0, 0e0, 'a', 'a' { say $^a cmp $^b } 16:45
camelia rakudo-moar 9b4463: OUTPUT«Same␤Same␤»
ugexe m: for 0, 1e0, 'a', 'a' { say $^a cmp $^b }
camelia rakudo-moar 9b4463: OUTPUT«Less␤Same␤»
lucasb m: say (1 cmp 2, 'is', 4 cmp 3) 16:48
camelia rakudo-moar 9b4463: OUTPUT«Less is More␤»
ShimmerFairy m: for 0, 0e0, 'a', 'a' { say $^a ~~ $^b } 16:49
camelia rakudo-moar 9b4463: OUTPUT«True␤True␤»
ShimmerFairy What about smartmatch?
TimToady not symmetrical, if that's desired 16:50
TimToady m: .say for "00" ~~ 0, 0 ~~ "00" 16:50
camelia rakudo-moar 9b4463: OUTPUT«True␤False␤»
TimToady m: .say for "00" cmp 0, 0 cmp "00" 16:51
camelia rakudo-moar 9b4463: OUTPUT«More␤Less␤»
TimToady well, cmp between different types has never beed adequately nailed down, due to contradictory expectations 16:52
*been
ShimmerFairy cmp has always been interesting to me. I've never used it, except I think for C strings, where that's the only thing you have for testing string equality. 16:54
TimToady leg doesn't work? 17:01
ShimmerFairy TimToady: I mean in C/C++ land, sorry if that wasn't clear.
TimToady speaking of clear, we should rename undefine 17:02
since it doesn't always
nine Is 3 spec test files failing on current nom/moarvm to be expected?
TimToady I only got one failure 17:03
nine t/spec/S01-perl-5-integration/exception_handling.t t/spec/S17-lowlevel/lock.rakudo.moar and t/spec/S24-testing/line-numbers.t[3~
TimToady after a reconfig, I only fail line-numbers
lucasb Can I haz @a.clear and %h.clear ?
itz I was seeing t/spec/S32-io/IO-Socket-INET.t and t/spec/S32-io/IO-Socket-INET.t fail and was rebuilding 17:04
TimToady lucasb: why not?
ShimmerFairy isn't that just @a = Nil and so on? Or am I misremembering or unaware of recent changes?
lucasb :) 17:04
nine TimToady: I guess you don't have Inline::Perl5 installed?
TimToady nope
prolly otta 17:05
nine Then maybe t/spec/S01-perl-5-integration/exception_handling.t would fail for you, too leaving only t/spec/S17-lowlevel/lock.rakudo.moar which curiously passes when I run it single
TimToady and lock is a flapper anyway
itz errr and t/spec/S24-testing/line-numbers.t I mea 17:06
n
lucasb ShimmerFairy: yes, you are right. but now I think one should use Empty instead of Nil 17:07
but it always felt strange to me, because it seems to be overloading to assignment operator with an operation that is exactly the opposite of assignment: disassignment, or clearing its content 17:08
lucasb *to be overloading the assignment 17:09
TimToady currently we have: 17:09
./src/core/operators.pm:multi sub undefine(Mu \x) is rw { x = Nil }
./src/core/operators.pm:multi sub undefine(Array \x) is rw { x = Empty }
./src/core/operators.pm:multi sub undefine(Hash \x) is rw { x = Empty }
mj41 hoelzro: Hi, why 2015.05 registry.hub.docker.com/_/rakudo-s...gs/manage/ ? Newest rakudo * is 2015.06 :-). 17:11
hoelzro mj41: that's...a really question 17:11
hoelzro looks
ah, I labelled it wrong. =( 17:12
mj41: good catch, just opened to PR to fix it 17:13
mj41 hoelzro: super, thx 17:14
nine .tell lizmat github.com/rakudo/rakudo/pull/457 fixes use lib:from<Perl5> and spectests fine. 17:15
yoleaux nine: I'll pass your message to lizmat.
lucasb Anyway, my wish was that the operation "clear its content" was a method on the objects, such that [1,2,3].clear and {:a=>1,:b=>2}.clear would work. But I agree I don't understand all the details.
TimToady well, regardless of how it's implemented, I think we should s/undefine/clear/, because clarity 17:19
flussence I'd imagine $var.=WHAT would've done the same thing, but it's an error
TimToady that doesn't work to reset to default 17:20
if the default isn't WHAT, assuming WHAT worked, which it doesn't, because it's not a real method
flussence I guess having a .clear makes sense then 17:21
b2gills What idiot came up with SVGCaptcha what.thedailywtf.com/t/svgcaptcha/49747/77 svgcaptcha.com/ 17:43
tony-o b2gills: lol 17:45
gfldex b2gills: him: bitbucket.org/scriptoid 17:46
tony-o b2gills: the hamburger discussion is the most interesting part of that whole thread 17:51
b2gills Yes. ... Yes it is. 17:53
ugexe a government portal i use uses a captcha that is just 'type the following number: XXXXXX', where the number is literally in the html 17:54
tony-o thanks obama 17:54
TimToady m: my @a = 1,2,3; given @a -> $_ is rw { $_ = 42 }; say @a 18:00
camelia rakudo-moar 9b4463: OUTPUT«Cannot assign to an immutable value␤ in block <unit> at /tmp/LkfsDUMPJJ:1␤␤»
TimToady that looks kinda sorta like a bug, maybe 18:01
tony-o m: my @a = 1,2,3; given @a <-> $_ { $_ = 42; }; say @a; 18:02
camelia rakudo-moar 9b4463: OUTPUT«Cannot assign to an immutable value␤ in block <unit> at /tmp/fV2xa06_Rw:1␤␤»
nine ugexe: for a small website, this could actually work. Obscurity can really help
TimToady m: my @a = 1,2,3; given @a -> @x is rw { @x = 42 }; say @a 18:03
camelia rakudo-moar 9b4463: OUTPUT«42␤»
TimToady it works with an @ sigil
m: my @a = 1,2,3; given @a -> $_ is rw { @$_ = 42 }; say @a 18:04
camelia rakudo-moar 9b4463: OUTPUT«42␤»
TimToady that works too 18:05
TimToady I'm guessing assignment isn't delegating through the container, or some such 18:05
I'm not sure if that should actually dwim or not 18:06
assignment to a scalar vs assignment to an array is a rather fundamental distinction, down underneath 18:07
m: my @a = 1,2,3; given @a { @$_ = 42 }; say @a
camelia rakudo-moar 9b4463: OUTPUT«42␤»
TimToady and we don't enforce the readonly there, with the @$_ 18:08
jnthn TimToady: We case-analyze by sigil. 18:11
TimToady: And emit assignment code differently. For unsigilled cases we emit a runtime check.
TimToady: Since this is the first time that "cheat" got caught...I'm not too inclined to lose it ;) 18:12
tony-o m: my @a = 1,2,3; for @a <-> $_ { $_ = 42; }; say @a; 18:13
camelia rakudo-moar 9b4463: OUTPUT«42 42 42␤»
b2gills m: sub test ( *%_ ){ say %_ }; my %a = a => 0; test |%a, a => 1 # the |% always overwrites everything else 18:15
camelia rakudo-moar 9b4463: OUTPUT«a => 0␤»
lucasb m: sub f(*%_) { say %_ }; my %a = a=>1; f(|%a, a=>2, b=>3) 18:17
camelia rakudo-moar 9b4463: OUTPUT«a => 1, b => 3␤»
masak FROGGS++ # star 18:22
as we pass Christmas, will we stop advertising Rakudo Star as an "early adopter" distribution of Perl 6? 18:23
vendethiel FROGGS++ # star
masak also, in the release announcement, I think "Synopsis 9 and 11" should be "Synopses 9 and 11" :P 18:24
TimToady obviously, it will then become a late adopter distribution :) 18:25
masak "late-to-the-party adopter" distribution :)
hoelzro I was working on a NativeCall binding for Xapian, so I decided to chronicle the experience in screencast form for people to learn from: www.youtube.com/watch?v=kY9gfEn8T7I 18:52
Ulti nice video hoelzro++ 19:26
gtodd hopefully the p6doc server's design will have lots of those "affordances" everyone talked about a few years back 19:30
gtodd so that it can accidentally become a killer app ... 19:31
that everyone must have for their digital $THINGS ... p6doc-serve all the things! 19:34
itz_ another solution would be to use a faster serialisation solution than EVAL .. I believe there was talk of panda using one 19:48
DrForr Just a note for site authors - doc.perl6.org/type/Quoting%20Constructs doesn't exist (referenced from doc.perl6.org/language/terms 19:49
DrForr s/$/)/ 19:49
b2gills Is it a known problem that trying to print to an instance of Proc::Async stops the REPL? ( I would guess it closes STDIN )
timotimo yo hoelzro check this out for your audio track: auphonic.com/ 19:57
ab6tract o/ #perl6 19:59
I hope everyone is having a nice summer :) 20:00
m: class ε {}; role Greater[$n] { method near { $n }}; multi infix:«<»(Numeric:D $a, Greater $b) { $a == $b.near ?? True !! $a < $b.near }; multi infix:<+>(Numeric:D $n, ε:U $) { Greater[$n] }; say 5 < 5 + ε; say 5.00000001 < 5 + ε; # very cool example from Mouq
camelia rakudo-moar 9b4463: OUTPUT«True␤False␤»
timotimo i'm having a hot summer at the moment :)
nine DrForr: github.com/rakudo/rakudo/pull/457
ab6tract timotimo: Likewise :)
DrForr Ooo. /me looks in a moment. 20:01
ab6tract moritz: I'm returning to the topic of 'overlaps-with' . I'm currently implementing it as an object method.
Is that a sufficient way for handling the excludes-* infinima? 20:02
It seems like it might be a bit heavy for core 20:03
ab6tract hmm, and it has at least one small issue 20:04
flussence ooc: is the levenshtein sub in core accessible by user code? 20:06
DrForr Added my 2c to the matter. 20:07
timotimo it's not in the core setting, flussence 20:15
i don't think it's available to user code
flussence IWBNif there were a "use rakudo" for that and any other internal-but-generically-useful things, like there's a "use nqp" for low-level stuff. The internal json stuff could go behind that too, then. 20:19
ab6tract are WhateverCodes too heavy for core settings? 20:20
timotimo no, but WhateverCode is defined relatively late, isn't it? 20:22
oh, huh
tony-o timotimo: 114f here yesterday
timotimo at about like 4k
tony-o: i don't speak imperial
tony-o 45.5c
flussence m: say (114 - 32) * 9/5 20:23
camelia rakudo-moar 9b4463: OUTPUT«147.6␤»
flussence wait...
m: say (114 - 32) * 5/9
camelia rakudo-moar 9b4463: OUTPUT«45.555556␤»
flussence that's the one
...and wow
tony-o had a couple 44c days last week
timotimo oh lord, 45 degrees
we have between 35 and 40 here
that's already terrible enough 20:24
don't want to imagine what 45 feels like
flussence it's only been in the 20s here, and I find *that* uncomfortable :(
tony-o 35 days feel good here now, after the 44-45
flussence: that used to be me too, when i lived somewhere that people knew what snow was 20:25
when it's 20s here people have the big puffy coats on 20:26
RabidGravy I like low to mid-30s but not in London 20:31
RabidGravy Rarely gets that hot here without getting humid 20:33
hoelzro timotimo: ah, thanks
I did what I could to take off some of the noise =/ 20:34
but my Audacity skills are not very good
dalek kudo/nom: 19526f1 | (Stefan Seifert)++ | src/core/CompUnitRepo.pm:
Obey use :from even when a similar named Perl 6 module is installed in a CUR

There's no need to even look for a Perl 6 module in CompUnitRepo when there's a :from adverb present. So don't do that and let the Perl6ModuleLoader handle the case straight away.
Fixes for example use lib:from<Perl5>
20:38
kudo/nom: a25b55a | lizmat++ | src/core/CompUnitRepo.pm:
Merge pull request #457 from niner/nom

Obey use :from even when a similar named Perl 6 module is installed i…
dalek kudo/nom: 9e4f8bd | (Nick Logan)++ | src/core/CompUnit.pm:
bugfix: `.precomp` returning Failure erroneously

On JVM the pipe must be closed after reading but before the status is checked for `.precomp` to return a true value.
side note: It would seem `process.waitFor()` does not close the channel, as if it never finishes reading the buffer.
20:42
kudo/nom: c93ba94 | lizmat++ | src/core/CompUnit.pm:
Merge pull request #458 from ugexe/patch-6

bugfix: `.precomp` returning Failure erroneously
timotimo thank you, ugexe 20:47
timotimo hoelzro: i have a pretty nice microphone available, but i'm sort of too shy to put my voice (and especially the accent) on the 'net 20:48
hoelzro: also i'm not sure what i'd screencast about
hoelzro timotimo: I think you could screencast about a lot! 20:49
timotimo alot is a great topic :)
hoelzro anything that helps people learn Perl 6 would likely help
I don't think I have a particularly good screencasting voice; I kinda mumble a lot =/
timotimo right, i've considered a tutorial series starting from knowing very little about p6 to ... whatever
mumble? i didn't notice that
hoelzro I had to record a few times to get it right =P 20:51
timotimo: I was thinking the same thing - I decided to just start recording things I'm working on 20:52
next up will be parsing Xapian class definitions to auto-generate the code I wrote in that video
timotimo mhm :)
jnthn has considered doing screencasts sometimes, but has so much to do already... ;)
hoelzro jnthn: I think that would be great, but you have a lot of things on your plate
leave it to the mortals =P 20:53
RabidGravy I've been nagged to do a show for the radio station I work with for a year and a half, but it wouldn't be about programming
hoelzro I really want to help make good learning materials
RabidGravy: maybe you could lend your voice then =)
tony-o what are the tutorials on angularjs on? those were a pretty cool way to teach folks 20:54
hoelzro tony-o: good idea; I think that that crowd had a pretty good handle on tutorials for people 20:55
tony-o the platform was cool, but the way the tutorial guided you through "here is a problem, here are the tools you need to solve it, try it out" was well thought out i think 20:58
tony-o i think angular's example was setting up an online heroin store or something 20:58
perl would be a little more difficult because its not just a web framework designed to make trmplating (or whatever) easy, but that development flow could work the same 20:59
just need a wider variety of problems to solve 21:00
ab6tract tony-o: an online camel marketplace?
ab6tract but more seriously, I've been imagining an 'interactive-fiction-inside-and-about-the-repl' 21:02
timotimo i'd love to figure out what in CALL-ME of NativeCall is allocating Scalar objects 21:05
it's using := almost everywhere
masak ab6tract: that's a new form of metacircularity :)
lizmat ShimmerFairy: re irclog.perlgeek.de/perl6/2015-07-02#i_10838803 , it's because the .WHICH of [2,3] and [2,3] are not the same 21:10
yoleaux 17:15Z <nine> lizmat: github.com/rakudo/rakudo/pull/457 fixes use lib:from<Perl5> and spectests fine.
lizmat m: say [2,3].WHICH; say [2.3].WHICH
camelia rakudo-moar 9b4463: OUTPUT«Array|60893496␤Array|60893568␤»
lizmat if you make it parcels, it does DWIM: 21:11
m: my @a = $(1,2),$(2,3); my @b = $(2,3),$(3,4); say (@a (&) @b).perl
camelia rakudo-moar 9b4463: OUTPUT«set($(2, 3))␤»
hoelzro m: my $method = 'do-stuff'; say q:scalar"say $method()" 21:18
camelia rakudo-moar 9b4463: OUTPUT«Cannot find method 'postcircumfix:<( )>'␤ in block <unit> at /tmp/qALVtUldbP:1␤␤»
hoelzro ^ does :scalar activate method call interpolation as well as just plain ol' scalar interpolation? 21:18
jnthn yeah
There's no adverb that controls the postcircumfix interpolation...
hoelzro =( 21:19
jnthn In part 'cus that's parsed back in the main language 21:20
And the adverbs control the quote language's ability to delegate to the main language.
well, decision rather than ability 21:21
ab6tract masak: I'm always on the lookout for another metalevel ;) 21:23
vendethiel *g*
ab6tract has there ever been consideration for the inclusion of Epsilon in core setting? 21:25
we have sort of introduced it in ad absentia, via 5^..^6 21:30
masak I'm not sure Epsilon is... a thing
lizmat lucasb: re irclog.perlgeek.de/perl6/2015-07-02#i_10840839 , you can haz 'undefine @a' 21:31
which is "short" for @a = Empty (at least at the moment, not sure why it is Empty rather than () really) 21:32
oops, it already got answered... it's too hot... 21:33
timotimo i have a "benchmark" that i've built as a very rough approximation of what i can do with an idea i have ... and i can get it to about 6 FPS and it doesn't even contain the computation for what i want to do with it >_> 21:35
top three methods by exclusive time are bind_one_param, bind and find_best_dispatchee
lizmat TimToady: re irclog.perlgeek.de/perl6/2015-07-02#i_10840951 s/undefine/clear/, shouldn't that be .CLEAR and CLEAR to make collisions with ecosystem code less likely? 21:37
timotimo after that comes roll, because i'm currently generating random data all the time ... taking that out makes it a whole lot faster
removing the calls to roll give me a much, much better FPS 21:38
lizmat you're rolling on a List ?
timotimo a Range in this case 21:39
(^255).pick
lizmat ^255?? not ^256 ?
timotimo er, yeah 21:40
but that doesn't matter :)
lizmat and you only pick one?
timotimo oh wow 21:41
lizmat then you're better off doing .roll
timotimo moving the ^256 into a variable on its own and just calling .pick over and over gives 2x the performance
lizmat as Range.pick just refers to Range.roll
yup, building a Range object is expensive
timotimo i was expecting that to be done at optimizer time
lizmat are you picking one? then use .roll 21:42
timotimo curiously .pick seems to be faster :P
i'm at 21fps now :) 21:43
ab6tract masak: Is it not possible to do have sometging like 5 < 5 + AbstractInfinumMarker.new < 5.001 ?
timotimo now i've put in access to the array that's going to hold my data and it's at 3 seconds per frame 21:44
masak ab6tract: oh, I think you'd be able to design and implement a number class that worked like that, in module space.
ab6tract or better yet, just the type, without instantiation.. AbstractInfinumMarkerType ;P
lizmat timotimo: use nqp; say nqp::rand_I(nqp::decont(256), Int) 21:45
masak ab6tract: I'm not as sure that I see a fantastic use case for it.
timotimo ouch. the performance difference between @a[$x;$y] and @a[$x][$y] is *staggering*
masak ab6tract: you're basically proposing introducing nonstandard analysis into Perl 6 :)
lizmat yeah, I'm not surprised
ab6tract masak: more or less :) 21:46
masak yeah.
I prefer IEEE 754 :)
lizmat TimToady: re undefine/clear I'm not sure we need either, now that we have Nil / Empty 21:48
ab6tract But really, it does feel weird to me that $range.min returns something that you can't effectively use in a numeric comparison
and it makes implementing 'overlaps-with' a brain twister, to say the least :)
I also note that .pick and .roll bothe use: my $least = $!excludes-min ?? 1+ $!min !! $!min; 21:49
lizmat ab6tract: fwiw, I tihink Range has too much functionality overloaded onto it 21:50
that's why I once started work on a RangeInt class
ab6tract I can agree with that
lizmat but that was considered to be a bad idea
:-(
ab6tract I can see that point as well :) 21:52
timotimo Type check failed in binding <anon>; expected 'Any' but got 'Int' 21:56
how did i even ...
masak m: say Int ~~ Any 21:56
camelia rakudo-moar c93ba9: OUTPUT«True␤»
ab6tract_ If I can get (6^..7).overlaps-with(6) to return False, I will be well-pleased by Range, I think
the rest of it is pretty cool, though I, like timotimo, would sort of expect things like (^256) to be optimized out of the way 21:58
timotimo well, the optimizer can't get away with just using a constant Range object at that point; it'd still have to .clone 21:59
... it's possible that that's actually what it does right now and that still takes somewhat long
lizmat timotimo: ^255 is just Range.new(0,255,:excludes-max) as per "sub prefix:<^>($max) { Range.new(0, $max.Numeric, :excludes-max) } 22:06
so I don't think it is optimized in any way atm? 22:07
timotimo there's no "is pure" there? 22:09
lizmat no
should there be?
only infix:<^..^>($min, $max) is pure has it
timotimo it'd make sense to put "is pure" on all of those 22:10
lizmat remind me again what that means exactly ?
(testing is pure on all of them) 22:11
timotimo that the optimizer is free to assume the result of the operator doesn't depend on external factors like IO etc 22:13
lizmat I guess S99:pure
synbot6 Link: design.perl6.org/S99.html#pure
timotimo so it's allowed to run that code at compile time if the arguments are all known
right 22:14
dalek ecs: ace089e | lizmat++ | S99-glossary.pod:
Fix typo
timotimo gist.github.com/timo/5129c1f3de2f793d98b6 ← you can run this if you have SDL2::Raw installed and twiddle with the performance if you want
m: if True 22:15
camelia rakudo-moar c93ba9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_iq3tlmuhl␤Missing block␤at /tmp/_iq3tlmuhl:1␤------> 3if True7⏏5<EOL>␤ expecting any of:␤ block or pointy block␤»
timotimo m: my $foo; if True { $foo++ if ^5.pick == 1 }
camelia ( no output )
timotimo m: my $foo; if True { $foo++ if ^5.pick == 1 }
camelia ( no output )
timotimo m: my $foo; if True { $foo++ if ^5.pick == 1 }
camelia ( no output )
timotimo m: my $foo; if True { $foo++ if ^100.pick == 1 }; say "test"
camelia rakudo-moar c93ba9: OUTPUT«test␤»
timotimo m: my $foo; if True { $foo++ if ^100.pick == 1 }; say "test"
camelia rakudo-moar c93ba9: OUTPUT«test␤»
timotimo :\
there's a "0;" in that gist; when i removed that, the sink method of Nil threw a bogus binding error 22:16
"Type check failed in binding <anon>; expected 'Any' but got 'Int'"
dalek kudo/nom: a32c1d3 | lizmat++ | src/core/Range.pm:
Make .. ^.. ..^ ^ also "is pure", timotimo++
22:17
lizmat timotimo: feels to me [email@hidden.address] $b + 1, -1));" in a pretty hot code path could be optimisable at this point of rakudo development 22:20
timotimo could be 22:21
i had it as two junctions before that
lizmat especially the first (which returns a lazy list)
I don't have SDL2::Raw installed
so that's is as much feedback I can give you
masak 'night, #perl6 22:22
lizmat ah, and maybe precalculating x+1, y+1, y - 1? 22:22
good night, masak
lizmat also wishes #perl6 a good night 22:23
timotimo gnite lizmat :)
ah, that precalculation isn't too bad an idea
timotimo feels a tiny bit faster already ;) 22:26
also not using --profile makes it a bit faster, too
oh, that's nice. CALL-ME from NativeCall is now the top routine in terms of exclusive time 22:27
roll is 4th place with just 6% exclusive time 22:28
ha! 22:29
i got a much faster version now
lizmat m: use nqp; say nqp::rand_I(nqp::decont(256), Int) # timotimo, perhaps better than .roll ?
camelia rakudo-moar c93ba9: OUTPUT«181␤»
jnthn I'm guessing rand(256) does the same? 22:30
timotimo lizmat: i used Inf instead of -1 for the fallback value and now i can use .min instead of .first(...)
jnthn A little administrative update: 6guts.wordpress.com/2015/07/02/gra...us-update/
lizmat m: rand(256) 22:31
camelia rakudo-moar c93ba9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YQr9InRTVb␤Unsupported use of rand(N); in Perl 6 please use N.rand for Num or (^N).pick for Int result␤at /tmp/YQr9InRTVb:1␤------> 3rand7⏏5(256)␤»
jnthn d'oh
lizmat jnthn: so that would be 256.rand
m: say 256.rand
camelia rakudo-moar c93ba9: OUTPUT«88.373623134515␤»
jnthn Yeah, and you don't get an Int
lizmat yup
jnthn I'd hope we can optimize no-arg (^256).pick pretty well though 22:32
lizmat yeah, to: nqp::rand_I(nqp::decont(256), Int) :-)
timotimo 20% of time now spent in CALL-ME of NativeCall
lizmat really off to bed& 22:33
timotimo i need to find another sponsor for jnthn's grant work %)
jnthn 'night, lizmat 22:35
ab6tract_ hmm... 22:41
m: sub o( $r, $s ) { $r.min ~~ $s or $s.min ~~ $r }; o((0..6), (6^..12)).say; o((12^..^23), (23..44)).say; o((23..44), (42..64)).say;
camelia rakudo-moar c93ba9: OUTPUT«True␤False␤True␤»
ab6tract_ it's late, there's a real chance that I am missing an obvious corner case 22:42
ab6tract_ or... is that a working implementation for 'overlaps-with' ? 22:42
ab6tract_ nope, found at least one problem 22:46
timotimo the script i linked to is actually leaking :( 22:55
jnthn Time for some rest...should get lots more work in on the multi-dim arrays tomorrow :) 23:01
o/
timotimo hooray! 23:07
having that feature done by the end of the month will greatly impact the script i've got here right now, too
TimToady timotimo: ^100.pick is wrong precedence
unless you meant ^(100.pick) 23:08
which I tend to doubt
dha I note that "item context" is mentioned in the 5to6 doc under "Refrerence Creation", but I don't see where it's explained what item context *is*. 23:11
timotimo i meant to write (^100).pick 23:13
i have that in my code, don't i? 23:14
timotimo i kind of wish the profiler could measure how many instances of what class end up dying young and how many end up dying in the old generation and how many stick around until the program ends 23:20
it may be enough to just see how many of each die young
timotimo but i think the profiler only knows what exact type object got allocated because the type object was available at the exact position the "log this allocation" op was emitted in the first place 23:21
i suppose some sort of tracking could be put in and after every collection, all registered objects could be checked for their status 23:34
ab6tract_ ok, I may have finally cracked the nut 23:47
just in time to get some snooooze
o/ #perl6
dha Question: The docs say that C<//> returns the first defined operand. But that seems to me inaccurate. 23:49
m: say Any // 5
camelia rakudo-moar a32c1d: OUTPUT«5␤»
dha m: say Any // Any
camelia rakudo-moar a32c1d: OUTPUT«(Any)␤»
dha ... in that it's returning the last operand, despite it being undefined.
Is that, in fact, inaccurate, or am I misunderstanding? 23:50
raiph dha: S03:1411 23:58
synbot6 Link: design.perl6.org/S03.html#line_1411
dha Ah. In the operators page in docs.perl6.org, it says differently. will patch. 23:59
Kind of figured that, but wanted to make sure that was the desired semantics before changing the docs.