»ö« 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.
00:00 _nadim joined 00:07 spintronic joined 00:16 spintronic left
_nadim can someone please unban my normal nick? 00:16
00:19 perlawhirl left 00:45 nadim joined 00:48 _nadim left
timotimo i don't know what your normal nick is, but i also don't have permissions to do administration of #perl6 00:50
00:51 nadim left 01:07 rodarmor left 01:11 vendethiel left 01:14 vendethiel joined 01:19 rodarmor joined 01:27 spider-mario left 01:29 jack_rabbit left 01:34 BenGoldberg joined 01:35 vendethiel left 01:39 vendethiel joined 01:46 michaelvipub joined 01:55 Ben_Goldberg joined 01:58 BenGoldberg left 02:01 kalkin- left, kalkin-_ joined 02:23 vendethiel left 02:24 jack_rabbit joined 02:26 vendethiel joined 02:30 michaelvipub left 02:49 FROGGS__ joined 02:53 FROGGS_ left 02:55 AlexDaniel left 02:59 kalkin- joined 03:00 colomon left 03:02 colomon joined 03:03 kalkin-_ left 03:05 sftp left 03:09 sftp joined 03:14 kid511 left 03:17 sftp left 03:19 sftp joined 03:22 perlawhirl joined 03:36 noganex_ joined 03:39 noganex left 03:53 perlawhirl left 04:02 skids joined 04:11 perlawhirl joined 04:17 BrassLantern joined, BrassLantern left, BrassLantern joined, BrassLantern left 04:20 colomon left 04:21 colomon joined 04:35 kaare_ joined 04:38 perlawhirl left, perlawhirl joined 04:46 perlawhirl left 04:47 tmch left 04:55 pdcawley joined 04:56 pdcawley_ left, colomon left 05:00 colomon joined, khw left 05:07 colomon left 05:08 Ben_Goldberg left 05:17 colomon joined 05:18 silug left 05:25 tmch joined 05:29 silug joined 05:45 Fleurety left 05:50 tmch left 05:52 Cabanossi left 05:54 Cabanossi joined
dalek Iish/myGLR: 38fdc10 | (Salvador Ortiz)++ | lib/DBIish/CommonTesting.pm6:
Remove remaining trailing zero
Iish/myGLR: 19cbc75 | (Salvador Ortiz)++ | lib/DBDish/Pg/StatementHandle.pm6:
Retab only
05:57 avalenn left 05:58 avalenn joined 06:04 jevin left 06:06 jevin joined 06:18 kentnl joined, kent\n left 06:26 CIAvash joined 06:27 sortiz left 06:32 jack_rabbit left, silug left 06:33 skids left 06:39 kentnl left 06:40 kent\n joined, kent\n left, kent\n joined 06:47 silug joined 06:55 colomon left, perlawhirl joined 06:56 colomon joined 06:58 labster left 07:04 labster joined 07:17 xinming joined 07:24 perlawhirl left 07:26 kentnl joined 07:27 vendethiel left 07:28 perlawhirl joined 07:30 kent\n left 07:43 vendethiel joined 07:50 domidumont joined 07:55 domidumont left, domidumont joined 08:04 vendethiel left 08:12 vendethiel joined 08:14 CIAvash left 08:15 perlawhirl left 08:22 yqt joined 08:24 abaugher left 08:25 abaugher joined 08:30 espadrine_ joined 08:45 wamba joined 08:56 vendethiel left, firstdayonthejob joined 09:00 vendethiel joined 09:05 bakedb left 09:07 rindolf joined 09:09 pmurias joined 09:11 Ven joined
rindolf Hi all, is there anything that can be done about the Perl 6 behaviour quirks mentioned in these quotes from a facebook thread - paste.debian.net/417281/ ? 09:25
Like - something I meant is not doing the right thing and the code runs but yields a wrong result. 09:26
teatime hrm, none of his examples seem very, well, convincing. 09:28
rindolf teatime: convincing? 09:30
teatime: and I am Shlomi Fish.
teatime ok, first, I know very little about Perl6, and haven't done Perl5 for several years. So I'm probably wrong. But, I'll say my bit anyway. 09:31
ok the first example is “+{}” returns 0 instead of a hash reference.
when would you ever actually do that? 09:32
rindolf teatime: I did it because I assumed it would be the same as Perl 5.
teatime why would you do that in perl5 ?
rindolf teatime: I wanted to disambiguate between a hash ref and a block.
teatime: to disambiguate between a hash ref and a block. 09:33
teatime fair enough, I see that's even recommended by perlref 09:35
09:35 Begi joined
teatime #3 seems to boil down to "the following operators do something different in perl6 than in other random languages including perl5, so when I paste code from other random languages into a perl6 file, it doesn't execute correct." 09:36
nine rindolf: they're not quirks in Perl 6 but quirks in Perl 5 that have been fixed
rindolf nine: 09:37
nine: I disagree.
nine: perl6 accepts and runs them fine, but they do the wrong thing and then you spend many minutes debugging. 09:39
teatime rindolf: I don't think you should expect random perl5 code to be valid, equivalent perl6 code.
this doesn't even work very well for python2 -> python3, which are much more similar than perl5 and perl6.
rindolf teatime: I don't , but coming from Perl 5 , I find a lot of the Perl 6 I write or port to be errorprone and silently accepted. 09:40
Why would [+] (map ... ) evaluate the map in numeric/scalar context? Who would ever want to do that? 09:41
What good is +{ ... } returning 0?
At least it should err or warn on those. 09:42
teatime rindolf: it might have to read your mind? to know you meant other than you wrote?
in the general case, I mean. you might could make a case in specific instances. 09:43
like, a C example. "if (a = b)" will generate a warning, because it's a common error, and almost never intended. but the warnings you want, may fall into neither category? 09:44
arnsholt As regards prefix:<+>, it's the operator that converts to numeric. For hashes, IIRC, the numeric value of a hash is the number of entries in it
m: my %x; %x<a> = 1; say +%x
camelia rakudo-moar 843741: OUTPUT«1␤»
arnsholt Thus, +{} is 0 since it's empty
09:44 RabidGravy joined
rindolf arnsholt: ok, I wish it was done in a more explicit manner. 09:45
arnsholt For #2, since adding flat helps, it sounds like a list semantics thing (which I haven't properly assimilated yet either)
09:50 tmch joined
nine rindolf: the numeric values of an array or hash is the number of their elements. Does that not make sense? 09:54
09:54 iH2O joined
rindolf nine: it does, but it can behave in a quirky manner. 09:56
09:56 iH2O left 09:57 vendethiel left
rindolf Anyway, this discussion is going nowhere. 09:57
09:59 vendethiel joined 10:04 virtualsue joined
nine rindolf: I'd argue that Perl 6 would be less of a Perl if it didn't have shortcuts like +%h and required you to be more explicit (Zen of Python #2). Now having a numeric operator return a Hash was a straight forward mistake that made no sense at all in a language where operators determine the type of operation instead of variables. 10:07
So Perl 6 sticks much more to the spirit of Perl in this case than Perl 5. 10:08
rindolf nine: fine, I guess I'll have to accept that my Perl 6 code will be errorprone. 10:12
nine rindolf: it will only be if you take code from other languages and expect it to work just the same in Perl 6. That said, Perl 6 has helped me often with informative error messages when I accidentally used Perl 5 syntax. It just cannot catch every case. 10:14
masak antenoon, #perl6 10:16
rindolf masak: morning.
masak rindolf: just jumping into this conversation -- sorry about that -- but when you say "it does, but it can behave in a quirky manner", all I hear is "I'm not quite used to Perl 6's behavior here yet" 10:18
for both arrays and hashes (and other container-y types), prefix:<+> means the same as `.elems`. it's quite consistent and non-quirky 10:19
pmurias rindolf: is accidently numerifing Hashes a common error? 10:20
masak arguably, if you want to project container types down into a single scalar number, its *size* is a prime candidate for that number
a container type*
masak is too tired to grammar
10:21 labster left
rindolf pmurias: well, it happened to me at least once and now I'll need to remember to avoid it. 10:22
El_Che is reading rindolf's url 10:23
10:23 perlawhirl joined
pmurias rindolf: in Perl 5 you also have to avoid doing that 10:26
rindolf pmurias: like %one + %two? 10:27
TEttinger I'm in the process of ungolfing (in a way) a piece of java code. in another sense I can still golf it.
Hello, World!
{'$' << (',' ^ '-'), '`' | ('-' - '('), '$' << (',' ^ '-') | '$', '$' << (',' ^ '-') | '$', '\\' + '@', ',', ' ', '(' + '\\', '\\' + '@', '\\' + '\\', '$' << (',' ^ '-') | '$', '\\' + '\\', '!'};
no alphanumerics used at all, still able to say Hello, World 10:28
rindolf TEttinger: this is Java?
TEttinger it does need new char[] before it
rindolf TEttinger: ah.
TEttinger most people don't know java allows bitwise ops on chars
rindolf TEttinger: maybe it treats characters as integers.
TEttinger the one unsigned integer type, yeah
rindolf TEttinger: this looks like obfuscation rather than golf. 10:29
TEttinger it can be golfed down
many of these combinations may have better versions
pmurias rindolf: +%foo also doesn't warn in Perl 5, it's just that the chance that it fails silently is bit bigger
10:33 mr-foobar left 10:34 Guest11071 joined 10:36 mr-foobar joined 10:38 spider-mario joined, bjz left
masak rindolf: ...but do you not agree that it's more consistent like this? because `+` means "numeric addition" as an infix, `~` means "string concatenation", so it makes sense that the prefix versions numify and stringify (respectively) 10:40
10:42 domidumont left 10:43 TEttinger left 10:44 bakedb joined
masak ...have QAST::Compunit, want to recurse down it. what do I do? :) 10:45
rindolf masak: well, fine. 10:46
masak m: use nqp; my $foo = nqp::getcomp('perl6').compile('say 42', :target('ast'), :compunit_ok); say $foo.^name
camelia rakudo-moar 843741: OUTPUT«QAST::CompUnit␤»
masak rindolf: I really think it's a matter of getting used to it.
rindolf masak: OK, OK.
masak stops nagging ;)
rindolf is away - walk.
masak in the above, what does $foo have that lets me actually introspect the program? 10:47
I expected a .children or *something*
oh, QAST::CompUnit does QAST::Children, I see it now
so .list et al work 10:48
m: use nqp; my $foo = nqp::getcomp('perl6').compile('say 42', :target('ast'), :compunit_ok); multi hmm($node) {}; hmm($foo); 10:52
camelia rakudo-moar 843741: OUTPUT«X::Multi::NoMatch exception produced no message␤ in block <unit> at /tmp/uH6q_q9KtF line 1␤␤»
masak ^ this is a bit of a problem :)
m: use nqp; my $foo = nqp::getcomp('perl6').compile('say 42', :target('ast'), :compunit_ok); sub hmm($node) {}; hmm($foo);
camelia rakudo-moar 843741: OUTPUT«X::TypeCheck::Binding exception produced no message␤ in sub hmm at /tmp/gmqYXsvvCT line 1␤ in block <unit> at /tmp/gmqYXsvvCT line 1␤␤»
masak seems nqp-universe QAST nodes can't bind to Perl 6-universe routines
that... somewhat raises the bar required to do anything sensible with them 10:53
I've already got a (dirty, unwholesome) regex-based test in place in the 007 test suite. it's working fine, I guess. but help me replace it with a QAST-based one! :D
masak goes about emulating a call stack the hard way 10:54
10:56 bjz joined
masak I have a feeling I'm the first one to do this. 10:58
...which means I'm in the right place :)
masak .oO( well, technically it's a necessary but not sufficient condition... )
11:01 yqt left
masak ooh, $node.dump 11:02
11:02 darutoko joined 11:04 kid51 joined
pmurias masak: is there a plan to have the new ast format replace QAST or will it just be compiled to that? 11:08
11:08 virtualsue left
masak pmurias: that's a biggish question. 11:09
pmurias: fortunately, I don't feel I have to provide an excellent answer to it until-and-unless it becomes clear that Q is the right choice not just for macros in Perl 6, but for Perl 6 AST handling as such. 11:10
I'm reading the QAST dump now... and I'll say this: it's looking good for Q :P
(I don't mean to disparage QAST. it's clearly doing vital work for Perl 6 compiler code manipulation/generation) 11:11
11:14 iH2O joined
pmurias there is a big difference between handling Perl 6 AST as a transformable representations of the program and using it as a processed form that's suitable for compiling 11:17
RabidGravy wonders idly if making a grammar for "drum tabs" is worth it
masak pmurias: full ACK 11:19
pmurias: ...which, I guess, is the same thing as saying that there will be a place both for QAST and for Q
arnsholt masak: Regarding using NQP stuff in Perl 6, don't you need to make the arguments Mu? 11:21
To the Perl 6 subs, that is. NQP things not being subtypes of Any 11:22
masak arnsholt: good tip. 11:23
masak tries
m: use nqp; my $foo = nqp::getcomp('perl6').compile('say 42', :target('ast'), :compunit_ok); sub hmm(Mu $node) { say "this works!" }; hmm($foo); 11:24
camelia rakudo-moar 843741: OUTPUT«this works!␤»
masak arnsholt++ # nice!
arnsholt I think Perl 6 code I've seen that does NQP stuff also tends to bind the results of the operations
masak yeah, that'll simplify my life a bit
ok, good to know
arnsholt Probably some kind of interaction with containers, but not sure what
masak as far as I can see, I can't access *names* like `QAST::CompUnit`
but if I want to typecheck, I can always do something like `if $node.^name eq "QAST::CompUnit"` -- like a barbarian 11:25
arnsholt Hmmm, that's trickier
pmurias masak: there might also be a place for a QAST replacement that fully embraces it's role and is easily optimizable, full of stuff that helps compilations etc. 11:26
masak pmurias: sounds awesome. 11:27
pmurias: you're looking for another champion there though -- not me ;)
psch m: use QAST:from<NQP>; my $x = QAST::CompUnit.new 11:35
camelia ( no output )
psch masak: ^^
arnsholt m: use QAST:from<NQP>; say QAST::CompUnit ~~ Any # I wonder... 11:36
camelia rakudo-moar 843741: OUTPUT«False␤»
psch and that's the dispatch failure form before :)
arnsholt Yeah, I was just wondering whether NQP types could occur directly as types in Perl 6, or if they'd need some kind of bridge type to supply some additional operations needed by Perl 6 11:37
From the looks of it, they can be used directly =)
psch m: use QAST:from<NQP>; QAST::CompUnit.^mro.say 11:38
camelia rakudo-moar 843741: OUTPUT«Method 'gist' not found for invocant of class 'QAST::CompUnit'␤ in block <unit> at /tmp/jpN354K3Ef line 1␤␤»
psch m: use QAST:from<NQP>; QAST::CompUnit.^mro>>.Str.say
camelia rakudo-moar 843741: OUTPUT«Method 'Str' not found for invocant of class 'QAST::CompUnit'␤ in block <unit> at /tmp/HC_JhX4N6N line 1␤␤»
psch m: use QAST:from<NQP>; QAST::CompUnit.^mro.elems.say
camelia rakudo-moar 843741: OUTPUT«3␤»
psch well, i suppose having .gist might be nice, but having them next to Any seems reasonable to me at least 11:39
if only 'cause it makes it obvious that something extraordinary is going on
arnsholt Oh, yeah, definitely 11:40
Was just curious about implementation details, really =)
psch m: use QAST:from<NQP>; say QAST::CompUnit.^mro.map: { $_.HOW.name($_) } # hm, not even next to Any, really
camelia rakudo-moar 843741: OUTPUT«(QAST::CompUnit QAST::Node NQPMu)␤»
psch seeing as that's no Mu at the top there... 11:41
11:51 Begi left
pmurias masak: It's very likely I will have to add a static analysis pass to rakudo-js to get decent performance, I do not plan to replace QAST but it should provide some insight 11:59
12:08 espadrine_ is now known as espadrine 12:20 shinobicl joined
dalek kudo-star-daily: dc17839 | coke++ | log/ (9 files):
today (automated commit)
kudo-star-daily: 51d8e09 | coke++ | log/ (9 files):
today (automated commit)
perlawhirl :q 12:22
12:22 perlawhirl left
shinobicl hi all! 12:24
is there support for multidimensional arrays in perl6?
psch shinobicl: i suspect you mean multidimensional *shaped* arrays? 12:25
m: my @a = [],[]; dd @a # unlike this 12:26
camelia rakudo-moar 843741: OUTPUT«Array @a = [[], []]␤»
psch m: my @a[2;2]; dd @a # but like this
camelia rakudo-moar 843741: OUTPUT«Array.new(:shape(2, 2), [Any, Any], [Any, Any])␤»
12:27 michaelvipub joined
shinobicl m: my @sa = [1,2,3], ['A','B','C']; say @sa.perl ; say @sa[1][2]; 12:29
camelia rakudo-moar 843741: OUTPUT«[[1, 2, 3], ["A", "B", "C"]]␤C␤»
psch hm, shaped arrays are less implemented than i though 12:31
shinobicl Why? It seems fine to me 12:32
psch m: my @a[2;2] = [1,2],[3,4]; say @a[0;*]
camelia rakudo-moar 843741: OUTPUT«Partially dimensioned views of arrays not yet implemented. Sorry. ␤ in block <unit> at /tmp/CkVEOucmFU line 1␤␤»
psch m: my @a[2;2] = [1,2],[3,4]; say @a[0;1]
camelia rakudo-moar 843741: OUTPUT«2␤»
psch that's why :)
m: my @a[2;2] = [1,2],[3,4]; say @a[0][1] 12:33
camelia rakudo-moar 843741: OUTPUT«Partially dimensioned views of arrays not yet implemented. Sorry. ␤ in block <unit> at /tmp/aT4zf3D9RT line 1␤␤»
shinobicl I am developing a "table class" (bi dimensional array), and i would like to use the same syntax to refer to a cell, something like this
say $table1['C'][3] 12:34
i'm not sure how toimplement an operator like this, [] [] though
or maybe ['C';3] 12:35
psch shinobicl: doc.perl6.org/language/subscripts#M...bscripting 12:36
shinobicl so far i am only using $table1.cell('C', 3), that seems good enough but if i can make it work in the same way perl6 habdles bidimensional arrays it would be much better
wow! thanks!
12:39 perlawhirl joined
perlawhirl thinks about accessing tables cells via quoteless letters with enums... 12:41
12:41 shinobicl left
perlawhirl m: my @table = ['one','two'],['alpha','beta']; my enum <A B>; say @table[B;1] 12:41
camelia rakudo-moar 843741: OUTPUT«beta␤»
psch fwiw, if i needed something like that i'd probably just go with an HoA and sort the keys whenever i have to iterate... :) 12:42
perlawhirl that makes sense
psch although an enum is a very nice approach as well 12:43
perlawhirl yeah, but how to create a infinite enum of incrementing letters?
12:45 iH2O left
psch hm, true, i don't think lazy enums are a thing we do 12:49
perlawhirl hah, not well anyway... i just troed : my enum ('a' ... 'z') which wordked ok, but: my enum ('a' ... 'za') segfaulted the first time 12:50
worked the second time
psch uh
perlawhirl but yeah. 'a'...'zzz' generates a list find, but trying to make an enum out of it just sat there
RabidGravy gosh I hate regular expressions
psch m: say ('a'...'zzz').elems 12:51
camelia rakudo-moar 843741: OUTPUT«18278␤»
12:51 Begi joined
perlawhirl yeah the list form works no probs... but enum will timeout 12:51
m: my enum ('a' ... 'zzz')
camelia ( no output )
perlawhirl o... k?
psch m: my enum ('a' ... 'zzz'); say abz
camelia rakudo-moar 843741: OUTPUT«5===SORRY!5=== Error while compiling /tmp/jzjwXKgSih␤Two terms in a row␤at /tmp/jzjwXKgSih:1␤------> 3my enum ('a' ... 'zzz'); say7⏏5 abz␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ stat…»
psch RabidGravy: what's the problem? 12:52
RabidGravy regular expressions
psch ... i suppose i ran into that one :)
perlawhirl yeap
RabidGravy I just don't think my brane works that way 12:53
perlawhirl psch: by the way, repl just created the a...zzz enum, just took a few seconds, but yeah, it ain't lazy... anyway, moving on now 12:54
psch yeah, i don't think enum can be lazy, considering the keys are installed lexically 12:55
perlawhirl m: my enum ('a' ... 'zzz'); my $n = 1 + abz; say $n; 12:57
camelia rakudo-moar 843741: OUTPUT«5===SORRY!5=== Error while compiling /tmp/meVloISDL5␤Two terms in a row␤at /tmp/meVloISDL5:1␤------> 3um ('a' ... 'zzz'); my $n = 1 + abz; say7⏏5 $n;␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤…»
perlawhirl works in repl
12:58 perlawhirl left 13:05 espadrine left
Guest11071 m: say 'Test'; 13:10
camelia rakudo-moar 843741: OUTPUT«Test␤»
Guest11071 Hello 13:12
Is it possible to run a short snippet of code from pastebin here? 13:13
Begi m: say "Hello Guest11071 !";
camelia rakudo-moar 843741: OUTPUT«Hello Guest11071 !␤»
psch Guest11071: gisthub works
Guest11071 First time using irc ever I'm afraid
psch well, gist.github.com i think the url is
13:14 kurahaupo joined
Guest11071 Ok, thx, have a snippet which segfaults at home and wanted to try it here 13:14
lizmat Guest11071: please do 13:16
Guest11071 m: gist.github.com/anonymous/d5d04065881b55c1618d
camelia rakudo-moar 843741: OUTPUT«360360␤»
psch star-m: gist.github.com/anonymous/d5d04065881b55c1618d 13:17
camelia star-m 2016.01: OUTPUT«360360␤»
psch oh, that's 2016.01 already
Guest11071 it fails at home, must be something wrong with my install I guess
psch hmm
Guest11071 did rakudobrew build moar yesterday 13:18
Begi What's your version Guest11071 ?
psch is in the middle of a bisect...
Guest11071 This is Rakudo version 2016.02-189-g8437418 built on MoarVM version 2016.02-33-g1e3d2ac
psch m: say $*VM.version
camelia rakudo-moar 843741: OUTPUT«v2016.02.33.g.1.e.3.d.2.ac␤»
psch curious
as in, that's exactly the same version as camelia is running 13:19
lizmat Guest11071: fwiw, I can confirm the segfault
Guest11071 Phew, I was beginning to think I was wasting your time
psch Guest11071: what's your os? 13:20
lizmat Guest11071: looks like while (True) is to blame (at least for me)
Guest11071: if you replace this with loop {}, it works for me
Guest11071 Linux Mint 17.3 running in Virtual Box on W7
lizmat suspects a JIT / spesh issue
Guest11071 Yes it starts to work for me when I remove the comment in the beginning 13:21
lizmat not for me
psch lizmat: disabling either works?
lizmat no, :-( so it's something else
psch :/
Guest11071 I was trying to develop a solution for Project Euler, problem 5 13:22
RabidGravy there, can parse a "drum tab" 13:23
lizmat Guest11071: fwiw, I would write the loop as "$a += 14 while (2..13).first(-> $x { !($a %% $x) });" 13:24
Guest11071 thx, I'll try it. Seemed like a good idea to start learning p6 by doing some Project Euler problems 13:25
lizmat Guest11071: thanks for reporting: core devs love easy reproducible segfaults 13:26
Guest11071 Thank you for helping me out, hope you'll be able to figure out what's wrong 13:27
psch++, lizmat++ # hope that's the correct lingo :-) 13:29
lizmat yeah, that's about it, Guest11071++ :-)
psch Guest11071: as lizmat says, segfaults are never a waste of time :) 13:30
... well, alluded to at least vOv
Guest11071 i'll check the weechat manual and get a proper nick but dogbert was taken :(
13:41 michaelvipub left 13:53 domidumont joined 13:54 itaipu joined, colomon left
RabidGravy LAWKS! 13:59
so you may remember a while back I was wondering about the stability of the Supply.interval 14:05
psch it's more stable than meg white live?
RabidGravy sequencing that live 14:06
psch amen brother :P
RabidGravy++ 14:07
RabidGravy took longer to parse the drum tab than make the program ;-) 14:08
Begi m: ("Hello World !").grep: '!';
camelia ( no output )
Begi m: (("Hello World !").split('')).grep: '!';
camelia ( no output )
psch m: say "Hello World !".contains('!')
camelia rakudo-moar 843741: OUTPUT«True␤»
Begi Ahh, that's what I was looking for, thanks psch : 14:09
psch RabidGravy: now just bring the acid bass back, occassionally shuffle a few 8th or 4th of that drum beat around and presto, breakcore :) 14:10
RabidGravy quite a nice drum kit for the stock fluidsynth GM kit 14:11
psch sounds a bit heavy on the reverb for stock samples vOv 14:14
well, bisect finally finished... 14:15
apparently 93d597f40 broke the r-j build
RabidGravy it's the fluidsynth doing that 14:16
psch "Cannot do aggregate operation on a type object" it says, which seems to point at the nqp::join call in the patch... 14:17
RabidGravy that's "dry" now
psch RabidGravy: well, i've listened with headphones, so what sounds like "a bit heavy" might be perfectly fine for speaker-listening 14:18
RabidGravy all maximum velocity
psch no rim or deadnote sample in the kit? 14:20
i mean, low velocity on the deadnotes can work i guess, but...
lucs RabidGravy: Nasty 4/4 there :) 14:21
14:23 Ben_Goldberg joined
lucs Okay, same four bars repeating, not immediately obvious. 14:24
psch lucs: en.wikipedia.org/wiki/Amen_break 14:25
lucs Ah, nice.
14:27 telex left 14:28 telex joined 14:29 tmch left 14:30 aborazmeh joined, aborazmeh left, aborazmeh joined 14:33 tokomer joined 14:48 aborazmeh left 14:52 arcetera left
awwaiid I'm still not getting what's going on here, so I'll renew my question... 14:52
m: for <100 10_000 100_000> -> $batch { my $start = now; ((10..99) X (10..99)).map({$_[0] * $_[1]}).grep(-> $n { $n.Str eq $n.Str.flip }).sort[* - 1].say ; my $end = now; say "Batch $batch took { $end - $start } seconds" }
camelia rakudo-moar 843741: OUTPUT«9009␤Batch 100 took 0.1909047 seconds␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤ in block <unit> at /tmp/Z8Bm3tjoGy line 1␤␤»
awwaiid It gets through the first iteration fine (prints out 9009 and the timing), but on the second iteration it says the seq is used up. which seq?
actually I'll put this in a file and maybe it'll tell me which line it's talking about 14:53
14:53 arc__ joined, arc__ is now known as arcetera, arcetera left, arcetera joined
psch m: for ^2 { ((10..99) X (10..99)).map( { $_ + 2 } ) } 14:54
camelia rakudo-moar 843741: OUTPUT«This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤ in block <unit> at /tmp/jev26hJTlI line 1␤␤»
psch m: for ^2 { say [+] ((^5) X (^5)) }
camelia rakudo-moar 843741: OUTPUT«50␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤ in block <unit> at /tmp/9d9xKl4VVU line 1␤␤»
14:55 arcetera left
psch awwaiid: the Seq built by infix:<X>, apparently 14:55
awwaiid yep, I just got that from the breaking of lines
14:55 arc__ joined 14:56 arc__ is now known as arcetera, arcetera left, arcetera joined
awwaiid so is this wrong behavior? I expect it to construct that Seq from scratch on each iteration 14:56
psch m: for ^2 { ^5 .say } 14:57
camelia rakudo-moar 843741: OUTPUT«^5␤^5␤»
psch m: for ^2 { 0..4.say } 14:58
camelia rakudo-moar 843741: OUTPUT«WARNINGS for /tmp/2Y5I0bmw1X:␤Useless use of ".." in expression "0..4.say" in sink context (line 1)␤4␤4␤»
psch m: for ^2 { (0..4).say }
camelia rakudo-moar 843741: OUTPUT«0..4␤0..4␤»
psch hm
m: for ^2 { say (1..5).map: * }
camelia rakudo-moar 843741: OUTPUT«Cannot call map(Range: Whatever); none of these signatures match:␤ ($: Hash \h, *%_)␤ (\SELF: &block;; :$label, :$item, *%_)␤ (HyperIterable:D $: &block;; :$label, *%_)␤ in block <unit> at /tmp/51yvD2JMrA line 1␤␤»
awwaiid I'm wondering how to construct a Seq minimally too
psch m: for ^2 { say (1..5).map: { $_ } }
camelia rakudo-moar 843741: OUTPUT«(1 2 3 4 5)␤(1 2 3 4 5)␤»
psch yeah, it's not the Range itself then
that's somewhat reassuring at least
awwaiid: fwiw, i don't think you'd want to recreate that, if it's the same in each iteration anyway 14:59
Begi m: my Str $a; say 42 unless $a.chars;
camelia rakudo-moar 843741: OUTPUT«Use of uninitialized value of type Str in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/QNvn680Cm2 line 1␤42␤»
psch awwaiid: but that doesn't really help with it being somewhat unintuitive there
awwaiid: ... at least the error tells you what to do i suppose :)
Begi Why a warning ?
psch m: Str.chars 15:00
camelia rakudo-moar 843741: OUTPUT«Use of uninitialized value of type Str in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/7v3FjKeCXG line 1␤»
Begi my $a = ''; say 42 unless $a.chars;
m: my $a = ''; say 42 unless $a.chars;
camelia rakudo-moar 843741: OUTPUT«42␤»
awwaiid psch: well a seq is being lazily created, ya? so if I were bailing out of that loop early based on some detection, and then did it again based on another detection, I'd want it to start from the beginning and not fill up all my memory
psch awwaiid: how do you bail out of ($range X $range)? 15:01
Begi Is there a more idiomatic way to write this bit in Perl 6 ?
awwaiid psch: it'd be later in the seq chain, like in the grep 15:02
psch Begi: assuming you want "it's not the empty string and not a type object" you can use prefix:<?> or .Bool
m: my Str $a; my $b = ''; say 42 unless ?$a; say 43 unless $b.Bool 15:03
camelia rakudo-moar 843741: OUTPUT«42␤43␤»
awwaiid m: (^5 X ^5).map(* * 2).WHAT.say # sequences keep chaining
RabidGravy or just my $a = ''; say 42 unless $a
camelia rakudo-moar 843741: OUTPUT«(Seq)␤»
Begi Yes, RabidGravy, it's what I've done
15:04 yqt joined
psch awwaiid: does that preclude you from using .cache, as the error suggests? 15:05
awwaiid: afaik, .cache doesn't eagerly evaluate the Seq, but just keeps the reified bits around instead of falling off the end
teatime So, I'm wanting to make a compact syntax for XCompose file generation; I was planning to do this with Python, so forgive that I'm about to link to Python syntax, but I'm interested how it might look in Perl and/or Perl6 (since these would likely be both more concise and more sensible for creating this DSL-like thing.) Examples/syntax/functionality (very preliminary) at
(also, if you want to make suggestions about the syntax/features itself, *please do*) 15:06
awwaiid psch: I just don't know why you'd ever want (^5 X ^5) inside one iteration of a loop to be the same Seq on a second iteration. If I wanted that I should define it outside the loop 15:07
15:07 cognominal left 15:09 cognominal joined
psch awwaiid: fair enough. in that case i suggest talking to someone who's firmer with Seq semantics than me :) 15:09
awwaiid m: for ^2 { my $n = 5; say [+] (^$n X ^$n) } ; for ^2 { say [+] (^5 X ^5) } # when we use a variable for the generator it forces it to be re-created on each iteration
camelia rakudo-moar 843741: OUTPUT«50␤50␤50␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤ in block <unit> at /tmp/OKykQ60rge line 1␤␤»
psch yeah, cause that could change
but an X between literal changes is constant folded i guess vOv 15:10
m: for ^2 { constant n = 5; say [+] (^n X ^n) }
camelia rakudo-moar 843741: OUTPUT«50␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤ in block <unit> at /tmp/GQkymz1Cdj line 1␤␤»
psch s/changes/Ranges/
Ben_Goldberg m: for ^2 { say [+] (^(+5) X ^(+5)) } 15:11
camelia rakudo-moar 1ad917: OUTPUT«50␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤ in block <unit> at /tmp/ZJWIOoB3P3 line 1␤␤»
Ben_Goldberg m: for ^2 { say [+] (^(($_-$_+5) X ^($_-$_+5)) }
camelia rakudo-moar 1ad917: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TiX41hp4fX␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at /tmp/TiX41hp4fX:1␤------> 3^2 { say [+] (^(($_-$_+5) X ^($_-$_+5)) 7⏏5}␤ expecting any of:␤ …»
teatime I will flesh it out some more; maybe with more meat, people will be more interested.
Ben_Goldberg m: for ^2 { say [+] (^($_-$_+5) X ^($_-$_+5)) }
camelia rakudo-moar 1ad917: OUTPUT«50␤50␤»
awwaiid if I write them next to each other it doesn't see them as the same either 15:12
m: say [+] (^5 X ^5) ; say [+] (^5 X ^5)
camelia rakudo-moar 1ad917: OUTPUT«50␤50␤»
psch m: say [X~] (<c C>, <o O>, <a>, <b B>) 15:13
camelia rakudo-moar 1ad917: OUTPUT«(coab coaB cOab cOaB Coab CoaB COab COaB)␤»
psch teatime: i don't really know why that needs a DSL, fwiw :)