»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by sorear on 25 June 2013. |
|||
raydiak | r: say [1,2,3,4,5][4,3,2,1][1,2,3][2,1][1] | 00:01 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3» | ||
00:12
perigrin_ joined,
perigrin_ is now known as perigrin
|
|||
timotimo | i made a tiny bit of progress on little_big_int \o/ | 00:20 | |
00:23
kst joined
00:26
ajr_ left
|
|||
PonderingDonkey | can reduction operators be used at the end of a list? | 00:28 | |
00:28
treehug88 left
|
|||
PonderingDonkey | so instead of: [+] 1..100 we have something like (1..10).[+] | 00:29 | |
00:33
Adriaaan left
|
|||
smls | p: say (1..10).reduce(&[+]); # you can do this | 00:34 | |
camelia | rakudo-parrot 4a74e7: OUTPUT«55» | ||
smls | p: say (1..10).reduce(&infix:<+>); # long form | 00:35 | |
camelia | rakudo-parrot 4a74e7: OUTPUT«55» | ||
00:43
skids joined
00:50
bjz joined
|
|||
PonderingDonkey | nice. thanks | 00:51 | |
00:56
raiph left
01:04
jeffreykegler left,
jeffreykegler joined
01:12
ingy2 is now known as ingy
01:19
jnap left
01:24
btyler joined
|
|||
TimToady_ | p: say (1..10).reduce(*+*) | 01:25 | |
camelia | rakudo-parrot 4a74e7: OUTPUT«55» | ||
TimToady_ | at bit shorter | ||
but &[+] is probably faster | |||
01:28
jeffreykegler left
01:35
raiph joined
01:38
bloonix joined
|
|||
timotimo | humans align to words anyway | 01:45 | |
01:47
rurban left,
fridim_ left
01:50
ggoebel1113 joined
01:58
jnap joined
02:01
kbaker joined
|
|||
clsn__ | On my other computer, my \x=20 works but my \φ=20 doesn't and I can't figure out why. Must be something weird in the compiling. | 02:01 | |
timotimo | libicu? | 02:02 | |
02:07
aindilis joined
|
|||
clsn__ | I dunno. I'm not too worried about it, I guess, since it plainly isn't a bug in rakudo or anything. | 02:07 | |
02:08
ggoebel1113 left
|
|||
clsn__ | r: subset Even of Int where * % 2; my Even $e; $e=2; say $e.succ; | 02:14 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '$e'; expected 'Even' but got 'Int' in block at /tmp/tmpfile:1» | ||
clsn__ | r: subset Even of Int where * % %2; my Even $e; $e=2; say $e.succ; | 02:15 | |
02:15
benabik left
|
|||
camelia | rakudo-parrot 4a74e7: OUTPUT«use of uninitialized value of type Nil in numeric context in block at /tmp/tmpfile:1Divide by zero using infix:<%> in method sink at gen/parrot/CORE.setting:12235 in method BUILDALL at gen/parrot/CORE.setting:918 in method bless at ge…» | 02:15 | |
..rakudo-moar 4a74e7: OUTPUT«use of uninitialized value of type Nil in numeric contextDivide by zero using infix:<%> in block at src/gen/m-CORE.setting:12218 in sub infix:<%> at src/gen/m-CORE.setting:4404 in sub infix:<%> at src/gen/m-CORE.setting:4012 in sub infi…» | |||
..rakudo-jvm 4a74e7: OUTPUT«use of uninitialized value of type Nil in numeric contextDivide by zero using infix:<%> in method sink at gen/jvm/CORE.setting:12214 in method BUILDALL at gen/jvm/CORE.setting:923 in method bless at gen/jvm/CORE.setting:842 in method new …» | |||
clsn__ | argh, irc client eating my percent signs. | ||
r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.succ; | |||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3» | ||
clsn__ | That's probably right... though I find myself wondering if "4" isn't a better answer. It's probably right as is. | ||
02:20
Sqirrel joined,
nwc10_ is now known as nwc10
02:21
raiph left
02:23
Sqirrel_ left
|
|||
clsn__ | Hmm. But tricky to make a sub that will do the other thing. Have to run the parameter's refinement on the local var somehow. | 02:25 | |
02:27
raiph joined
|
|||
clsn__ | Yay. sub subsucc(\x) { my $n=x; $n=$n.succ; my $w=x.VAR.of.^refinement; $n=$n.succ while !$w($n); $n }. Have to pull the code into a var so it doesn't get an invocant. | 02:28 | |
02:31
btyler left
02:33
Sqirrel_ joined,
Sqirrel left
02:35
Sqirrel joined
02:38
Sqirrel_ left
02:46
kaleem joined
02:47
rurban joined
03:09
btyler joined
|
|||
colomon | r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; say $e.succ.WHAT | 03:10 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)(Int)» | ||
03:10
raiph left
|
|||
colomon | r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; $e =.succ; say $e.WHAT | 03:10 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)(Even)» | ||
colomon | r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; $e =.succ; say $e.WHAT; say $e | 03:11 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)(Even)(Even)» | ||
colomon | r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; $e = $e.succ; say $e.WHAT; say $e | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)Type check failed in assignment to '$e'; expected 'Even' but got 'Int' in block at /tmp/tmpfile:1» | ||
03:11
kbaker left
|
|||
clsn__ | Yeah, I've been experimenting etc... You can get the subset by looking at the .VAR.of of the variable. I was just tinkering with something like that on parameters, and then the sub would introspect... | 03:13 | |
It's kind of dumb though (the latter thing I'm playing with). Subsets in signatures get translated to parameters with constraints, which is okay, but if you know the subset when you're writing the signature you might as well just put the condition inside the code rather than have to introspect to find it. You shold know it already. | 03:14 | ||
03:15
btyler left
03:17
btyler joined,
tokuhirom joined
03:21
rurban left
|
|||
japhb__ | .tell pmichaud Congratulations to @child[1], and good luck to @child[0]! | 03:23 | |
03:27
kurahaupo_mobile left
|
|||
colomon | clsn__: sorry, got distracted there. seems to me the problem is there's no reason the where clause should be simple. | 03:27 | |
gh, kebard j sped wrkng agan. :( | 03:28 | ||
BenGoldberg | .ping | 03:37 | |
No bot around listening for .tell | 03:38 | ||
lue | oh wow, even preflex is gone. | 03:41 | |
colomon | clsn__: what I was trying to say... | 03:42 | |
r: subset SmallPrime of Int where { $_ < 100 && $_.is-prime }; my SmallPrime $sp = 2; $sp = $sp.succ; say $sp; $sp = sp.succ; | 03:44 | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfileUndeclared routine: sp used at line 1» | ||
colomon | r: subset SmallPrime of Int where { $_ < 100 && $_.is-prime }; my SmallPrime $sp = 2; $sp = $sp.succ; say $sp; $sp = $sp.succ; | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3Type check failed in assignment to '$sp'; expected 'SmallPrime' but got 'Int' in block at /tmp/tmpfile:1» | ||
colomon wonders why he doesn't always use his external Mac keyboard, much nicer typing on it than the MBP's keyboard. | 03:45 | ||
03:45
smls left
|
|||
colomon | afk # got to try to finish reading Republic of Thieves so I can start reading Steles of the Sky. | 03:46 | |
03:49
kaleem left
03:51
jnap left
03:57
aindilis` joined
03:59
aindilis left
04:00
uvtc joined
|
|||
uvtc | jnthn , thanks for posting your recent 2014 fosdem slides. :) Aside from the content itself, they were quite entertaining. Great images in there. | 04:01 | |
phenny, are you still around? | 04:02 | ||
bots, roll call! | 04:03 | ||
04:05
clkao__ is now known as clkao_
|
|||
uvtc | (jnthn, I meant to imply that the content was great and interesting on its own.) | 04:06 | |
04:08
btyler left
04:15
jeffreykegler joined
04:19
rurban joined
04:21
jnap joined
04:26
jnap left
|
|||
uvtc | Not sure exactly what would make for a suitable GSoC project, but it would be nice to have a Kate syntax description file for Perl 6, such that some more editors could highlight P6, as well as Pandoc. | 04:37 | |
japhb__ | I added a number of additional GSoC project ideas just now. | 04:39 | |
uvtc: You should add yours to the existing doc! | |||
uvtc | Would the syntax definition file idea be suitable for a GSoC project though? Not sure of the specific GSoC goals I suppose. | 04:40 | |
[Coke] | moritz: etoomuchdayjob | 04:41 | |
uvtc | Hm. Seems like maybe not suitable. That is to say, you probably want coding projects which benefit the student a bit more... | 04:42 | |
Is there already a site with some of those nice svg plots showing Perl 6 impl performance data over time? | 04:47 | ||
04:48
aindilis` left
|
|||
uvtc | I thought there was one for Rust. Maybe <huonw.github.io/isrustfastyet/>. Could've sworn there was another one for some $other-lang... | 04:49 | |
diakopter | js | ||
arewefastyet.con | |||
uvtc | Ah. Thanks, diakopter . I think that was it. | 04:50 | |
diakopter | you know, the language that's a few thousand times more used than rust :) | ||
(also from mozilla) | |||
uvtc | hehehe. Yes, that obscure language slipped my mind. :) | ||
Well, anyhow, I'd rather see a Perl 6 tutorial than a perf site. But though it might be worth mentioning as a potential idea for GSoC. | 04:51 | ||
s/though/thought/ | |||
04:51
rurban left
04:53
Sqirrel_ joined,
Sqirrel left
04:54
Sqirrel_ left,
Sqirrel joined
|
|||
uvtc | Oh. Right. There's perl6/bench-scripts. Wasn't someone running them at some point and graphing the data? Maybe [Coke] ? | 04:57 | |
04:59
Sqirrel left
|
|||
japhb__ | uvtc: I'm editing the ideas list now -- did you want me to put that in the list for you? | 05:00 | |
uvtc | I don't remember if an "are we fast yet?" site was already done in the past, and then scrapped for whatever reason. | 05:01 | |
Also, I think I still have my commit bit, though it's not been sharpened in some time. :) | 05:02 | ||
japhb__, Thanks for asking, regardless. :) | |||
05:04
rurban joined
|
|||
japhb__ | uvtc: timotimo and I recently (and several others in the past) have asked for an arewefastyet or speed.pypy styled site, based on perl6-bench (which may need some minor improvements to support such a thing, and will definitely need more tests). | 05:05 | |
05:05
BenGoldberg left
|
|||
japhb__ | I think it would be an excellent GSoC project. | 05:05 | |
05:06
jeffreykegler left
|
|||
japhb__ | OK, I've committed my latest ideas. uvtc, you're up. :-) | 05:07 | |
lue | "hasn't been implemented in any backend yet ... could implement this in the JVM or the MoarVM backend." well then :) | 05:12 | |
uvtc | japhb__, Ok, added that GSoC idea. :) | 05:15 | |
All the bots are on vacation it seems. Sipping digital martinis on some luxury virtual cruise. | 05:16 | ||
05:22
jnap joined
|
|||
masak | morning, #perl6 | 05:26 | |
05:27
jnap left,
[Sno] left
|
|||
diakopter | masak: g'morn | 05:28 | |
japhb__ | uvtc: expanded. :-) | 05:29 | |
uvtc | japhb__, Nice. | 05:30 | |
japhb__ | raydiak: OK, that's a doozy of a pull request. It may take me a day or two to get that reviewed. | ||
05:38
berekuk joined
05:39
uvtc left
05:48
rurban left
05:50
krunen joined
|
|||
PonderingDonkey | why is this producing different results: | 05:53 | |
r: my %hash = (3=>"C",1=>"A",2=>"Z") ; .say for %hash.sort | |||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«"1" => "A""2" => "Z""3" => "C"» | ||
PonderingDonkey | r: my %hash = (3=>"C",1=>"A",2=>"Z") ; %hash.sort>>.say | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«"3" => "C""1" => "A""2" => "Z"» | ||
PonderingDonkey | does >> still operating on the "unsorted" list | 05:54 | |
simarly | 05:56 | ||
r: my @=(5,3,4); @a.sort.say | |||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfileVariable '@a' is not declaredat /tmp/tmpfile:1------> my @=(5,3,4); @a.sort.say⏏<EOL> expecting any of: …» | ||
PonderingDonkey | r: my @a=(5,3,4); @a.sort.say | 05:57 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3 4 5» | ||
PonderingDonkey | r: my @a=(5,3,4); @a.sort>>.say | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«534» | ||
PonderingDonkey | concurrency? | ||
different results in term of ordering | 05:59 | ||
TimToady_ | correct, you may rely only on the ordering of values returned--you may not rely on the order of side effects | 06:05 | |
and IO is a side effect | |||
06:06
TimToady_ is now known as TimToady,
TimToady left,
TimToady joined
|
|||
PonderingDonkey | thanks | 06:10 | |
masak | "First off, you're in for a lot of work…years of work…most of which will be wandering in the desert." -- www.drdobbs.com/architecture-and-de.../240165488 | 06:15 | |
TimToady | if you ain't Moses, don't start :) | ||
06:16
kurahaupo_mobile joined
|
|||
masak .oO( let's not split hairs^Wseas here ) | 06:19 | ||
06:19
rurban joined
|
|||
lue | masak: "The first tool that beginning compiler writers often reach for is regex. Regex is just the wrong tool for lexing and parsing" obviously never seen Perl 6 :P | 06:21 | |
06:23
jnap joined
|
|||
masak | lue: well, there *is* a distinction between "regex" and "parser" ;) | 06:23 | |
I had a talk about that, but it seems I didn't put it online... :/ | 06:24 | ||
well, not as a PDF, at least. | 06:26 | ||
lue: see here: github.com/masak/talks/blob/master...ges/slides | |||
lue | masak: to be fair, I've only ever seriously used regexes in Perl 6, so that may affect my personal connotations of what regexes are :) | ||
masak | hehe. | 06:27 | |
lue: I have a prototypical anti-example for you: daringfireball.net/projects/markdown/ | 06:28 | ||
lue: go ahead and have a peek at the Perl 5 code that drives that parser/emitter. | |||
06:28
jnap left
|
|||
lue | To the point where one of my "eventually" projects is a libp6regex for C++. I just like P6 regexes (and grammars) too much I guess :) | 06:28 | |
masak | that's exactly how *not* to use regexes for parsing. | ||
tadzik | good morning! | ||
masak | tadzik! \o/ | ||
lue: don't get me wrong -- that .pl file is very successful, and heavily used. I use it for my blog. but it's not the way to parse a language. Perl 6 grammars would have been much better. | 06:29 | ||
06:29
[Sno] joined
|
|||
masak | lue: this is a much better way to parse it: github.com/gildor478/ocaml-markdow...arkdown.ml | 06:30 | |
06:31
nebuchad` joined
06:32
DrEeevil joined,
kaare__ joined
06:33
ashleyde1 joined
06:34
Gothmog__ joined,
bloonix_ joined
06:38
bloonix left,
bjz left,
kaare_ left,
labster left,
PerlJam left,
lee__ left,
Gothmog_ left,
TimToady left,
bonsaikitten left,
xenoterracide left,
woolfy left,
ashleydev left,
Gothmog__ is now known as Gothmog_
06:39
PerlJam joined
06:40
lee__ joined
|
|||
moritz | \o | 06:40 | |
tadzik | hello | ||
06:40
retupmoca joined
|
|||
tadzik | moar, moar ideas to GSoC page! | 06:40 | |
is there a plan to start as a Rakudo org? | 06:41 | ||
06:43
xenoterracide joined
06:45
lue joined
06:46
woolfy joined
06:51
kaleem joined
|
|||
masak | lue: I maded you a talk PDF: masak.org/carl/lpw-2011-small-languages/talk.pdf :) | 06:51 | |
there's still a lot of context missing -- things I said out loud that are not in the slides -- but I think the basic idea of "don't use regexes, write real parsers" comes through. | 06:52 | ||
06:52
rurban left
06:54
alexghacker joined
|
|||
masak | guten morgen, moritz | 06:59 | |
07:16
SamuraiJack joined
07:25
darutoko joined
07:27
TimToady1 joined
|
|||
masak is on a train | 07:40 | ||
diakopter is not on a train | 07:41 | ||
masak | the train got stuck after another (slower) train, and the service manager on board was being very passive-aggressive about it on the PA system. | ||
saying things like "apparently they don't feel like letting us past" and "we called traffic control, and they were spectacularly unhelpful about the whole thing" | |||
07:42
berekuk left
|
|||
diakopter | "maybe we should get out and push" | 07:42 | |
07:43
krunen left
07:44
SamuraiJack left
07:45
dmol joined
07:50
rurban joined,
regreg joined
07:54
dayangkun left
07:59
FROGGS joined
08:01
rindolf joined
08:06
zakharyas joined
08:07
regreg left
08:09
rurban left
08:17
Ven joined
08:20
darutoko- joined
08:21
darutoko left
08:24
jnap joined
08:29
jnap left
08:33
pdcawley joined
|
|||
raydiak | japhb__: yeah, sorry if I made work for you; hadn't seen you chat for a while, and didn't want to keep bugging with questions, so I just kinda went with it; there are rough spots and plenty to discuss at some point, but I figured doing it would be better than not :) | 08:36 | |
08:39
yakudza joined
08:46
ribasushi joined
|
|||
ribasushi | what the hell... | 08:47 | |
can someone see what was my quit message? | |||
no idea how I fell off... | |||
raydiak | last one I see for you is a split | 08:48 | |
it's been raining DDoSes on freenode lately | |||
ribasushi | ah, that may have been why | ||
Ven | r: say [1, 2].WHICH | 08:56 | |
camelia | rakudo-moar 4a74e7: OUTPUT«Array|139746001520328» | ||
..rakudo-jvm 4a74e7: OUTPUT«Array|1668028044» | |||
..rakudo-parrot 4a74e7: OUTPUT«Array|7540192417656216563» | |||
diakopter | p: say 7540192417656216563.is-prime | 08:57 | |
camelia | rakudo-parrot 4a74e7: OUTPUT«False» | ||
moritz | masak++ # slides | 08:59 | |
09:00
ribasushi left,
SamuraiJack joined,
ribasushi joined,
itz left
|
|||
woolfy | Wow, Damian Conway does a course on Perl 6 in Switzerland on April 9: it.oetiker.ch/consulting/courses/2014.en.html | 09:07 | |
tadzik | nice! | ||
09:08
dayangkun joined
|
|||
Ven | Is there a feature perl6 doesn't have you wish it had ? ;D | 09:15 | |
moritz | does "speed" count as a feature? | ||
mature IO system | 09:16 | ||
Ven | moritz: "speed" is implementation-dependant | 09:18 | |
Timbus | i was going to answer but moritz cut me off :< | ||
ill add 'lower memory requirements' then | 09:19 | ||
Ven | then again, that doesn't seem to be specifically tied to the language | ||
Timbus | or language features eh | ||
09:19
rurban joined
|
|||
Timbus | oh* | 09:19 | |
tadzik | IO, IO | 09:20 | |
Ven | yeah, else it's not specifically related to the language. | ||
moritz | and honestly, I'm not entirely happy with our current object initialization system | ||
Ven | moritz++ # I can agree some parts seem tricky for not much reason | 09:21 | |
p: say +^1 | 09:22 | ||
camelia | rakudo-parrot 4a74e7: OUTPUT«-2» | ||
Timbus | uhm... i would have liked less strange coroutines i guess, but the current concurrency (woah) spec really fills in that hole | ||
09:25
jnap joined
09:26
SamuraiJack left
|
|||
Ven | Timbus++ # I'd like to see different keywords, need to finish reading the syn about concurrency | 09:26 | |
09:29
jnap left
09:33
kaleem_ joined
09:35
kaleem left
09:38
dakkar joined
09:52
rurban left
09:55
Gruber is now known as Grrrr
10:07
zakalwe joined
10:23
kurahaupo_mobile left
10:26
jnap joined
|
|||
tadzik | looks like twitter is pretending to be iOS7 now | 10:27 | |
10:27
yoleaux joined,
ChanServ sets mode: +v yoleaux
|
|||
FROGGS | yoleaux: \o/ | 10:27 | |
10:27
yves_ left
|
|||
tadzik | fsvo of leaux :P | 10:28 | |
FROGGS | hehe | 10:29 | |
10:30
jnap left
|
|||
tadzik | it's a funny world we live in, where I say "fsvo of leaux" and it's perfectly understandable in some circles :) | 10:30 | |
timotimo | o/ | 10:34 | |
10:41
kaleem_ left,
yves_ joined,
FROGGS left,
FROGGS joined
10:43
mtj_ joined
10:44
fridim_ joined
10:45
nebuchad` is now known as nebuchadnezzar
|
|||
tadzik | \o | 10:47 | |
10:54
Shozan is now known as SHODAN
|
|||
timotimo added a peephole optimizer to the GSoC ideas | 10:58 | ||
FROGGS | O.o | ||
11:01
diakopter joined
|
|||
timotimo | the last time i looked, i didn't see very obvious optimization opportunities, but i was looking at the output of some nqp or rakudo source file | 11:03 | |
it'd be better to look at some custom code instead | |||
11:05
broquain1 is now known as broquaint
11:06
telex joined
|
|||
tadzik | . o O ( Python for MoarVM ) | 11:07 | |
well, domain-specific hilighting is on my "somebody do this" list, but hardly Perl6 related | 11:09 | ||
timotimo | what does that imply? | 11:10 | |
tadzik | well, I'm not particularly fond of syntax hilighting. But it'd we awesome to have vim hilighting based on profiling, or test coverage | ||
so you don't need an additional viewer for those | |||
11:19
SamuraiJack joined
11:27
jnap joined
|
|||
timotimo | i have a key binding + function that highlights lines based on their indentation level with grayscale | 11:30 | |
also, vim has support for icons to be placed on the left side in the gutter | 11:31 | ||
11:31
jnap left
11:35
molaf joined,
eiro joined
11:43
pecastro joined
11:47
dmol left,
dmol joined
11:49
fridim_ left
11:57
kaleem joined
11:59
rurban joined
12:12
denis_boyun joined
12:22
sunnavy joined
12:23
JimmyZ joined
12:24
rindolf left
12:25
rurban left
12:27
jnap joined
12:28
xinming left,
xinming joined
12:30
wingfold joined
12:32
jnap left
12:35
atroxaper joined
12:37
wingfold left
12:48
rindolf joined
|
|||
Ven | r: 0, 1, *+* ... * > 100 | 12:48 | |
camelia | ( no output ) | ||
Ven | r: say 0, 1, *+* ... * > 100 | 12:49 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«0 1 1 2 3 5 8 13 21 34 55 89 144» | ||
Ven | not sure I understand that. I thought `$^a ... $^b > $^c` means "execute $^a for $^b..$^c" | 12:50 | |
timotimo | er .. wha? | 12:51 | |
Ven | *s03* | ||
timotimo | how did you get to $^a from that? | ||
moritz | Ven: the series operator is a bit more involved than that | 12:52 | |
r: say 1, 2, 4 ... * > 1000 | |||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«1 2 4 8 16 32 64 128 256 512 1024» | ||
Ven | it can ... "guess" the difference ? | 12:53 | |
moritz | yes | ||
m: say 1, 3, 5 ... 11 | |||
camelia | rakudo-moar 4a74e7: OUTPUT«1 3 5 7 9 11» | ||
Ven | m: say 1, 5 ... 100 | 12:54 | |
camelia | rakudo-moar 4a74e7: OUTPUT«(timeout)» | ||
Ven | m: say 1, 5 ... 30 | ||
camelia | rakudo-moar 4a74e7: OUTPUT«(timeout)» | 12:55 | |
timotimo | m: say (1, 5 ... 100)[^20] | ||
camelia | rakudo-moar 4a74e7: OUTPUT«1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77» | ||
timotimo | it never hits 100, or 30 | ||
12:55
lizmat left
|
|||
Ven | 1, 5 ... > 100 | 12:55 | |
12:55
xinming_ joined
|
|||
timotimo | needs a * to create a closure | 12:55 | |
Ven | m: 1, 5 ... * > 100 | ||
camelia | ( no output ) | ||
Ven | m: say 1, 5 ... * > 100 | 12:56 | |
camelia | rakudo-moar 4a74e7: OUTPUT«1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101» | ||
Ven | Damn I'm used to my REPL | ||
m: say 1, 5 ...^ * > 100 | |||
timotimo | :) | ||
camelia | rakudo-moar 4a74e7: OUTPUT«1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97» | ||
Ven | timotimo++ # ^ is used to discard the first non-matching value | ||
m: 1, 2, 5 ... * > 30 | |||
camelia | rakudo-moar 4a74e7: OUTPUT«Unhandled exception: Unable to deduce sequence at src/gen/m-CORE.setting:10811 (/home/p6eval/rakudo-inst-2/languages/perl6/runtime/CORE.setting.moarvm:throw:129) from src/gen/m-CORE.setting:12212 (/home/p6eval/rakudo-inst-2/languages/perl6/runtim…» | ||
timotimo | the first matching value, actually | 12:57 | |
Ven | uh, yeah. | ||
did not negate the correct part of the sentence | 12:58 | ||
12:58
xinming left
|
|||
Ven | m: [1] + (0, 5 ... 100)[1..*] | 12:59 | |
camelia | ( no output ) | ||
Ven | m: say [1] + (0, 5 ... 100)[1..*] | ||
camelia | rakudo-moar 4a74e7: OUTPUT«21» | ||
Ven | m: say [1] Z (0, 5 ... 100)[1..*] | 13:00 | |
camelia | rakudo-moar 4a74e7: OUTPUT«1 5» | ||
Ven | m: say (0, 5 ... 100)[1..*].perl | ||
camelia | rakudo-moar 4a74e7: OUTPUT«(5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100)» | ||
Ven | m: say [1].append (0, 5 ... 100)[1..*] | 13:01 | |
camelia | rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/3JHA2k_CxxTwo terms in a rowat /tmp/3JHA2k_Cxx:1------> say [1].append ⏏(0, 5 ... 100)[1..*] expecting any of: method arguments postfix …» | ||
timotimo | you want the , operator | ||
r: say (1, (0, 5 ... 100)) | |||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«1 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100» | ||
timotimo | r: say (1, (0, 5 ... 100)).perl | 13:02 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(1, (0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100).list)» | ||
timotimo | r: say (1, (0, 5 ... 100)).list.perl | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(1, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100).list» | ||
Ven | that's nested, isn't it ? | ||
timotimo | you don't need .list if you assign it to an @ variable or iterate over it | ||
because those operations impose a flattening context | |||
for (1, (0, 5 ... 20)) { say "v: $_" } | |||
m: for (1, (0, 5 ... 20)) { say "v: $_" } | |||
camelia | rakudo-moar 4a74e7: OUTPUT«v: 1v: 0v: 5v: 10v: 15v: 20» | ||
Ven | Uhm ... I'm not sure I like automatic flattening | 13:03 | |
timotimo | it's just that the , operator in this case doesn't impose any sort of context and you'll have to decide for yourself | 13:04 | |
.tree and .lol and .item are your friend | |||
(not your food) | |||
Ven | . | 13:05 | |
m: (1,).^name.say; [1].^name.say; | |||
camelia | rakudo-moar 4a74e7: OUTPUT«ParcelArray» | ||
Ven | I don't get the need for both "lists" and "arrays" | 13:06 | |
timotimo | the big difference is containers | ||
i constantly confuse which one is which, though :P | |||
m: my $foo = [1, 2, 3]; my $bar := $foo[1]; $bar = 100; say $foo | |||
camelia | rakudo-moar 4a74e7: OUTPUT«1 100 3» | ||
timotimo | m: my $foo = (1, 2, 3).list; my $bar := $foo[1]; $bar = 100; say $foo | 13:07 | |
camelia | rakudo-moar 4a74e7: OUTPUT«No such method 'STORE' for invocant of type 'Int' in block at /tmp/LTZ8bhLV69:1» | ||
timotimo | as you can see, the list does not have a container we can use for binding | ||
13:09
rurban joined
|
|||
timotimo | does that help you any? | 13:09 | |
Ven | timotimo: Yeah, that does. I really dislike the idea that everything is a ref, though. | ||
moritz | native types aren't refs | ||
Ven | yeah but that's an Int here, right | 13:10 | |
or is that because of := ? | |||
timotimo | no, it does create an Int | ||
tadzik | I think you'll find that it doesn't bother you as much as you think it would :) | ||
timotimo | unless you specifically ask for an int, you get an Int | ||
Ven | well, the thing I really dislike is that, if 2 different lists share an element at pos. 0, if you modify $list[0], $list2 would be different too | 13:12 | |
timotimo | you only get that if you :=, though | ||
tadzik | r: my @a = (1, 2, 3); my @b = @a; @b[0] = 5; say @a.perl | 13:13 | |
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new(1, 2, 3)» | ||
tadzik | r: my @a = (1, 2, 3); my @b = @a; @b[0]++; say @a.perl | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new(1, 2, 3)» | ||
Ven | m: my $val := 1; $l = [$val, 2, 3]; my $l2 = [$val, 5, 6]; $l[0] = 100; say $l2.perl | ||
camelia | rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/m39ZzIq_f6Variable '$l' is not declaredat /tmp/m39ZzIq_f6:1------> my $val := 1; $l⏏ = [$val, 2, 3]; my $l2 = [$val, 5, 6];  expecting any of: postfix» | ||
tadzik | now you're forcing it | ||
13:13
skids left
|
|||
Ven | m: my $val := 1; my $l = [$val, 2, 3]; my $l2 = [$val, 5, 6]; $l[0] = 100; say $l2.perl | 13:13 | |
camelia | rakudo-moar 4a74e7: OUTPUT«[1, 5, 6]» | ||
tadzik | why would you do binding in the first place? | 13:14 | |
Ven | better keep away from := then | ||
timotimo | the assignment you did to $l and $l2 copied the target of the container into a new container | ||
(that's what arrays do) | |||
you have to ask for binding much more explicitly for it to happen to you | 13:15 | ||
and when it happens, you will very rarely be surprised | |||
Ven | I don't get the distinction between list and array nor the need for it in the first place. It seems weird to have several types of sets | ||
timotimo | at least you're not asking for WTH there is a Parcel on top of that as well :P | 13:16 | |
Ven | I'll add that question then | ||
timotimo | haha :D | ||
well, one thing i have to say is that there's a rewrite of the synopsis for lists and friends coming up | 13:17 | ||
that's the reason why Nil still disappears in flattening context on rakudo; we're waiting until all changes to the list synopsis are done before changing big things around in the implementation | |||
moritz | ... assuming that such a mythical condition is every fulfilled | 13:18 | |
Ven | But is there a "better" container ? Why does list require "@" while arrays dont ? | ||
timotimo | list does not require @ | 13:19 | |
moritz | Ven: the sigils are about what flattens | ||
so you can put anything into a $ that can be put into a @ | |||
it just won't flatten when you iterate over it | |||
Ven | okay -- need some paracetamol ... | ||
timotimo | r: my %foo := (1, 2, 3).list; say %foo # what the hell are you doing?! | ||
camelia | rakudo-moar 4a74e7: OUTPUT«Type check failed in binding; expected 'List' but got 'Associative' in any bind_error at src/vm/moar/Perl6/Ops.nqp:216 in block at /tmp/tmpfile:1» | ||
..rakudo-parrot 4a74e7, rakudo-jvm 4a74e7: OUTPUT«Type check failed in binding; expected 'Associative' but got 'List' in block at /tmp/tmpfile:1» | |||
moritz | doc.perl6.org/language/containers | ||
timotimo | haha | 13:20 | |
wat :D | |||
moritz | that's my attempt to provide a cohesive picture | ||
timotimo | that's funny | ||
moritz | it's also sad :( | ||
timotimo | no, i meant the output of camelia there | ||
moritz | yes | ||
timotimo | i have an idea why it might happen, though | ||
Ven | OKAY - so @ means that everything will be flattened. At least for lists. | 13:21 | |
13:21
kaleem left
|
|||
Ven | m: my $a = (1, (2, (3, 4))); for $a { .perl.say } | 13:21 | |
camelia | rakudo-moar 4a74e7: OUTPUT«$(1, (2, (3, 4)))» | ||
Ven | . | ||
moritz | m: my @a = (1, (2, (3, 4))); say .perl for @a | 13:22 | |
camelia | rakudo-moar 4a74e7: OUTPUT«1234» | ||
Ven | yeah, cause @ is flattening. I understand that now. But what if I *don't* want to flatten ? | ||
moritz | then you could use .tree, for example | ||
r: say (1, (2, (3, 4))).tree.perl | 13:23 | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«LoL.new(1, $(2, (3, 4)))» | ||
moritz | that $(...) will prevent the list from flattening when you iterate over it | ||
timotimo | there we go. | ||
Ven | okay. So that's just on one level, right ? | ||
moritz | m: say .perl for (1, (2, (3, 4))).tree | ||
camelia | rakudo-moar 4a74e7: OUTPUT«1$(2, (3, 4))» | ||
timotimo | oh, i need to create a meme picture with a cat now. | ||
moritz | Ven: right | ||
13:24
kaleem joined
|
|||
Ven | if I want a structure to act as I nested it, is there an alternative to .tree that is recursive ? | 13:24 | |
timotimo | takelessons.com/blog/wp-content/upl...py-cat.gif "invisible rakudo commit" | ||
or rather "invizibl rakduo comit" | |||
[Coke] | moritz: mark keating just sent out a message about TPF submitting as a member org for GSOC | 13:25 | |
moritz | [Coke]: thanks, I've seen it | ||
Ven | .perl.say for [1, [2, [3, 4]]]; | ||
m: .perl.say for [1, [2, [3, 4]]]; | |||
camelia | rakudo-moar 4a74e7: OUTPUT«[1, [2, [3, 4]]]» | ||
FROGGS | [Coke]: and we are welcome to add our P6 tasks | ||
Ven | m: .perl.say for [1, [2, [3, 4]]].tree; | 13:26 | |
camelia | rakudo-moar 4a74e7: OUTPUT«1[2, [3, 4]]» | ||
Ven | m: [1, [2, [3, 4]]].tree.perl.say; | ||
camelia | rakudo-moar 4a74e7: OUTPUT«(1, [2, [3, 4]]).list» | ||
[Coke] | I imagine we should decide if we want to try going our own way. | ||
timotimo | yeah, tree listifies the outermost thingie and keeps all other things deeply-nested | ||
[Coke] | but if all we have to do is come up with ideas and let mark k. be the admin, that sounds vaguely winny. | ||
moritz | [Coke]: it does, if TPF actually gets in | 13:27 | |
timotimo | m: [1, [2, [3, 4]]].lol.perl.say; | ||
camelia | rakudo-moar 4a74e7: OUTPUT«LoL.new(1, [2, [3, 4]])» | ||
timotimo | wow, that took a while. | ||
moritz | does anybody remember on which host dalek usually runs, and as which user? | 13:28 | |
timotimo | shouldn't your irclog tell you? | ||
13:28
jnap joined
|
|||
timotimo | from the joins/parts/quits? | 13:28 | |
moritz | well, not the ones on the web | 13:29 | |
those don't track anything but nicks | |||
FROGGS | my brane says host07, but do not trust my brane | ||
moritz | and my irssi doesn't log joins and leaves | 13:30 | |
timotimo fixed the order of got/expected | |||
Ven | timotimo: I probably need to write some perl to get the gist of it. At first sight it really seems confusing and unnatural | ||
timotimo | it confused me a whole lot at the beginning, too | 13:31 | |
Ven | thanks for bearing with me, timotimo++ && moritz+= | ||
moritz | timotimo: shouldn't it simply throw the right exception type, and then methodd message takes care of | ||
FROGGS | FreeNode-#perl6.log:Sep 30 12:54:54 *dalek (~dalekbot@feather3.perl6.nl) hat #perl6 betreten | ||
moritz: ^^ | |||
moritz | FROGGS: do you have anything from this year too? :-) | ||
FROGGS | hold on | 13:32 | |
timotimo | moritz: it does throw the typed exception | ||
but it goes via the registration mechanism | |||
Ven | Looking forward to a possible rewrite about LoLs etc | ||
timotimo | and *that* registers a sub with *positional* arguments | ||
FROGGS | irc.perl.org-#parrot.log:Feb 01 13:12:34 *d4l3k_ (~dalekbot@feather3.perl6.nl) hat #parrot betreten | ||
irc.perl.org-#parrot.log:Feb 01 13:18:23 *d4l3k_ (~dalekbot@feather3.perl6.nl) hat #parrot betreten | |||
moritz | FROGGS: thanks | ||
FROGGS | yw | ||
13:33
jnap left,
dalek joined
13:34
ChanServ sets mode: +v dalek
|
|||
Ulti | Ven what languages do you know other than Perl6? | 13:35 | |
Ven | Ulti: asm, c, c++, c#, java, scala, tcl, ruby, js, php; for the most part | 13:36 | |
13:37
ajr joined
|
|||
Ulti | right so how do you deal with int[] Vector<Integer> ArrayList<Integer> LinkedList<Integer> in Java? | 13:37 | |
Ven | yea | ||
Ulti | int[] is super different to all the others | 13:38 | |
13:38
ajr is now known as Guest12587,
bloonix_ left,
Guest12587 is now known as ajr_
|
|||
Ven | I think arrays in java are a mistake | 13:38 | |
Ulti | but even C right, you have a linked list of structs or you can have an array of them | 13:40 | |
Ven | but yes, every container has different implementations. They however have the same API and don't have a backed-in syntax | ||
Ulti | and by array I dont necessarily mean something statically used and on the stack, you can malloc enough room for N structs in a row, or you can wrap a struct in some other struct with a null pointer and some pointers for previous and next in the list etc. | 13:41 | |
Ven | yes, you have linked lists, double linked lists, etc, but the only one who gets its own syntax is the array | ||
Ulti | Perl6 just has a different set of oddball things which are more homogenous in syntax | ||
Ven | you don't a[1] on double linked list, for example | ||
13:41
kaleem left
|
|||
Ulti | which is both confusing, but most of the time you dont notice because the syntax works for you rather than against you | 13:42 | |
Ven you could if you could overload the [] operator ;) | |||
Ven | not in C | ||
Ulti | sure | ||
Ven | and then again, that's library-wise, not a special *syntax* | 13:43 | |
there's not <[]> to create a linked list and >[]< to create a vector | |||
I thought I'd look at a simple example like conway's game of life. It seems to use "Array is dim (5, 5)" | 13:44 | ||
m: my @life = Array of bit is dim (20, 20) is default(0); @life.perl.say | 13:46 | ||
camelia | rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/PuLNQTZxcQTwo terms in a rowat /tmp/PuLNQTZxcQ:1------> my @life = Array ⏏of bit is dim (20, 20) is default(0); @l expecting any of: postfix i…» | ||
Ulti | also the word list and array is fairly well defined in general, list implies something containers/pointers-in-a-line like rather than the actual bits of data being in a line... usually to get around wanting different types of things in a line for the most part | ||
parcels are what get me in Perl6 | |||
Ven | m: my Array of bit @life is dim (20, 20) is default(0); @life.perl.say | ||
camelia | rakudo-moar 4a74e7: OUTPUT«===SORRY!===Type 'Array' is not declaredat /tmp/Y7zHUY2WfL:1------> my Array of ⏏bit @life is dim (20, 20) is default(0);Malformed myat /tmp/Y7zHUY2WfL:1------> my Array of ⏏bit @lif…» | ||
Ven | wut | 13:47 | |
moritz | the error message is wrong | 13:48 | |
it probably actually stubmles over 'bit' not being a known type | |||
m: bit | |||
camelia | rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/2oyyhTMsAmUndeclared routine: bit used at line 1» | ||
diakopter | m: my Array[bit] @life is dim (20, 20) is default(0); @life.perl.say | ||
Ven | m: my Array of Int @life is dim (20, 20) is default(0); @life.perl.say | ||
camelia | rakudo-moar 4a74e7: OUTPUT«===SORRY!===Cannot invoke null object» | ||
rakudo-moar 4a74e7: OUTPUT«===SORRY!=== Error while compiling /tmp/DmSPwlU61FCan't use unknown trait 'is dim' in a variable declaration.at /tmp/DmSPwlU61F:1------> my Array of Int @life is dim (20, 20) ⏏is default(0); @life.perl.say…» | |||
Ulti | also sized arrays aren't a thing yet either right? | ||
Ven | Ulti: that's from www.perlmonks.org/?node_id=253366 | 13:49 | |
13:51
atroxaper left
|
|||
moritz | Ven: don't trust Perl 6 advice (and especially syntax) from 2003 | 13:51 | |
13:51
kbaker joined
|
|||
Ven | oh whoops. Should check date first ! | 13:51 | |
Ulti | heh | ||
moritz | back then, there was basically nothing implemented of Perl 6, and the syntax was just a though in the wind | ||
Ulti | yeah the spec changes more often than once every 11 years atm :3 | 13:52 | |
Ven | I guess I just got used to advent gifts :p | ||
Ulti | hmmm | 13:53 | |
m: my Array of Int @life; @life = ((0) x 2 ).item x 2; say @life.perl; | 13:54 | ||
camelia | rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array[Int]' but got 'Str' in method REIFY at src/gen/m-CORE.setting:8363 in method reify at src/gen/m-CORE.setting:7252 in method reify at src/gen/m-CORE.setting:7235 in method reify at …» | ||
Ulti | m: my Array[Int] @life; @life = ((0) x 2 ).item x 2; say @life.perl; | ||
camelia | rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array[Int]' but got 'Str' in method REIFY at src/gen/m-CORE.setting:8363 in method reify at src/gen/m-CORE.setting:7252 in method reify at src/gen/m-CORE.setting:7235 in method reify at …» | ||
moritz | Ulti: this can never work, because (0 x 2).item isn't declare as Array[Int] | 13:55 | |
Ulti | ahh ok | ||
also its stringafying too | |||
which I didnt expect | |||
moritz | oh right, use xx instead | ||
x is string repetition | |||
xx is list repetition | |||
Ulti | m: my Array @life; @life = ((0) xx 2 ).item x 2; say @life.perl; | ||
camelia | rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array' but got 'Str' in method REIFY at src/gen/m-CORE.setting:8363 in method reify at src/gen/m-CORE.setting:7252 in method reify at src/gen/m-CORE.setting:7235 in method reify at src/g…» | ||
Ulti | doh two x! | 13:56 | |
m: my Array @life; @life = ((0) xx 2 ).item xx 2; say @life.perl; | |||
camelia | rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array' but got 'List' in method REIFY at src/gen/m-CORE.setting:8363 in method reify at src/gen/m-CORE.setting:7252 in method reify at src/gen/m-CORE.setting:7235 in method reify at src/…» | ||
diakopter | now that just kills me | ||
Ulti | heh and need to arrayafy | ||
o___O | |||
Ven | m: say ((0 xx 5).item xx 5).perl | ||
camelia | rakudo-moar 4a74e7: OUTPUT«((0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item).list» | ||
Ulti | m: my @life; @life = ((0) xx 2 ).item xx 2; say @life.perl; | ||
camelia | rakudo-moar 4a74e7: OUTPUT«Array.new((0, 0).list.item, (0, 0).list.item)» | ||
Ulti | \o/ | ||
sort of | |||
lol | |||
moritz | currently I recommand against using typed arrays | ||
diakopter | lol indeed | ||
Ulti | LoL even | 13:57 | |
moritz | r: my @live = [0 xx 5] xx 3; @live[1, 2] = 1; say @live.perl | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new([0, 0, 0, 0, 0], 1, Any)» | ||
moritz | r: my @live = [0 xx 5] xx 3; @live[1][2] = 1; say @live.perl | ||
diakopter | wait, why are those .item calls deferred in the .perl output? | ||
camelia | rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new([0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0])» | ||
moritz | deferred? | 13:58 | |
Ven | moritz++ # cleanest ! | ||
13:59
regreg joined
|
|||
Ulti | also the arrayest | 14:00 | |
Ven | I like arrays | 14:01 | |
Not to write my own Game of life | |||
diakopter | I like trains | ||
Ven | I like turtles | 14:02 | |
moritz | turtles like you! | ||
Ven | and they say "hello !" | 14:03 | |
Ulti | dont the more efficeint game of life implementations avoid allocating the whole world as a 2D array though, we need some fresh syntax in Perl6 for Octree or something more 2Deee | ||
is there a unicode character for an octopus leg? | 14:04 | ||
FROGGS | moritz: wiki.enlightenedperl.org/gsoc2014/ideas | ||
I put our stuff there too | |||
14:04
araujo left
|
|||
moritz | we don't need syntax for everything :-) Sometimes plain old method calls are fine :-) | 14:04 | |
FROGGS++ | |||
Ulti | U+1F419 | ||
diakopter | .u 1F419 | ||
yoleaux | U+1F419 OCTOPUS [So] (🐙) | ||
Ulti | emoji win on OSX :3 | 14:05 | |
14:05
araujo joined
|
|||
diakopter | fail on my OSX | 14:05 | |
Ven | $*OS eq 'MSWin32' ?? 'cls' !! 'clear' ==> shell; | 14:07 | |
@.grid.map(*.join).join("\n") # that's how I perl | 14:08 | ||
14:09
atroxaper joined
|
|||
Ven | Okay, that's enough perl for now, headaches. I'll read your article later, moritz | 14:09 | |
14:09
bjz joined
|
|||
moritz | :-) | 14:10 | |
Ven | Thanks all, really ! :) | ||
14:18
jnap joined
|
|||
masak | r: my @live = [0 xx 5] xx 3; @live[1, 2] = 1; say @live.perl | 14:34 | |
moritz: did you mean @live[1; 2] ? | |||
camelia | rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«Array.new([0, 0, 0, 0, 0], 1, Any)» | ||
moritz | masak: not sure what I meant, besides "thinko" | 14:40 | |
14:41
bluescreen10 joined
|
|||
masak | ;) | 14:42 | |
14:42
kaleem joined
14:44
btyler joined,
kaare__ left
|
|||
Timbus | <Ven> if I want a structure to act as I nested it, is there an alternative to .tree that is recursive | 14:48 | |
isnt that... | 14:49 | ||
flat? | |||
colomon | oooo, Octree module. Hmmm.... | ||
Timbus | my mind | ||
Ven | Timbus: not sure what you mean | ||
TimToady1 | .tree is *supposed* to be recursive, but it currently has the desired semantics of lol | 14:50 | |
Ven | oh. | ||
14:50
skids joined
|
|||
Ven | so it's just a "not-currently-working-as-indented" case? | 14:50 | |
TimToady1 | nodnod | 14:51 | |
FROGGS | Ven: that sounds like an invitation to rakudo core hacking :o) | ||
Ven | FROGGS: do-does it ? | ||
FROGGS | hehe | ||
yeah :o) | |||
Ven | o-oh, I see | 14:52 | |
lot of stuff I don't know in the compiler :D | 14:53 | ||
14:53
kaleem left
|
|||
FROGGS | ohh, rakudo is not that hard to grok | 14:53 | |
it is written in "our" language, you see | 14:54 | ||
Ven | I see. I've worked with self-hosted compilers before, so that doesn't surprise me that much :) | ||
FROGGS | cool! | 14:55 | |
Ven | I get "nom" is the dev branch ? | ||
FROGGS | no, it is the master branch | ||
Ven: what is your compiler experience ooc? | |||
Ven | FROGGS: mainly coffeescript/livescript | ||
also hacked a bit on MRI (ruby) | 14:56 | ||
FROGGS | cool | ||
TimToady1 | oh, I guess .tree is specced to default to .lol | ||
that's silly | |||
Ven | there's one on List and one on Any | 14:57 | |
(what's that :D:) | |||
TimToady1 | :D allows only happy values, : marks invocant | 14:58 | |
self | |||
Ven | uuu | ||
TimToady1 | where happy really means "definite", or instantiated, or some such | ||
anyway, leaves out the type objects | 14:59 | ||
Timbus | type objects werent happy about not being allowed in | 15:00 | |
FROGGS | there is alse :U for undefined, and in theory :T for type objects | ||
Ven | ah yes, nqp doesn't allow for non-primitive type checks right ? | 15:01 | |
masak | Ven: "nom" is the integration branch. dunno if that's what you mean by "dev branch". | ||
Ven | masak: I mean "where you work" | ||
masak | Ven: basically, if it passes all the old and new spectests, you can put the commit on nom. | ||
Ven: if it doesn't, you normally shouldn't. | |||
Ven: even if it does, sometimes you want to work in a (shared or private) branch. | |||
and later rebase/merge with nom. | 15:02 | ||
Timbus | m: (1, (2, 3, (4, 5))).tree[1][2].perl.say | 15:03 | |
camelia | rakudo-moar 44ab3c: OUTPUT«4» | ||
Timbus | so, that should be 4, 5 eh | 15:04 | |
Ven | that'd be sweet :) | ||
TimToady1 is respeccing .tree to make .tree default to .tree(*) | |||
Ven | m: (1, (2, 3, (4, 5))).tree(*)[1][2].perl.say | ||
camelia | rakudo-moar 44ab3c: OUTPUT«Cannot call 'tree'; none of these signatures match::(Any:U: *%_):(Any:D: *%_):(Any:D: Cool $count, *%_):(Any:D: &c, *%_) in method tree at src/gen/m-CORE.setting:1569 in block at /tmp/auh4NFzXBQ:1» | ||
TimToady1 | which in turn means apply .item everywhere | 15:05 | |
Ven | TimToady1: if you happen to fix that rakudo-side, mind linking the commit ? | ||
dalek | ecs: 977e82f | larry++ | S (2 files): respec tree to default to all levels also some initial Seq extirpation |
15:12 | |
Timbus | (1, (2, 3, (4, 5))).tree(100).perl # well that was scary to type into the repl | 15:13 | |
Ven | well. | 15:14 | |
m: (1, (2, 3, (4, 5))).tree(*).perl.say | |||
camelia | rakudo-moar 44ab3c: OUTPUT«Cannot call 'tree'; none of these signatures match::(Any:U: *%_):(Any:D: *%_):(Any:D: Cool $count, *%_):(Any:D: &c, *%_) in method tree at src/gen/m-CORE.setting:1569 in block at /tmp/yNblzQr8eU:1» | ||
Timbus | m: (1, (2, 3, (4, 5))).tree(2).perl.say | 15:16 | |
camelia | rakudo-moar 44ab3c: OUTPUT«((1,).list.item, LoL.new(2, 3, $(4, 5)).item).list» | ||
FROGGS .oO( ar ee es pee ee see RESPEC! ) | |||
15:17
treehug88 joined
15:18
daniel-s joined
|
|||
Ven | oh but the 1 gets nested too | 15:19 | |
15:20
alester joined
|
|||
Ven | m: .perl.say for (1, (2, 3, (4, 5))).tree(2) | 15:21 | |
camelia | rakudo-moar 44ab3c: OUTPUT«(1,).list.itemLoL.new(2, 3, $(4, 5)).item» | ||
Ven | m: .^name.perl.say for (1, (2, 3, (4, 5))).tree(2) | ||
camelia | rakudo-moar 44ab3c: OUTPUT«"List""LoL"» | ||
Timbus | m: (1, (2, 3, (4, 5))).tree(2)[0].say | ||
camelia | rakudo-moar 44ab3c: OUTPUT«1» | ||
Ven | I'd expect that to be Int[nl]LoL | ||
m: (1, (2, 3, (4, 5))).tree(2)[0].^name.say | 15:22 | ||
camelia | rakudo-moar 44ab3c: OUTPUT«List» | ||
Timbus | not dwimming. demand a refund | 15:23 | |
i want my fun back | |||
15:23
alester left
|
|||
Timbus | but yeah, .tree needs some sprucing up | 15:26 | |
TimToady1 | hmm, maybe I'm using * backwards | 15:27 | |
Timbus | its symmetrical tho ;o | 15:28 | |
TimToady1 | maybe it should mean I don't care what's below this | ||
so stop at this level | |||
15:28
isBEKaml joined
|
|||
TimToady1 | otherwise repeat the final mapper | 15:29 | |
Timbus | no i like it as is. whatever is down there, tree it' | ||
15:29
kaleem joined
|
|||
Ven | m: (1)succ | 15:32 | |
camelia | rakudo-moar 44ab3c: OUTPUT«===SORRY!=== Error while compiling /tmp/nhkjRYbnGDTwo terms in a rowat /tmp/nhkjRYbnGD:1------> (1)⏏succ expecting any of: postfix infix stopper infix or meta-infix …» | ||
TimToady1 | m: 1.succ | 15:33 | |
camelia | ( no output ) | ||
TimToady1 | m: 1.succ.say | ||
camelia | rakudo-moar 44ab3c: OUTPUT«2» | ||
15:33
Adriaaan joined
|
|||
TimToady1 | we only have 1 alpha postfix | 15:34 | |
m: say 1i | |||
camelia | rakudo-moar 44ab3c: OUTPUT«0+1i» | ||
15:35
zakharyas left
|
|||
masak | m: sub postfix:<j>($n) { $n\i }; say 1j | 15:35 | |
camelia | rakudo-moar 44ab3c: OUTPUT«0+1i» | ||
masak | \o/ | ||
m: sub postfix:<j>($n) { $n\i but role { method gist { "0+1j" } } }; say 1j | 15:36 | ||
15:36
ajr_ left
|
|||
camelia | rakudo-moar 44ab3c: OUTPUT«Not enough positional parameters passed; got 1 but expected 3 in method BUILD at src/gen/m-CORE.setting:10182 in method BUILD_LEAST_DERIVED at src/gen/m-CORE.setting:941 in sub infix:<but> at src/gen/m-CORE.setting:16131 in sub infix:<but> …» | 15:36 | |
masak | pff. | 15:37 | |
Ven | Need to read about `but` | ||
15:37
ajr joined,
ajr is now known as ajr_
|
|||
Ven | I've read it was supposed to be a contrary to `else`, IIRc | 15:37 | |
masak | Ven: using it for drive-by mixing-in here. | ||
Timbus | not quite.. | ||
Ven | looks like scala's with | 15:38 | |
masak | m: say (5 but False); say ?(5 but False) | ||
camelia | rakudo-moar 44ab3c: OUTPUT«5False» | ||
Timbus | yeah | ||
masak | m: my $special-int = 42 but role { method greet { say "OH HAI" } }; say $special-int; $special-int.greet | 15:39 | |
camelia | rakudo-moar 44ab3c: OUTPUT«42OH HAI» | ||
masak | m: my $special-int = 42 but role { method greet { say "OH HAI" } }; say $special-int.mro | ||
camelia | rakudo-moar 44ab3c: OUTPUT«No such method 'mro' for invocant of type 'Int+{<anon>}' in block at /tmp/QKe1JqyzKl:1» | ||
Ven | r: my @a = 42; @a.perl.say | ||
15:39
ajr_ left
|
|||
masak | m: my $special-int = 42 but role { method greet { say "OH HAI" } }; say $special-int.^mro | 15:39 | |
camelia | rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«Array.new(42)» | ||
rakudo-moar 44ab3c: OUTPUT«(Int+{<anon>}) (Int) (Cool) (Any) (Mu)» | |||
15:39
treehug88 left
|
|||
masak | that last example shows how it's implemented. (anon subclass) | 15:40 | |
Ven | masak++ # really cool, especially with subset. I like structural typing ! | ||
15:40
treehug88 joined
|
|||
timotimo | Ven: did you see my ADT module yet? :3 | 15:40 | |
masak | :) | ||
timotimo++ # ADT module | 15:41 | ||
Ven | timotimo: told you I used it to bait friends onto perl 6 :D | ||
timotimo | oh! you did! | ||
Ven | timotimo: you should put up a repo description, btw | 15:42 | |
masak | timotimo: it'd be fun to work on that missing EXPORT feature together. | 15:43 | |
15:43
ajr joined
|
|||
masak | timotimo: I also looked at that and thought "ooh, that'd be a nice use for a DSL instead of an intert specification string". | 15:43 | |
15:43
ajr is now known as Guest40894,
Guest40894 is now known as ajr_
15:45
denis_boyun left
15:47
isBEKaml left
|
|||
Ven | masak++ # agreed about the DSL ! ; timotimo++ # watched your repo ! | 15:49 | |
masak | Ven: my brain is currently in those parts of spec-land, pondering. | 15:50 | |
basically, I think I discern three levels of language extension/modification: | |||
(a) only need subroutines (so-called "internal DSL" by some) | |||
Ven | needs reader macros HA | ||
masak | (b) need macros (maybe to change program flow, or insert checking/analysis) | 15:51 | |
(c) need a whole different sublanguage (because the syntax is different enough that macros aren't enough) | |||
it'd be nice to collect a few examples on each level. I'm gearing up to write blog posts about that, too. | |||
moritz | m: my $x; 'abc' ~~ /$x=(ab)/; say $x | 15:53 | |
camelia | rakudo-moar 44ab3c: OUTPUT«===SORRY!===Error while compiling op bind: QAST::Block with cuid cuid_1_1391529188.76986 has not appeared» | ||
moritz | m: my $x; 'abc' ~~ /$x=(ab)/; say $x | ||
camelia | rakudo-moar 44ab3c: OUTPUT«===SORRY!===Error while compiling op bind: QAST::Block with cuid cuid_1_1391529195.38929 has not appeared» | ||
moritz | m: 'abc' ~~ /$<x>=(ab)/; say $<x> | ||
camelia | rakudo-moar 44ab3c: OUTPUT«「ab」» | ||
15:54
raiph joined
|
|||
TimToady1 | std: my $x; 'abc' ~~ /$x=(ab)/; say $x | 15:54 | |
camelia | std 09dda5b: OUTPUT«ok 00:01 127m» | ||
TimToady1 | n: my $x; 'abc' ~~ /$x=(ab)/; say $x | ||
camelia | niecza v24-109-g48a8de3: OUTPUT«===SORRY!===Non-Match bindings NYI at /tmp/2rh2e31Bkj line 1:------> my $x; 'abc' ~~ /$x=(ab)⏏/; say $xUnhandled exception: Check failed at /home/p6eval/niecza/boot/lib/CORE.setting line 150…» | ||
TimToady1 | r: my $x; 'abc' ~~ /$x=(ab)/; say $x | 15:55 | |
camelia | rakudo-moar 44ab3c: OUTPUT«===SORRY!===Error while compiling op bind: QAST::Block with cuid cuid_1_1391529311.00125 has not appeared» | ||
..rakudo-jvm 44ab3c: OUTPUT«===SORRY!===setcodeobj can only be used with a CodeRef» | |||
..rakudo-parrot 44ab3c: OUTPUT«===SORRY!===Could not find sub cuid_1_1391529308.45272» | |||
masak | time for a LTA rakudobug? | ||
TimToady1 | well, I believe it's specced to Just Work | ||
moritz | m: 'abc' ~~ /^ @<x>=.+ $ /; say $/ | ||
masak submits rakudobug | |||
camelia | rakudo-moar 44ab3c: OUTPUT«Nil» | ||
masak | std: 'abc' ~~ /$x=(ab)/; say $x | 15:56 | |
camelia | std 09dda5b: OUTPUT«===SORRY!===Variable $x is not predeclared at /tmp/BMQCFR0dVk line 1:------> 'abc' ~~ /⏏$x=(ab)/; say $xVariable $x is not predeclared at /tmp/BMQCFR0dVk line 1:------> 'abc' ~~ /$x=(ab)/; say ⏏$…» | ||
masak | std: 'abc' ~~ /$x=(ab)/ | ||
camelia | std 09dda5b: OUTPUT«===SORRY!===Variable $x is not predeclared at /tmp/KrehdSr98u line 1:------> 'abc' ~~ /⏏$x=(ab)/Check failedFAILED 00:01 126m» | ||
timotimo | moritz: does that compile error also appear with --optimize=0? | ||
or =off | |||
moritz | m: 'abc' ~~ /^ $<x>=(.)+ $ /; say $<x> | ||
TimToady1 | r: my $x; 'abc' ~~ /(ab) { $x = $0 }/; say $x | ||
camelia | rakudo-moar 44ab3c: OUTPUT«「a」 「b」 「c」» | ||
rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«「ab」» | |||
moritz | m: 'abc' ~~ /^ $<x> = (.)+ $ /; say $<x> | 15:57 | |
camelia | rakudo-moar 44ab3c: OUTPUT«「a」 「b」 「c」» | ||
TimToady1 | m: 'abc' ~~ /^ $<x>=.+ $ /; say $<x> | ||
camelia | rakudo-moar 44ab3c: OUTPUT«「abc」» | ||
moritz | m: 'abc' ~~ /^ $<x> = (.)+ $ /; say $<x>.elems | ||
camelia | rakudo-moar 44ab3c: OUTPUT«3» | ||
TimToady1 usually uses [] instead of () to avoid giving the impression that $0 is set | 15:58 | ||
15:58
araujo left
|
|||
TimToady1 | m: 'abc' ~~ /^ <x=:Any>+ $ /; say $<x> | 15:59 | |
camelia | rakudo-moar 44ab3c: OUTPUT«「a」 「b」 「c」» | ||
TimToady1 | there's a use for :Any :) | ||
timotimo | i have no idea what that does | ||
FROGGS | :Any is a unicode property lookup | 16:00 | |
PerlJam | random thought: Just now it strikes me as weird that [] doesn't capture while () does capture. [] are used in arrays and capturing is just like indexing into an array. | ||
timotimo | oh! | ||
of course | |||
not the perl6 type | |||
FROGGS | no | ||
colomon | What does the Unicode property mean? | ||
FROGGS | Anything | ||
TimToady1 | we decided we could fight the history of () in regexland | ||
*n't | 16:01 | ||
colomon | like . ? | ||
TimToady1 | yes | ||
16:01
SamuraiJack left
|
|||
TimToady1 | <:Any> is just an explicit way to write . | 16:01 | |
moritz | m: 'abbbb' ~~ / (b ** 0..3)/; say ~$0; | 16:02 | |
camelia | rakudo-moar 44ab3c: OUTPUT«» | ||
masak | r: say ?( 'aaa' ~~ m:g/a/ ) | ||
camelia | rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«False» | ||
TimToady1 | moritz: that's correct | ||
16:03
Psyche^ left,
SamuraiJack joined
|
|||
FROGGS | moritz: position wins | 16:03 | |
TimToady1 | r: say ('aaa' ~~ m:g/a/).WHAT | ||
camelia | rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«(Bool)» | ||
FROGGS | masak's example is weird though | ||
masak | lizmat++ # .made | 16:04 | |
FROGGS | I've seen it on p6u a minute ago too | ||
masak | FROGGS: think it might be doing smartmatching twice, or something. | ||
TimToady1 | r: $_ = 'aaa'; say (m:g/a/).WHAT | ||
16:04
Psyche^ joined
|
|||
camelia | rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«(List)» | 16:04 | |
masak | right. | ||
TimToady1 | that wants to return a pseudo Match | ||
FROGGS | :/ | ||
TimToady1 | so that the smartmatcher knows it's done | ||
masak | basically, Perl 6 straightens out a waterbed wrinkle there, which surprises people. | 16:05 | |
TimToady1++'s solution might work. | |||
TimToady1 | it's really OKness in disguise | ||
masak | as long as it's in disguise, it's probably fine :P | ||
TimToady1 | but it's specced by merely listing the types that behave like Bool | ||
without making it generalizable :( | 16:06 | ||
16:08
kaleem left
16:09
zakharyas joined
|
|||
TimToady1 | masak: it's not clear where the boundary between your (b) and (c) is. Where does a reader macro (is parsed) fit? What is the scope of the sublanguage replacement? | 16:14 | |
can a macro do what 'use Python;' does? | 16:15 | ||
and we need to detangle the 'immediate' semantics from the language change semantics | 16:16 | ||
my \term = 42; is language change without an immediate sub call | |||
(well, as currently implemented--we could run all identifiers through a common path) | |||
16:18
SamuraiJack_ joined
|
|||
raiph | Pop quiz for #perl6: who recently said that the best code is poetry, that “you’re trying to take something that can be described in many, many sentences and pages of prose, but you can convert it into a couple lines of poetry and you still get the essence, so it’s that compression.” | 16:18 | |
16:18
SamuraiJack left
|
|||
masak | TimToady1: I wish I had more firm answers. but I figure there are some things that the community will consider as being trivially doable by macros, and others where a new braid/bundle of grammar/actions/world is needed. | 16:19 | |
16:20
[Sno] left
|
|||
masak | TimToady1: kind of like the tipping point where one shouldn't do individual regexes anymore, due to diminishing returns. | 16:20 | |
so in my analogy, regexes : grammars :: macros : slangs. | |||
16:21
atroxaper left
|
|||
diakopter | raiph: I give up | 16:24 | |
16:24
molaf_ joined
|
|||
raiph | diakopter: nirvana arguably translates to "i give up", so hopefully u feel great :) | 16:25 | |
16:25
ajr_ left
|
|||
raiph | anyhoo, the new ceo of microsoft | 16:25 | |
diakopter | figures; not even sentences | 16:26 | |
16:26
ajr joined,
ajr is now known as Guest19373
16:27
Guest19373 is now known as ajr_
16:28
molaf left
|
|||
masak | raiph: I find the best two ways to make that happen are (a) test-first development, and (b) having already implemented the thing 49 times before. | 16:29 | |
(fsvo 49) | |||
16:30
ajr_ left
16:32
ajr_ joined
16:33
Adriaaan left
16:34
ajr_ left,
smls joined
|
|||
smls agrees with PerlJam ("Just now it strikes me as weird that [] doesn't capture while () does capture") | 16:35 | ||
moritz | isn't that how other professions do it? You've done 35 pancakes already, you can be pretty confident that the 36th pancake also will be just fine | 16:36 | |
smls | () is used for simple grouping outside of regexes, so it would be nice to have similar semantics inside regexes | ||
16:36
ajr_ joined
|
|||
FROGGS | ohh, please don't change that ó.ò | 16:36 | |
smls | and [...] sort of looks like a pair of grappling hooks, so perfect for "capture this part" | ||
moritz | don't the {...} look more like grappling hooks? | 16:37 | |
smls | FROGGS: Would it really be so bad? I mean, there are lots of major changes between traditional regexes and P6 regexes/grammars already. | 16:38 | |
So you can't copy/paste nbetween the two anyways | |||
moritz | we have an IMMENSE body of Perl 6 regexes written already | ||
FROGGS | smls: do we have to break every bit of P6 code that is "out there" atm? | ||
moritz | mostly notably in a bootstrapped compiler | ||
and doing such an invase change in a bootstrapped compiler is a real PITA | 16:39 | ||
masak | besides, I don't think the argument for such a change is a very strong one. | ||
FROGGS | exactly, I'd say there must be a very strong reason for changing fundamental things like this | 16:40 | |
16:40
ajr_ left
|
|||
masak | yes, we "break all the [back-compat] that needs breaking", but there's something to be said for (...) or some variant of it meaning "capture" in most dialects of regex syntax. | 16:40 | |
moritz | and we want the specs to solidfy, not to vaporizes | ||
smls | moritz: Sorry, grappling hook was the wrong word, I meant more like a gripper as an inductrial robotic might have as its "hand" | 16:41 | |
FROGGS | smls: I understand what you say but IMO having cute parens is not worth it | 16:42 | |
masak | use Regex::BracketsAndParensExchanged; | ||
smls | lol | ||
masak | it's 2014 and I still don't have my language-modifying modules. | 16:43 | |
16:43
ajr joined
16:44
ajr is now known as Guest99283,
Guest99283 is now known as ajr_
|
|||
timotimo | masak: well, 2014 has only just begun | 16:59 | |
smls | In an ideal world, any non-negligible benefit could justify a syntax change before the first officially stable release (rather than only a "very strong" benefit), but yeah I understand the pragmatic argument re. existing compilers and modules. | ||
I don't agreee with the compatibility argument though. I think consistency within Perl 6 is better than consistency between parts of Perl 6 and the analogous parts of other languages. | |||
17:01
FROGGS left
|
|||
smls | I mean, I myself am a Perl 5 developer with somewhat of a "resistant-to-change" personality, yet I was surprised that this was *not* changed in Perl 6 regexes (considering all the other invasive changes/innovations in that area). | 17:02 | |
PerlJam | um ... wrt the capturing brackets, I concluded internally right after I had my random thought that we could always put a module out there for people to try that would swap their meanings, so ... what masak said :) | ||
17:02
kaleem joined
17:04
zakharyas left
|
|||
smls | I'm not a fan of "cosmetic" syntax-changing modules. | 17:05 | |
17:05
Adriaaan joined
|
|||
smls | They fracture the language's ecosystem and make it sifficult to merge code from different sources together | 17:05 | |
moritz | but the same argument doesn't apply to the fractur in time that a syntax change causes? | 17:06 | |
timotimo | frakturschrift in perl6? :) | 17:07 | |
smls | moritz: Well, P6's future lifetime (and amount of usage), will hopefully vastly exceed that of the past | 17:09 | |
so that the latter would become negligible in comparison | |||
moritz | smls: though history shows that old documents are still easily found with google&co, and such cause confusion | ||
smls: just today we had a case here in #perl6 where somebody accidentally quoted Perl 6 syntax from 2003 | 17:10 | ||
smls | but I do concede that it is not negligible now for the small P6 team to handle, i.e. thats the pragmatic argument | ||
17:10
kaleem left
|
|||
smls | s/handle/migrate/ | 17:12 | |
timotimo | ==> Successfully installed ADT | ||
no test problems :\ | |||
tadzik | oh no | ||
timotimo | oh, yikes | ||
with ufo and make loudtest i *do* get errors | 17:13 | ||
tadzik | === SORRY === :( | ||
timotimo | i don't understand why the tests don't fail with panda | 17:16 | |
tadzik | $ perl6 bootstrap.pl --prefix HEREPANDA | 17:21 | |
Usage: bootstrap.pl [--prefix=<Any>] | |||
ಠ_ಠ | |||
moritz | ok, straw poll time. I'm sure many of you have read books or tutorials that explained closures. How many of those actually explained at which point a time a closure is instantiated (or "cloned" in p6 speak)? | 17:22 | |
tadzik: use --prefix=HEREPANDA instead? :-) | 17:23 | ||
tadzik | I know, it's just not DWIM :) | ||
moritz | patches well done. | 17:24 | |
tadzik | troo | 17:26 | |
17:28
pecastro left
|
|||
tadzik | hmm, strange | 17:29 | |
smls | moritz: Well in P5 one would only think of *anonymous* subroutines as closures, so they would always appear in an expression that is reached during normal control flow. And that's when I always imagined them to be instantiated. | ||
tadzik | gist.github.com/tadzik/8808416 | ||
in line 4, it shows that it loaded a precompiled File::Find | |||
smls | Thouch I don't think the P5 tutorials I read on the subject went into further details on that. | 17:30 | |
*though | |||
tadzik | but then at the end, it complains that another File/Find.pm is not precompiled | ||
17:30
ajr_ left
17:31
ajr joined,
ajr is now known as Guest37056
|
|||
jnthn | I agree changing the meaning of (...) now in regex is way too late | 17:31 | |
moritz | smls: ok, thanks for the data point | 17:32 | |
17:32
Guest37056 is now known as ajr_
|
|||
jnthn | I also thought we were gonna *add* .made, not remove .ast also... | 17:32 | |
17:32
benabik joined
17:35
[Sno] joined
17:36
regreg left
|
|||
tadzik | argh | 17:36 | |
I hate precompiling stuff | |||
vendethiel | smls, moritz: I was the one with that 2003 link. I often get perlmonks results from googling and sometimes it's really outdated, I'm not sure to what extent I can use it or not | ||
moritz | vendethiel: that's fine; I just used you as a data point :-) | ||
17:37
ajr_ left
|
|||
vendethiel | moritz: WRT closures, not sure what you mean. do you mean when values are captured ? | 17:37 | |
17:37
ajr_ joined
|
|||
moritz | vendethiel: correct | 17:37 | |
for example, javascript also has named closures | 17:38 | ||
vendethiel | moritz: rarely explained. Usually it just says it captures "variables". | ||
We get a lot of those questions in JS/coffee | |||
moritz | vendethiel: ok, that matches my own experience | ||
vendethiel | "why when I do a loop to bind buttons, my click always gives me the last number?" but that's mainly because JS doesn't (didn't) have block scope | 17:39 | |
moritz | vendethiel: does coffee also use the "when the outer scope is entered" mechanism? | ||
jnthn | moritz: I explain closures relatively often. I tend to not talk precisely about when the clone or instantiation happens, but certainly talk about lifetime and the exact scope that is captured. | 17:40 | |
17:40
ajr_ left
|
|||
vendethiel | moritz: we have JS's semantics, with 1 or 2 exceptions (because we don't have explicit `var`, a variable is declared in the highest scope it's defined) | 17:40 | |
s/defined/assigned/ | |||
jnthn | moritz: C# has an over-sharing issue when you write for (var i = 0; i < 10; i++) things.push(x => x + i); | 17:41 | |
17:41
ajr_ joined
|
|||
jnthn | moritz: So I certainly have to give people a good enough mental modle to understand *why* that doesn't do that they want. | 17:42 | |
*model | |||
vendethiel | jnthn++ # same thing here | ||
17:42
ajr_ left
|
|||
jnthn | (Worth noting you'll get the same problem in Perl 6 if you use loop, fwiw...) | 17:43 | |
moritz has a distaste for implicitly declared variables | |||
timotimo | that gives 10 closures that all add 10 to the argument? | ||
vendethiel | moritz: oh, I agree | ||
jnthn | timotimo: yes | ||
17:43
ajr_ joined
17:44
jeffreykegler joined
|
|||
dalek | Heuristic branch merge: pushed 40 commits to panda/prefix by tadzik | 17:45 | |
17:45
ajr_ left
|
|||
jnthn | dinner & | 17:45 | |
17:46
[Coke] left,
breinbaas left,
rom1504 left,
Util left,
Ulti left,
synopsebot left,
prammer left,
obra left,
anocelot left,
ajr_ joined,
rom1504 joined,
raydiak left
17:47
raydiak joined,
ajr_ left,
silug_ joined
17:48
ajr_ joined,
rhr joined,
[Coke] joined,
breinbaas joined,
anocelot joined
17:49
Ulti joined,
Util joined,
obra joined
17:50
breinbaas left
|
|||
timotimo | oh, dalek is back \o/ | 17:50 | |
17:50
simcop2387 joined
17:51
daniel-s left
17:52
daniel-s joined
17:57
dakkar left
18:00
SamuraiJack_ left,
SamuraiJack_ joined
18:01
prammer joined,
ajr_ left
18:03
ajr_ joined
18:06
SamuraiJack_ left,
synopsebot joined
18:13
denisboyun joined
18:14
zakharyas joined,
molaf_ left
18:15
jeffreykegler left
18:17
FROGGS joined
18:18
yogan joined
18:19
denis_boyun_ joined
|
|||
colomon | woah, big changes to panda? | 18:20 | |
18:21
ajr_ left
|
|||
timotimo | no, just a merge of master into a branch i believe | 18:21 | |
FROGGS | break all the things! /o/ | ||
18:22
denisboyun left
|
|||
FROGGS | (joke) | 18:22 | |
18:33
kivutar joined
|
|||
tadzik | yeah, I tried to resume work on prefix | 18:38 | |
18:43
sftp joined
18:48
ajr joined,
ajr is now known as Guest8666,
Guest8666 is now known as ajr_
18:53
darutoko- left
18:58
rindolf left
19:14
molaf joined
19:16
Sqirrel joined
|
|||
Util | #ps in 4m | 19:26 | |
19:30
TimToady1 left
19:33
TimToady joined
|
|||
TimToady | yay, I'm me again | 19:34 | |
FROGGS | \o/ | 19:35 | |
TimToady | had to quit irssi, wouldn't let the nick timeout | ||
nwc10 | in real life too, or are you still on the cough syrup etc? | 19:39 | |
19:39
rindolf joined
19:41
treehug88 left,
[particle] joined
|
|||
TimToady | I think I've managed to get off the cough syrup with the aid of a humidifier, but I'm also working on a case of shingles, which I'm supposed to wait for blisters to come up before I go back in | 19:42 | |
and given that I have cephalic shingles, it can get (back into) my eye (for which reason I was blind in one eye for 14 years) | |||
but now it's just neuralgia on the top of my head mostly, but it makes it hard to think some of the time | 19:43 | ||
FROGGS | O.O | ||
TimToady | trigeminal nerve, ophthalmic branch | ||
the other irritation is that when I cough (and I still do a lot of that), it feels as though the top of my head is going to fly off | 19:44 | ||
but I'm hopeful this may be the first day without fever from the flu | 19:45 | ||
that's the thing about shingles, it always kicks you when you're already down | |||
nwc10 | E has bronchitis, or keeps getting bronchitis again every time she gets a cold | 19:47 | |
this is tiring for all of us | |||
TimToady | that's why we do this when we're young :) | 19:48 | |
20:05
treehug88 joined
20:07
SamuraiJack_ joined
20:09
daniel-s left
|
|||
timotimo | and then the shingles kick you in the shins :( | 20:12 | |
20:13
jnap left
20:14
treehug88 left,
zakharyas left
20:15
WAA3Q7G joined
20:16
treehug88 joined
|
|||
dalek | kudo/wip-openpipe: d62a7b2 | (Tobias Leich)++ | src/core/IO.pm: use openpipe on moar |
20:16 | |
20:16
beastd joined
20:17
WAA3Q84 joined
20:20
daniel-s joined
|
|||
TimToady | well, on balance I think I would rather have shingles kick me in the shins than in the head, but I don't get to choose | 20:21 | |
20:26
jac50 joined
20:28
jac50 is now known as lemOn91
20:32
jnap joined
20:33
bjz left,
bjz joined
20:35
kivutar left
20:39
rurban left
|
|||
colomon | TimToady: :( | 20:40 | |
20:44
renormalist joined
20:48
renormalist is now known as renormali
20:50
renormali is now known as renormalist
20:57
kst left
21:00
kst joined
|
|||
btyler | hi all. just putzing around trying to get a handle on grammars, and decided to make a parser for nginx/apache access logs. can anyone help me figure out why the grammar for 'date' fails but the regex at the bottom matches? gist.github.com/kanatohodets/7b3d3...se-pm6-L11 | 21:01 | |
timotimo | before i look, did you have a look at the Grammar::Debugger and Rakudo::Debugger packages? | 21:04 | |
ah, hehe | 21:05 | ||
you do $<date>=\[ (.+) \] | |||
which means ... assign what matched '[' into $<date> and the stuff after the | |||
sjn | btyler: check out perlgeek.de/en/article/debug-a-perl-6-grammar :) | ||
timotimo | '[' goes into $0 and then it matches a ']' | ||
21:09
denis_boyun_ left
21:10
Alula joined
|
|||
btyler | sjn/timotimo: thanks! I guess I was confused about how the $<foo> capture things work. do I stick the 'date' capture inside \[\], then? trying to 'grab all the stuff inside a pair of square braces' | 21:11 | |
FROGGS | p: say '137.22.189.191 - - [02/Feb/2014:23:37:36 -0600] "GET' ~~ /$<date>=[ '[' .+ ']' ]/ | 21:13 | |
camelia | rakudo-parrot 44ab3c: OUTPUT«「[02/Feb/2014:23:37:36 -0600]」 date => 「[02/Feb/2014:23:37:36 -0600]」» | ||
timotimo | i would suggest .+? instead of .+ | ||
that should be much, much faster | |||
actually, use <-[\]]> instead perhaps | |||
FROGGS | true | ||
timotimo | instead of . | ||
FROGGS | p: say '137.22.189.191 - - [02/Feb/2014:23:37:36 -0600] "GET' ~~ /<date=-[\]]>/ | ||
camelia | rakudo-parrot 44ab3c: OUTPUT«「1」 date => 「1」» | ||
btyler | timotimo: ok, moment..think baby perl6 :P what does those variations mean? | 21:14 | |
FROGGS | p: say '137.22.189.191 - - [02/Feb/2014:23:37:36 -0600] "GET' ~~ /$<date>=[ <-[\]]>+ ]/ | ||
camelia | rakudo-parrot 44ab3c: OUTPUT«「137.22.189.191 - - [02/Feb/2014:23:37:36 -0600」 date => 「137.22.189.191 - - [02/Feb/2014:23:37:36 -0600」» | ||
btyler | *do | ||
FROGGS | .+ is greedy, .+? is not | 21:15 | |
and <-[ ... ]> is a negated charater class | |||
where ... is the actual content | |||
timotimo | yeah, your .* would match until the end of the whole file and then backtrack until it finds a ] | 21:16 | |
btyler | oh, jeez, ok. | ||
timotimo | meaning you'll get a few thousand lines as the date of your first entry, in the worst case :P | 21:17 | |
skids | One doesn't generally parse log files as one string. That's a recipe for high memory footprint. Best to load and discard lines one by one. | 21:31 | |
21:31
molaf left
|
|||
btyler | skids: of course, just messing around :) figured that doing a moving window thing was putting the cart before the horse if I didn't have any notion of how grammars worked | 21:34 | |
skids ponders the concept of lazy matching on a stream. | 21:37 | ||
colomon | skids: once we have lazy strings... | 21:44 | |
21:46
smls left
|
|||
timotimo | moritz++ # answering a barrage of questions on the mailing list | 21:46 | |
skids | colomon: right, but what does $/ look like during the match... | 21:49 | |
colomon | skids: hmmm | ||
21:52
kaare__ joined
21:58
SamuraiJack_ left,
treehug88 left,
erkan joined,
arlinius joined
21:59
treehug88 joined
22:00
treehug88 left
22:01
FROGGS left
22:06
skids left
22:08
rindolf left
22:16
bluescreen10 left
22:19
BenGoldberg joined
22:20
rurban joined
22:22
kivutar joined
22:24
treehug88 joined
22:26
raiph left
22:33
treehug88 left,
treehug88 joined
22:35
kbaker left
|
|||
lue | masak: at parts that slideshow reads like someone trying too hard to impress with buzzwords :P "strictness!" "symbol tables!" "lexical scoping!" | 22:38 | |
ooh, didn't know .ast became .made recently | 22:42 | ||
22:57
ajr_ left
|
|||
timotimo | lue: that was literally today | 23:07 | |
oh, actually, the day just changed a few minutes ago on my timezone | 23:12 | ||
23:13
raiph joined
23:14
jnap left,
rurban left
23:18
huf_ joined
23:24
molaf joined
23:29
Alula left
23:30
corecatcher joined,
dmol left
23:31
skids joined,
jnap joined
23:32
lizmat joined
23:34
kivutar left,
Alula joined
23:38
xenoterracide left
23:39
xenoterracide joined
23:40
Adriaaan left,
Adriaaan joined
23:44
berekuk joined
23:47
Alina-malina left,
beastd left
23:55
btyler left
|