»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
TimToady btw, the parens on the left of .. are superstitious 00:00
+ is tighter than ..
timotimo segmentation faults should not happen, that is a bug in moarvm 00:01
lambd0x TimToady: ahahah I know. It's a bad habit that I'm trying to give up. 00:02
timotimo wow i totally missed that ticket being created
can you try it with the environment variable "MVM_SPESH_DISABLE=yes" set?
lambd0x TimToady: So this is really a moar's bug :( 00:03
TimToady well, could be, that's why you wanna try what timotimo suggested
timotimo if that makes the problem go away, please also test with MVM_SPESH_INLINE_DISABLE=yes instead, too 00:04
lambd0x timotimo: I'll, just a sec. Am generating large input files for testing... 00:06
timotimo thanks 00:07
though a spesh optimization would more likely have eliminated the corece_istrue call and turned it into something entirely different
but ..^ vs ^..^ sounds more like one of them is being inlined and the other isn't, or something like that
timotimo i need sleep real soon 00:18
lambd0x timotimo: Sleep then. Last time I ran bubble with 5K input it took 15 minutes. When I get the results I'll notify u so that later u can review it :) via pastebin 00:21
timotimo might be an interesting candidate to profile
lambd0x profile? 00:22
timotimo yeah, use a profiler to measure which parts take how much time
makes it a bit slower, though
lambd0x timotimo: :)
timotimo there's perl6 --profile, which gives you a html "app" that you can inspect the results with 00:25
there's "perf" on linux which is a probabilistic profiler (which means it's extremely fast, but not precise)
and there's callgrind, which makes your code run a whole lot slower, but gives excellent precision in the results - inspect the results with kcachegrind 00:26
but perl6 --profile gives you data about perl6 routines and perf and callgrind give you data about moarvm's C functions
lambd0x timotimo: perl6 --profile code.pl6? 00:27
timotimo yes 00:28
if the vm crashes, there will not be any profile data
so better use a smaller file with --profile
lambd0x timotimo: nice 00:30
TimToady well, if you're profiling to make it faster, use something other than bubblesort
timotimo could be something in rakudo or moar is causing more slowdown than is warranted 00:31
TimToady bubblesort almost causes more slowdown than is warranted :) 00:33
unless you're usually sorting less than 5 items
timotimo or if the list is already mostly sorted 00:34
TimToady in which case you probably want merge sort anyway
lambd0x timotimo: even if the list is mostly sorted it will check all the n els. so it's still slow :( 00:35
timotimo you can't get faster than o(n) :)
but maybe there's a vectorized CISC instruction on your CPU that can check if a packed buffer of numbers is already sorted in some order you ask for 00:36
TimToady sure you can, if you have a bit saying it's already sorted, that's O(1) :)
timotimo oh, that's true
that bit better tell the truth
rakudo and moarvm mostly work with "never trust anything another part of the program already figured out" at the moment
though moarvm is much, much better at using info gathered from elsewhere than parrot for example was 00:37
gotta go!
lambd0x timotimo: o/
InsertionSort is nice for small almost/sorted lists. Better if the range is lower would be counting. Or if the range is larger bucket :) 00:41
lambd0x timotimo: using MVM_SPESH_DISABLE=yes and later, MVM_SPESH_INLINE_DISABLE=yes. For each case, the codes runs ok 00:59
dalek osystem: 97b164a | (Adrian Kreher)++ | META.list:
Add Binary::Structured to ecosystem
02:23
dalek c: 57ab2de | titsuki++ | doc/Type/Str.pod6:
Add an example for multi method comb(Str:D :)
02:45
c: 71be272 | titsuki++ | doc/Type/Str.pod6:
Merge pull request #881 from titsuki/fix-str-comb

Add an example for multi method comb(Str:D :)
avuserow wrote a module (Binary::Structured) and put it in the ecosystem :) ^^^^ 02:56
Zoffix avuserow++ awesome 04:18
yoleaux 3 Sep 2016 19:25Z <avuserow> Zoffix: I had no intention of doing anything with roast. not sure how that could've happened. thanks for cleaning up :)
Zoffix titsuki, are you sure your PR fixes anything? From what I can see, the change is a no-op.
Zoffix m: say 'wat1' unless 1 && 1; say 'wat2' unless 1 && 0; say 'wat2' unless 0 && 1; say 'wat3' unless 0 && 0; say 'wat4' unless (1 && 1); say 'wat5' unless (1 && 0); say 'wat6' unless (0 && 1); say 'wat7' unless (0 && 0); 04:19
camelia rakudo-moar aceb4a: OUTPUT«wat2␤wat2␤wat3␤wat5␤wat6␤wat7␤»
Zoffix m: (10.."15").rand.say 04:21
camelia rakudo-moar aceb4a: OUTPUT«14.2121762763123␤»
Zoffix s: (10.."15"), "rand", \()
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/aceb...ge.pm#L613
Zoffix 0.o not found? 04:22
Looks like commit short-sha is not enough to uniquely identify the commit. This works github.com/rakudo/rakudo/blob/aceb...ge.pm#L613 04:23
m: (10.."15").max.^name.say 04:28
camelia rakudo-moar aceb4a: OUTPUT«Int␤»
Zoffix titsuki, ^ that's the issue. It appears to get coerced before ever reaching .rand
Zoffix doesn't see where 04:29
titsuki hi
Zoffix m: use MONKEY-GUTS; class Foo { has $.min; has $.max; multi method new (Real \min, Real() $max) {}; multi method new(\min, \max) { nqp::create(self)!SET-SELF(min, max) }; method !SET-SELF ($!min, $!max) {self} }; my $r = Foo.new: 10, "15"; dd $r.max 04:34
camelia rakudo-moar aceb4a: OUTPUT«-Inf␤»
Zoffix m: use MONKEY-GUTS; class Foo { has $.min; has $.max; multi method new(\min, \max) { nqp::create(self)!SET-SELF(min, max) }; method !SET-SELF ($!min, $!max) {self} }; my $r = Foo.new: 10, "15"; dd $r.max
camelia rakudo-moar aceb4a: OUTPUT«"15"␤»
Zoffix weird no? :)
titsuki m: ("10"..15).rand.say
camelia rakudo-moar aceb4a: OUTPUT«Can only get a random value on Real values, did you mean .pick?␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
titsuki zoffix: then why it recognize first argument as a Str ? 04:35
Zoffix m: use MONKEY-GUTS; class Foo { has $.min; has $.max; multi method new(\min, \max) { nqp::create(self)!SET-SELF(min, max) }; method !SET-SELF ($!min, $!max) {self} }; my $r = Foo.new: "15", 10; dd $r.min
camelia rakudo-moar aceb4a: OUTPUT«"15"␤»
Zoffix m: use MONKEY-GUTS; class Foo { has $.min; has $.max; multi method new (Real \min, Real() $max) {}; multi method new(\min, \max) { nqp::create(self)!SET-SELF(min, max) }; method !SET-SELF ($!min, $!max) {self} }; my $r = Foo.new: "15", 10; dd $r.min
camelia rakudo-moar aceb4a: OUTPUT«"15"␤»
Zoffix titsuki, because it's not affected by the bug
Looks like the coersion in one of the multies is messing up the arg 04:36
m: dd (10.."15").max
camelia rakudo-moar aceb4a: OUTPUT«15␤»
Zoffix Though I wonder why here I get an Int but in my version I get a -Inf 04:37
titsuki m: say 'wat1' unless True && True; say 'wat2' unless True && False; say 'wat2' unless False && True; say 'wat3' unless False && False; say 'wat4' unless (True && True); say 'wat5' unless (True && False); say 'wat6' unless (False && True); say 'wat7' unless (False && False); 04:50
camelia rakudo-moar aceb4a: OUTPUT«wat2␤wat2␤wat3␤wat5␤wat6␤wat7␤»
Zoffix unless 1 && 1 is same as unless 1 and 1 is same as unless (1 && 1) is same as unless (1 and 1) 04:52
If I comment out the `multi method new(Real \min, Real() $max, :$excludes-min, :$excludes-max)` then .rand craps out properly. 04:53
m: gist.github.com/zoffixznet/8ff9ec5...ca064ddba7 04:54
camelia rakudo-moar aceb4a: OUTPUT«["15", "Str"]␤Can only get a random value on Real values, did you mean .pick?␤ in method rand at <tmp> line 78␤ in block <unit> at <tmp> line 114␤␤Actually thrown at:␤ in block <unit> at <tmp> line 114␤␤»
Zoffix m: say 42 ~~ Real 04:58
camelia rakudo-moar aceb4a: OUTPUT«True␤»
Zoffix Oh, duuuh... There's no bug!
Zoffix titsuki, basically what's happening is the range is created via this multi that coerces the Str max into an Int: github.com/rakudo/rakudo/blob/aceb...nge.pm#L51 05:00
titsuki zoffix: thanks. I totally misunderstood "unless True && False" behavior...
Zoffix titsuki, you can try removing the coercion and running the spectest to see if anything explodes. Maybe it's not needed there, but I'm unfamilar with the reasons why the end point gets coercion treatment, while there's no case to do the same for the starting point 05:01
So basically change the Real() to just plain Real in the signature 05:02
And if I do it on my small test code, then .rand does error out properly
titsuki zoffix: ok I understand. 05:04
Zoffix m: use MONKEY-GUTS; class Foo { has $.min; has $.max; multi method new (Real \zmin, Real() $zmax) {}; }; my $r = Foo.new: 10, "15"; dd $r.max 05:10
camelia rakudo-moar aceb4a: OUTPUT«-Inf␤»
Zoffix I don't get why that ends up being a -Inf tho.
m: use MONKEY-GUTS; class Foo { has $.min; has $.max; multi method new (Real \zmin, Real() $zmax) {}; }; my $r = Foo.new: 10, "15"; dd $r 05:13
camelia rakudo-moar aceb4a: OUTPUT«Any $r = Any␤»
Zoffix Ahh.. there's no self returned, so you get an Any type object, so the core .max get called that returns a -Inf
titsuki m:StrDistance.new(:before("123"),:after(123)).Int.say 05:36
m: StrDistance.new(:before("123"),:after(123)).Int.say
camelia rakudo-moar aceb4a: OUTPUT«Type check failed in assignment to $!after; expected Str but got Int (123)␤ in block <unit> at <tmp> line 1␤␤»
titsuki m: StrDistance.new(:before(123),:after("123")).Int.say 05:37
camelia rakudo-moar aceb4a: OUTPUT«0␤»
titsuki Is this a bug ? It seems similar to the above Range's one. github.com/rakudo/rakudo/blob/nom/...ance.pm#L6 05:41
BenGoldberg m: StrDistance.new(:before("123"),:after("123")).Int.say 06:00
camelia rakudo-moar aceb4a: OUTPUT«0␤»
grondilu isn't there any module for bindings to a NoSQL database? 06:49
like MongoDB, BerkeleyDB or something like that?
or Storable? 06:51
titsuki groudilu: We have a binder for CouchDB github.com/jonathanstowe/Sofa
grondilu lol, best name for a module ever 06:52
grondilu why isn't it on modules.perl6.org? 06:54
raiph grondilu: mebbe github.com/MARTIMM/mongo-perl6-driver?
yoleaux 18 Aug 2016 12:58Z <AlexDaniel> raiph: I don't remember any big discussion on that topic, so I'd say that it is a consensus of a small bunch of people who care about it. However, don't take my word on it and judge yourself, here is how the logic goes:
18 Aug 2016 13:03Z <AlexDaniel> raiph: while $^onearg and $^otherarg might look very readable, it is pretty hard to tell which one comes first in the signature. Are you sure that readability is worth the extra mental step which requires the reader to sort the variable names alphabetically (…unicodically?) in his mind? If that does not sound very convincing, think about one of those times when variables are renamed during refactoring
18 Aug 2016 13:06Z <AlexDaniel> raiph: and no, $^k and $^v is not any better than $^key and $^value. Call me stupid, but I don't know which one comes first off the top of my head. I'd say that $^a $^b $^c are better.
18 Aug 2016 13:43Z <AlexDaniel> raiph: also feel free to read this discussion: irclog.perlgeek.de/perl6/2016-08-18#i_13046240
titsuki grondilu: Sorry, I'm not sure. I can't find here github.com/perl6/ecosystem/blob/ma.../META.list 06:57
dalek c: 6153feb | (Jan-Olof Hendig)++ | doc/Language/io.pod6:
Fixed some code example indentation problems
08:53
lambd0x Hi everyone! 09:44
azawawi hi 10:01
lizmat: ping
lizmat pong 10:02
azawawi lizmat: re github.com/perl6/gtk-simple/commit...t-18892601
lizmat: do you have an example/documentation for "platforms"?
lizmat no, but the contents of the resources directory is entirely up to the developer 10:03
azawawi true but panda tries to copy files in %?RESOURCES and fails on non-windows... that's why empty files 10:04
if i remember correctly that's the workaround github.com/perl6/gtk-simple/commit...9528904976 10:05
lizmat ok 10:08
I was just triggered by the "design issue" of %?RESOURCES
this feels more like a panda design issue :-)
azawawi yeah
that previous comment also triggered my involvement which triggered yours :) 10:09
stmuk oddly I was just experimenting with %?RESOURCES and panda 10:10
stmuk it doesn't seem to work :) 10:11
lambd0x Is it normal for rakudo do give errors when comparing scalar integers with integers nums let's say a given index? bpaste.net/show/d6cd073895ae 10:13
*to...
azawawi lizmat: i was thinking we should have something likes "resources-by-platform": {"osx": [...], "win32": [...], ...]
lizmat: s/likes/like/
lizmat sounds like a plan to me :-) 10:14
azawawi lizmat++ 10:15
finanalyst Is there a link on how to connect TCP socket to GUI widgets? I have a TCP server socket, but it needs to wait for a client. Once connected, incoming data goes to a widget. Can't quite work out how to set up the initialisations so that the GUI is up before the first incoming request is made 13:21
timotimo many ways to handle this 13:26
for example, you can hold the data in a queue while the GUI comes up, and when the GUI gets initialized, you drain the queue
timotimo you can also make incoming connections wait until the GUI is initialized, perhaps it's enough to just schedule that task on the GTK::Simple::Scheduler (if GTK is what you're using) 13:27
timotimo here's a thing that perl6 has over python that i hadn't even thought about at all 13:30
timotimo python has this terrible hack of r"foobar" strings for "when you want to type out a regular expression" 13:30
a friend of mine just complained loudly about how terrible it is to use regular "foo" strings with the re module, and how confusing escaping stuff gets 13:31
finanalyst timotimo: thanx for response. I know it's something simple. But I can't quite work out the syntax. I'm confused by the Supply, react, tap etc 13:32
timotimo any particular question i could try to help with? 13:33
finanalyst how to hold data in a queue while the GUI comes up? I mean the perl6 coding
timotimo just have a list and push the events into it 13:34
finanalyst ok. just making a pastebin of some code I have that doesnt quite work 13:36
timotimo OK 13:37
finanalyst timotimo: pastebin.com/Kj822mMn 13:39
timotimo that's a very bad idea, you're accessing widgets from a separate thread. GTK will have your head on a stick for that
finanalyst oh? 13:40
timotimo hm, actually
maybe it will run on the GTK thread when you're directly tapping a GTK event
timotimo also, a react block will block, so your second react block will never run in this code 13:40
(since you never leave the first react block)
finanalyst that whats happening. 13:41
1st react block unwinds when I connect in from outside. But I can only send one string
timotimo "unwinds"? 13:42
finanalyst When I run the program, nothing happens til I connect (first block makes a connection), then I send data, which the second block processes, then the GUI goes up 13:43
timotimo anyway, the socket will definitely run on the separate moarvm event loop thread, so you'll be changing gtk widgets from that in your first react block, and also your second react block
finanalyst I can send data from the perl6 server to the client, but not from the client to the server
timotimo i don't see the rest of your app. where are you doing $app.exec or $app.run or what it's called?
finanalyst I do the $app.run at the very end of the code 13:44
timotimo well, there's your problem
timotimo $app.run is what makes the gui appear 13:44
finanalyst I can see that. But how to set up the TCP thread before the GUI starts? 13:45
timotimo you're already doing that 13:46
finanalyst Obviously I am using 'react' in an inappropriate wat
way
timotimo yup
you need to give each react block its own thread if you want to use react
i'm surprised the blocks even exit at all and you get to see your GUI 13:47
finanalyst I dont want 'react'. I just saw that in a module for a HTTP server react was used
timotimo maybe some exception happens inside your react block and we don't properly show it?
well, then just tap $listen.accept and $conn.recv 13:48
finanalyst The react block seems to execute all the way.
finanalyst As in $listen.accept.tap( -> $b { <statements> }); ? 13:50
timotimo yup
finanalyst oh!
timotimo it's also recommended to make sure changes to the GUI get .start'ed on the GTK::Simple::Scheduler
finanalyst Why use Scheduler? Haven't looked at that module yet? 13:52
timotimo because it makes sure that your code gets run on GTK's thread 13:53
did you see jnthn's "code golf helper"?
finanalyst no. where is it?
timotimo github.com/jnthn/perl6-reactive-sa...-helper.p6 13:54
finanalyst thanks. this has given me some clues.
timotimo :) 13:56
timotimo those samples were written before "react" and "whenever" were made. maybe jnthn would have done it differently after that 13:56
pierre_ Hi all 14:15
i have one question about a module to upload on github
my travis configuration, similar to previous ones i used is now complaining to install panda
rakudobrew build-panda 14:16
give me an error about non specified version
On some other repo, i have seen
- rakudobrew build-panda ${TRAVIS_PERL6_VERSION#latest}
is this the correct command to specify the version for rakudobrew ? 14:17
timotimo i didn't know you had to give a version for build-panda 14:18
pierre_ First time i see taht
travis-ci.org/pierre-vigier/Perl6-...essagePack
i check some module on modules.perl6.org/ that passed their tests today 14:19
and i saw that version thing
github.com/MARTIMM/Auth-SCRAM/blob...travis.yml
timotimo well, the error we see in Data-Messagepack is from not bumping the NQP dependency version 14:20
that ought to be fixed in a minute or two
pierre_ hum, i have the same error there 14:22
travis-ci.org/pierre-vigier/Perl6-.../157450988
=> The command "rakudobrew build-panda" failed and exited with 1 during . 14:23
indeed, that does not solve teh issue :)
timotimo the fix for compiling perl6 just got committed 14:24
pierre_ oh, i misunderstood then
pierre_ i have a question also on module release, in Data::MessagePack, i have public module, and 2 modules within the namespaces, that are not designed to be called directly 14:27
in my META
should i include only one module, or the 3 of them ?
timotimo as far as i know, you can't "use" a module if it isn't "provides"ed 14:29
pierre_ ok, i'll include all of them then 14:30
anyway, there should be no harm in that
still need improvement before adding it to the ecosystem 14:31
timotimo that's fair :) 14:33
have you tried poking travis so it rebuilds your code with the new fixed rakudo?
pierre_ i am rebuilding on the second modules i had an issue 14:33
not finished
but it seems ok now
installing dependencies
timotimo great
pierre_ travis-ci.org/pierre-vigier/Perl6-Acme-Sudoku 14:34
perfect, Thank you!
i'm playing with supply and asynchronicity for Data::messagePack, to handle streaming MessagePack 14:35
masak greetings, #perl6 14:39
timotimo greetings masak
m: say 72961176 / 361034 14:40
camelia rakudo-moar 957b52: OUTPUT«202.0894874␤»
timotimo hmm.
pierre_ travis-ci.org/pierre-vigier/Perl6-...essagePack 14:42
working as well, thanks timo
timotimo \o/
skids wonders if there is a "while" version of "with" 15:19
timotimo well, the big reason to have with over if is to have definedness checked but the original value passed in 15:21
you're using while with a pointy block?
skids yep. 15:25
m: my @a = 1,2,3,2,2,4,3,2; while @a.first(* eq 2):k -> $k { @a.splice($k,1) }; @a.say 15:26
camelia rakudo-moar 957b52: OUTPUT«[1 3 4 3]␤»
skids m: my @a = 2,1,2,3,2,2,4,3,2; while @a.first(* eq 2):k -> $k { @a.splice($k,1) }; @a.say
camelia rakudo-moar 957b52: OUTPUT«[2 1 2 3 2 2 4 3 2]␤»
skids Due to the :k being 0.
timotimo i see
i expect a little slang could be written to provide "whiledefined" 15:27
skids Yeah probably not worth it for this, though, I'll just longhand it. 15:28
timotimo that's not lovely, honestly 15:29
skids m: my @a = 2,1,2,3,2,2,4,3,2; say (while (with @a.first(* eq 2):k -> $k { |@a.splice($k,1) }) { $_ }); @a.say # :/ 15:39
camelia rakudo-moar 957b52: OUTPUT«((Any) (Any) (Any) (Any) (Any))␤[1 3 4 3]␤»
timotimo i'd really use grep instead :)
skids When self-modifying? 15:41
timotimo you mean in-place?
skids yeah modifying the @
timotimo m: my @foo = 2, 1, 2, 3, 2, 2, 4, 3, 2; say @foo.WHERE; @foo .= grep(none(2)); say @foo.WHERE 15:42
camelia rakudo-moar 957b52: OUTPUT«140510256955024␤140510256955024␤»
skids meh I'm probably not going to use the return value of :delete in this code anyway.
timotimo ^- same array object
so you're not going to lose anything :) 15:44
skids m: my @a = 2,1,2,3,2,2,4,3,2; for @a.grep(* eq 2):k -> $k { @a.splice($k,1) }; @a.say 15:45
camelia rakudo-moar 957b52: OUTPUT«[1 3 2 4 3]␤»
timotimo OK, or that way
but with splice you're doing a memmove for every element you kick out
whereas with my solution you're just paying for a second array of elements
skids Yeah this is light duty, so not caring much. 15:46
timotimo the code is much longer, though 15:46
skids Also have to gen the return value of the deleted elements. 15:47
timotimo oh
didn't know that, sorry :)
in that case you can grep twice :)
skids :) 15:48
skids darn, it's hard to search RT for "with" :-) 15:52
timotimo ugh, yeah
skids Hmmmm... 16:05
m: (while 42 -> $f { $f.say })[0..1].say
camelia rakudo-moar 957b52: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤ in code at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
timotimo oh, i thought while supported arguments 16:17
skids It does. 16:22
Just apparently not when lazy
Filing RT.
timotimo oh yikes
skids RT#129195 16:24
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129195
timotimo good catch, bad bug 16:26
timotimo i have a line number :) 16:27
yeah, '$result := &!body()' 16:28
skids That'd do it.
timotimo that's the InfiniteLoopIter, but there's also a WhileLoopIter that does the same thing 16:29
i wonder if those ought to be duplicated? :\
skids One might save on a truthiness check for tight loops I guess. 16:30
timotimo yeah, but ... so much code :o 16:33
timotimo how should we handle a while loop taking multiple arguments? 16:35
skids That's... a good question. :-) 16:36
timotimo m: while 43 -> $a, $b { say "oh" } 16:40
camelia rakudo-moar 710797: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in block <unit> at <tmp> line 1␤␤»
timotimo i wonder if we should complain at parse time? 16:41
AlexDaniel is it possible to get a $?LINE on which the current subroutine has been called? 17:14
kinda like a second line in the stacktrace 17:16
MasterDuke callframe.line perhaps?
timotimo can you try CALLER::('$?LINE') or some other access method? 17:22
maybe CALLER::$?LINE also works?
nine AlexDaniel: callframe(1).line 17:24
masak I don't think I've stressed it enough here: TravisCI has disrupted the way I do TDD on a project. I did not anticipate this. 17:34
MasterDuke masak: in a good or bad way? 17:36
timotimo i didn't actually fix the bug skids found, but i did comment on it on rt. and then promptly forgot to click the "toggle CC to perl6 mailing list" thing 17:56
masak MasterDuke: exclusively in a good way. 17:57
MasterDuke: it has made me write tests I didn't before.
timotimo it has made you write tests like never before 17:58
MasterDuke interesting
masak basically this entire directory: github.com/masak/007/tree/bf44fc7b...code-style 18:01
and a few test files outside of that
the basic premise is that if you care about code quality along some dimension, then there's an observable in there somewhere, which can be tested. 18:02
masak and so, if someone screws up the indentation or uses an identified code smell, it *fails the build* 18:02
r_i_d when doing testing, using dies-ok {}, is there a way to return the die string? If something fails for the wrong reason in a test, there's no way for me to know... 18:04
masak for one thing, it has made PR code reviews nicer. I don't have to jump in and say "hm, your indentation is out of whack" or "we don't do it that way in this project". TravisCI just reports "failed build", and that's that.
it has a distinctly more "objective" quality, for some reason. 18:05
r_i_d: that's why I don't use dies-ok.
r_i_d: check out throws-like
r_i_d ok, thanks i will! 18:06
masak m: say 1e0 / 0e0; CATCH { say .^name } 18:07
camelia rakudo-moar 710797: OUTPUT«X::Numeric::DivideByZero␤Attempt to divide 1 by zero using /␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
masak m: use Test; throws-like { say 1e0 / 0e0 }, X::Numeric::DivideByZero, "got the right exception when dividing by 0"
camelia rakudo-moar 710797: OUTPUT« 1..2␤ ok 1 - code dies␤ ok 2 - right exception type (X::Numeric::DivideByZero)␤ok 1 - got the right exception when dividing by 0␤»
masak r_i_d: ^ example
r_i_d nice
AlexDaniel MasterDuke: callframe is OK, thank you! 18:11
thundergnat Howdy #perl6 18:12
AlexDaniel o/ 18:13
thundergnat timotimo: Are you still maintaining SDL2::Raw ?
I've been messing around with it and am getting segfaults when trying to do some seemingly straightforward things. 18:15
El_Che timotimo: in case you're maintaining the perl6 environment? Would packages with specific version be a faster option for modules?
AlexDaniel \o/ segfaults! 18:16
thundergnat For instance: trying to change the window title...
AlexDaniel /o\
El_Che timotimo: for a module we don't need to test if rakudo builds, only that the module passes its tests
thundergnat E.G. gist.github.com/thundergnat/ed898d...b9cd11e627 reliably segfaults for me... 18:17
It is entirely possible I am doing something stupid though.
timotimo thundergnat: a little bit, yeah 18:19
timotimo El_Che: i don't know what you mean by "the perl6 environment" 18:19
timotimo thundergnat: i'll take a look at you rcode 18:19
calopter Hello! How can I make a subset which can be any one of a given set of values (of the same type)?
El_Che timotimo: sorry, I thought you did the travis integration: docs.travis-ci.com/user/languages/perl6 18:20
timotimo thundergnat: i'll take a look at you rcode
thundergnat timotimo: thanks
El_Che maybe masak
calopter I tried 'subset Category of Str where { <a bunch of strings>.contains: $_ }' 18:21
But then 'my Category $c = "a bunch";' typechecks...
timotimo thundergnat: it doesn't segfault on my machine ... 18:22
thundergnat timotimo: While I am bothering you, would it be possible to put a license on the SDL2::Raw module? Right now it is kind of undefined.
timotimo can you get a bit more info? like perl6-gdb-m it and give me a backtrace? or see if the window it returns is a null pointer?
ah, sure
oh, i'm the only contributor? 18:23
i won't even have to ask anybody if a given license is okay
thundergnat There are a few open pull requests but so far, you're it.
timotimo indeed there are :o 18:23
timotimo is there anything in the artistic license 2.0 that i'd have to change before putting it into SDL2::Raw? 18:25
thundergnat timotimo: If you are asking me, not that I know of; It is the license I generally release under. 18:27
timotimo OK 18:28
thundergnat timotimo: Hmm. Looks like I may be missing something on my system. Backtrace: gist.github.com/thundergnat/384381...3a0db43c64 18:30
lizmat calopter: not sure what you mean / the problem is
lizmat do you have an actual code / error we could check? 18:30
calopter lizmat: I'm trying to replicate the behavior of a sum type 18:31
timotimo thundergnat: yikes, that looks kinda bad 18:32
thundergnat: what's your moar version?
thundergnat Um. Its 2016.08. Not sure of the commit 18:33
timotimo hmm. 18:34
lizmat calopter: I must be too tired to understand how I can help you :-(
afk&
timotimo bisectable6: GOOD=head BAD=2016.08 use NativeCall; sub printf(Str $foo) is native(Str); printf("hello"); 18:35
bisectable6 timotimo, On both starting points (good=2015.12 bad=7107976) the exit code is 1 and the output is identical as well
timotimo, gist.github.com/3b5c5b343688834a6a...9a03d6c21b
timotimo :\
timotimo bisectable6: GOOD=e8d0d04 BAD=2016.08 use NativeCall; sub printf(Str $foo) is native(Str); printf("hello"); 18:35
bisectable6 timotimo, On both starting points (good=2015.12 bad=7107976) the exit code is 1 and the output is identical as well
timotimo, gist.github.com/925f00227720c448c4...662893bd18
timotimo what is wrong with the good= here?
thundergnat: can you try the code i gave to bisectable? 18:36
thundergnat Sure, hold on
timotimo oh
it was not parsing my good/bad at all
bisectable6: use NativeCall; sub printf(Str $foo) is native(Str); printf("hello");
bisectable6 timotimo, On both starting points (good=2015.12 bad=7107976) the exit code is 1 and the output is identical as well 18:37
timotimo, Output on both points: ===SORRY!=== Error while compiling /tmp/zTIkIkmfr9␤A unit-scoped sub definition is not allowed except on a MAIN sub;␤Please use the block form.␤at /tmp/zTIkIkmfr9:1␤------> ll; sub printf(Str $foo) is native(Str);<HERE> printf("hello");
timotimo m)
bisectable6: use NativeCall; sub printf(Str $foo) is native(Str) { }; printf("hello");
bisectable6 timotimo, On both starting points (good=2015.12 bad=7107976) the exit code is 0 and the output is identical as well
timotimo, Output on both points: hello
calopter lizmat: Thanks for looking. I have a set of valid values (Str in this case) and I want to make a subset that can be only one of those values
woolfy calopter: please give a code example so lizmat (or others) can see what you are doing 18:38
timotimo thundergnat: actually, maybe it's bogus that SDL_SetWindowTitle is set to "returns Str"
thundergnat timotimo: I get the unit-scoped sub error 18:39
timotimo indeed, that's probably the mistake
thundergnat: i just uploaded a new commit that might fix your issue 18:40
calopter woolfy: 'subset Category of Str where { set <a bunch of strings>.contains: $_ };' the problem is for the logic I need 'my Category $c = "a bunch";' should not typecheck, but with my subset implementation it does
thundergnat I'll give it a shot.
timotimo do we actually have .contains?
calopter oops, that's for list
not set
timotimo calopter: you're calling .contains on the list of strings and turnign the result into a Set here
so you're ending up with a set that contains either True or False 18:41
both would be considered true
thundergnat timotimo: \o/ woohoo! That fixed it. Thanks!
timotimo the quality of my library, and also my maintaining of it, is quite poor 18:42
calopter timotimo: Ok, thanks. I see that now. But if I leave out the set keyword and keep it as a list, the logic is still not what I'm looking for
thundergnat It is better than all the other perl6 SDL2 bindings in the library. :-) 18:43
woolfy thanks people for looking into problem of calopter ... at the moment lizmat does not see stuff... and we are on the way out to have a light meal (we walked on a mountain today, woohoo)...
MasterDuke m: subset C of Str where {<ab cd ef>.contains($_)}; my C $a = "ab"; my C $b = "bc"
camelia rakudo-moar 710797: OUTPUT«Type check failed in assignment to $b; expected C but got Str ("bc")␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: say <a bunch of strings>.contains: "foo"; say <a bunch of strings>.contains: "a"
camelia rakudo-moar 710797: OUTPUT«False␤True␤»
timotimo ah, contains come from Str, so it's turning the list into a Str for you 18:44
which by default means it gets spaces between the elements
m: say <a bunch of strings> (elem) "foo"; say <a bunch of strings> (elem) "a"
camelia rakudo-moar 710797: OUTPUT«False␤False␤»
timotimo wrong way around
m: say <a bunch of strings> R(elem) "foo"; say <a bunch of strings> R(elem) "a"
camelia rakudo-moar 710797: OUTPUT«False␤True␤»
timotimo m: say <a bunch of strings>.contains: "a bunch"; say <a bunch of strings> R(elem) "a bunch"
camelia rakudo-moar 710797: OUTPUT«True␤False␤»
timotimo that's the source of your trouble :)
calopter ahah 18:45
timotimo you may want to write that as a set instead of a list, though, so it doesn't try to construct the set every time a typecheck happens
calopter Thanks for demistifying!
timotimo no problem 18:46
MasterDuke m: subset C of Str where {<ab cd ef>.grep($_)}; my C $a = "ab"; my C $b = "bc"
camelia rakudo-moar 710797: OUTPUT«Type check failed in assignment to $b; expected C but got Str ("bc")␤ in block <unit> at <tmp> line 1␤␤»
calopter so I need to read up on ways to check for membership I see. thanks all 18:47
grondilu m: subset C of Str where <ab cd ef>.any; say "ab" ~~ C
camelia rakudo-moar 710797: OUTPUT«True␤»
timotimo that one isn't bad ^ 18:48
calopter nice 18:50
feels appropriately elegant 18:51
AlexDaniel hehe, wanna hear a joke? 19:04
“Pythonic functional programming language”
AlexDaniel and guess what, it exists! coconut-lang.org/ 19:04
timotimo it wouldn't be very surprising to find lagnuages that are more pythonic than python itself 19:07
tadzik giggles 19:12
4 activity notifications in weechat while I was afk, 2 of them are python jokes
timotimo you have a highlight on "python"? 19:13
MasterDuke i accidentally committed to master in my rakudo fork and then created a PR (instead of from a branch). if i move my commit into a branch and (force?) push that to my fork, will that mess up the PR? 19:15
timotimo the PR will remember that you wanted the perl6/rakudo repository to pull from your nom branch 19:19
timotimo that means you "force-push into a PR" by overwriting the branch you selected at the very beginning 19:19
timotimo on the other hand, there's nothing wrong with a PR that comes off of your "nom" branch 19:19
ufobat m: my @a = (1..3); my @b = @a.map: {$_+1}; say @b.WHAT 19:59
camelia rakudo-moar 29e2ca: OUTPUT«(Array)␤»
ufobat m: my @a = (1..3); my $b = @a.map: {$_+1}; say $b.WHAT
camelia rakudo-moar 29e2ca: OUTPUT«(Seq)␤»
ufobat m: my @a = (1..3); my @b = @a.map: {$_+1}; my $b = @b; say $b.WHAT
camelia rakudo-moar 29e2ca: OUTPUT«(Array)␤»
ufobat would anyone please explain me why the Seq happens? 20:00
timotimo because assigning to an array is list assignment 20:01
assigning to a scalar will just store your thing 20:02
TEttinger I still don't see the difference between the line that printed Array and the one that printed Seq 20:03
vcv @a vs $a
TEttinger oh, on the b
ufobat when i am having some class and make Foo.new(named => sub()) vs my %hash = (named => sub()); Foo.new(|%hash) i am getting different results. thats why i am asking
vcv err @b vs $b, oops 20:04
timotimo oh? 20:05
ufobat sub aaa { my @a = (1..3); return @a.map: {$_ + 1}}; class Foo {has @.named}; my %h = (named => aaa()); Foo.new(|%h).perl.say 20:06
m: sub aaa { my @a = (1..3); return @a.map: {$_ + 1}}; class Foo {has @.named}; my %h = (named => aaa()); Foo.new(|%h).perl.say 20:07
camelia rakudo-moar 29e2ca: OUTPUT«Foo.new(named => [(2, 3, 4).Seq,])␤»
ufobat vs
m: sub aaa { my @a = (1..3); return @a.map: {$_ + 1}}; class Foo {has @.named}; Foo.new(named => aaa()).perl.say
camelia rakudo-moar 29e2ca: OUTPUT«Foo.new(named => [2, 3, 4])␤»
ufobat i am looking for a way to work with the hash, but still having the Array
lizmat timotimo++ grondilu++ helping calopter 20:27
danlei hi. I reported a bug two days ago. there was a fix yesterday and the bug was closed. I think there are still problems, but when I responded to [email@hidden.address] my message didn't show up in the bug tracker. (I responded yesterday and nothing has showed up in the tracker until now.) now, I'm not sure what to do. should I just file a new bug report? 20:55
this one: rt.perl.org/Public/Bug/Display.html?id=129179
the problem: pastebin.com/PdPY430c 20:58
(2016.08.1-83-gaceb4af)
JimmyZ danlei: just file a new bug report 20:59
danlei JimmyZ: ok, thanks 21:01
danlei JimmyZ: by the way: it should have appeared in the bug tracker when I responded to [email@hidden.address] right? or did I misunderstand how to use this thing? 21:02
MasterDuke danlei: it should have, but RT was having some troubles today (it went down once or twice), so your replies may have been lost or may still be in some queue 21:03
danlei MasterDuke: I see. thanks!
MasterDuke do the reply or comment buttons on the RT page work for you? 21:04
danlei they open a page with site info ("this service is sponsored ...") 21:05
(when I click it as a guest, anyway) 21:06
MasterDuke ahh, if i remember correctly you have to have an RT account to use them. if you think you'll be submitting more bug reports it would probably be useful to get an RT account
danlei hm – bitcard. never heard of it. 21:07
I'll take a look
MasterDuke email is convenient for quick one-offs, but i find my replies show up faster (immediately) if i'm logged in and use the reply/comment buttons 21:08
danlei ok. I'll just set up an account then. 21:09
danlei thanks 21:10
El_Che I also use the web interface. You see right away your comments posted. A few time it tooks hours before my comment appeared
MasterDuke glad to help. and thanks for the reports
and now for something completely different... 21:11
what's a good way to find the max value of an int (not Int)?
lizmat m: int32.Range.max.say 21:13
camelia rakudo-moar e39ab8: OUTPUT«2147483647␤»
lizmat MasterDuke: ^^^ 21:14
MasterDuke lizmat: great, thanks
MasterDuke any equivalent in nqp? 21:15
lizmat MasterDuke: not as far as I know
this just lives in the core settings 21:16
danlei hm -- this bug tracker is a bit confusing 22:02
danlei I created an account, and now I can't get to the bug anymore. it always redirects me to rt.perl.org/SelfService, even when I paste the bug url in the navigation bar. when I enter the bug id in the goto ticket tingie, it says that I have no permission to view that ticket. 22:04
danlei scratches his head
*thingie
MasterDuke ahh, that's happened to a couple people 22:05
timotimo is that the kind of thing we need [Coke] to fix?
geekosaur that happens to me as well, fwiw 22:06
danlei strange. doesn't work in other browsers either. well, I guess I'll just open another ticket then. 22:17
[ptc] anyone else having problems pulling from (or pushing to) GitHub atm? 22:18
just wondering if it's just me...
[Coke] I can't fix anything with RT; standard web app debugging applies: clear your cache/cookies for the site; try a different browser; if that doesn't work, please open a ticket with the admins (email addy listed at the bottom of the rt.perl.org site) 22:21
dalek Heuristic branch merge: pushed 16 commits to perl6-examples by paultcochrane 22:24
[ptc] hrm, dunno GH was hanging for me, it's working now. Oh well... 22:26
lambd0x I'm jumping over the conclusion that moar/rakudo might not be ready for large data input at all when it comes to sorting algs :S. 22:56
dalek osystem: 39066e6 | (Andy Weidenbaum)++ | META.list:
Add module TXN::Remarshal
23:00
osystem: f6f5a5b | Altai-man++ | META.list:
Merge pull request #246 from atweiden/txn-remarshal

Add module TXN::Remarshal
timotimo lambd0x: how do you figure? also, why not just use the sort impl we already have? 23:09
timotimo lambd0x: do you have all your code up in a git repo or something? 23:17
lambd0x timotimo: remember that bubbleSort alg? Well I also implemented merge, quick, insert, selection, heap, etc... even though they look clean and work for relatively 0...75000 inputs they will start giving odd errors for bigger input data. I'm not saying that the impl. sorting alg. we have is not good, but any alg. should work for all input sizes until it rans out of memory and for some this is not being true
unfortunately :'(
timotimo: yes.
timotimo right, it's not supposed to crash
need to test that stuff and figure out what's going wrong
lambd0x timotimo: github.com/lambd0x/Learn-Perl-6 in the sorting directory. 23:19
timotimo i find it surprising that you iterate over the words in a file in order to push it into a list and return that 23:22
rather than just returning .IO.words directly
lambd0x timotimo: I'm still learning, so yeah I have a lot improve I think :P 23:26
timotimo: have u seen that those environment variables made bubble with 5k input work for that ^..^ issue ? 23:27
timotimo yeah, it's potentially a specialization problem
might be fiddly to actually figure out 23:28
we'll see
i'll probably go to bed in a little bit 23:29
lambd0x timotimo: ok 23:30