»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by masak on 12 May 2015. |
|||
00:10
tinyblak joined
|
|||
raydiak | good afternoon, #perl6 | 00:11 | |
vendethiel | o/ raydiak | 00:13 | |
raydiak | \o vendethiel; working on anything interesting? | 00:14 | |
vendethiel | raydiak: not really, no, I was playing games with friends :P | ||
raydiak | what game? I ought to try one again some time... | 00:15 | |
vendethiel | raydiak: borderlands 2 :) | 00:18 | |
raydiak realizes his age as he has no idea what borderlands is, and goes to read :) | 00:19 | ||
00:19
TEttinger left
00:20
mohij joined
00:22
rurban left
00:23
mohij_ left
|
|||
raydiak | neat, I think my laptop might even handle it once I clean out the fan again (scorching summer here, setting records for my city) | 00:24 | |
haven't been very active here lately myself, got some work painting a house for a few weeks, so spending part of a day off checking to see if all my modules still work on latest rakudo and so forth | 00:29 | ||
00:35
amurf joined
|
|||
ugexe | m: my $path1; my $path2 = ''; say $path1.?IO.is-absolute; say $path2.?IO.is-absolute; # could it be more useful if $path2.?IO did not die? | 00:36 | |
camelia | rakudo-moar 2e612a: OUTPUT«NilMust specify something as a path: did you mean '.' for the current directory? in block <unit> at /tmp/7i2MBik27k:1» | ||
cognominal | ...travelling to see the World.nqp instead of sleeping | 00:42 | |
raydiak | ugexe: that die for '' is something lizmat++ put in after one of my projects rm -rf'd itself due to a GLR change...so I'd argue that it'd be better if $path1 *did* die :) | 00:43 | |
ugexe | i dont want to actually do anything. i want to check if a path is absolute, but not being able to check "" doesnt seem correct | 00:47 | |
00:47
tinyblak left
|
|||
ugexe | or a better way than saying !$path || $path.IO.is-absolute ?? $path !! $path.IO.abspath | 00:49 | |
vendethiel | raydiak: well, I did manage to get a few more compile-time NULLRepr | 00:55 | |
01:00
BenGoldberg joined
01:01
laouji joined
01:04
tinyblak joined
01:05
dayangkun left
01:15
Hor|zon joined
01:16
rmgk_ joined,
rmgk is now known as Guest36324,
rmgk_ is now known as rmgk
01:20
Guest36324 left,
Hor|zon left
01:26
vendethiel left
|
|||
raydiak | ugexe: myself, I'd rather that any attempt to treat an empty string or undefined value as a path died immediately...if I'm seeing any of those things where I should see a path string, something has probably gone wrong upstream | 01:29 | |
though I can see an argument for wanting to treat it as the current directory (which is how my project self-destructed) | 01:30 | ||
but I wouldn't be in favor of it working for certain operations (like .is-relative), but not others | |||
01:39
amurf left
01:46
yeahnoob joined
01:56
TEttinger joined
02:09
yeahnoob left
02:13
noganex_ joined
02:14
aborazmeh joined,
aborazmeh left,
aborazmeh joined
02:15
noganex left
02:17
atroxaper joined
02:21
atroxaper left
02:23
dayangkun joined
02:24
dayangkun left
02:25
laouji left,
dayangkun joined,
dayangkun left,
dayangkun joined,
dayangkun left
02:28
dayangkun joined
02:35
yeahnoob joined
02:37
laouji joined
02:48
colomon left,
vendethiel joined
|
|||
ugexe | in this case the string is going to get absolute-ified one way or another, which involves $*CWD during the $*SPEC. methods (since a string cant carry its $*CWD around with it) | 02:50 | |
02:50
colomon joined
03:04
Hor|zon joined
03:09
Hor|zon left
03:11
telex left
03:12
telex joined
03:14
xinming joined
03:22
xinming left,
xinming joined
03:23
amurf joined
03:25
colomon left
03:28
amurf left
03:29
colomon joined
03:31
BenGoldberg left
03:39
colomon left
03:40
colomon joined
03:45
tinyblak left,
laouji left
03:47
colomon left,
nys left
03:51
amurf joined
03:55
molaf_ left
03:56
amurf left
03:59
kaare_ joined
04:03
vendethiel left
04:04
kaare__ joined
04:07
kaare_ left
04:53
atroxaper joined,
Hor|zon joined
04:55
aborazmeh left
04:57
khw left
04:58
Hor|zon left,
tinyblak joined
05:05
skids left
05:08
tinyblak left
05:20
baest_ is now known as baest
05:22
vendethiel joined
05:38
[Sno] left
05:43
raiph left
05:45
vendethiel left
05:59
araujo_ left
06:01
araujo joined,
araujo left,
araujo joined
06:04
rurban joined
06:09
dalek left,
dalek joined,
ChanServ sets mode: +v dalek
06:11
xinming left
06:21
geekosaur left
06:23
geekosaur joined
06:27
vendethiel joined
06:33
espadrine_ joined
06:40
FROGGS joined
06:42
Hor|zon joined
06:44
atroxaper left
06:46
FROGGS left
06:47
Hor|zon left
06:49
tinyblak joined,
vendethiel left
06:51
vendethiel joined
06:53
atroxaper joined
06:57
zakharyas joined
07:01
brrt joined
07:05
[Sno] joined
07:08
RabidGravy joined
|
|||
brrt | \o | 07:09 | |
cognominal | brrt o/ | 07:11 | |
brrt | good.. monday, i guess :-) | ||
cognominal | m: my token ws { \h* }; say qq|a\n| ~~ m:s/ a $ /; | 07:12 | |
「a | |||
camelia | rakudo-moar 2e612a: OUTPUT«「a」» | ||
07:12
atroxaper left
|
|||
cognominal | m: my token ws { \h* }; say qq|a\n| ~~ m:s/ a \n /; | 07:12 | |
camelia | rakudo-moar 2e612a: OUTPUT«False» | ||
cognominal | I wonder why the second does not match | 07:13 | |
07:14
vendethiel left
|
|||
moritz | cognominal: because the whitespace before the \n in the regex already slurped up the newline in the string | 07:14 | |
TEttinger | m: my token ws { \h* }; say qq|a\n| ~~ m:s/ a\n /; | ||
camelia | rakudo-moar 2e612a: OUTPUT«「a」» | ||
moritz wonders if the lexical ws is picked up | 07:15 | ||
ShimmerFairy | m: my token ws { <digit>* }; say qq|a3| ~~ m:s/a /; say qq|a3| ~~ m:s/a<digit>/ | ||
camelia | rakudo-moar 2e612a: OUTPUT«False「a3」 digit => 「3」» | ||
ShimmerFairy | m: my token ws { <digit>* }; say qq|a3| ~~ m:s/a /; say qq|a3| ~~ m:s/a<ws>/ | ||
camelia | rakudo-moar 2e612a: OUTPUT«False「a3」 ws => 「3」 digit => 「3」» | ||
ShimmerFairy | ^ lexical ws is not being picked up by :s whitespace | ||
moritz | m: grammar A { token ws { \h* }; token TOP { a \n } }; say A.parse("a\n") | ||
camelia | rakudo-moar 2e612a: OUTPUT«「a」» | ||
07:15
atroxaper joined
07:16
darutoko joined,
vendethiel joined
|
|||
moritz | cognominal: ^^ works fine inside a grammar | 07:16 | |
cognominal | ShimmerFairy diagnostic seems accurate. | 07:17 | |
07:17
xfix joined
|
|||
masak | good morning, #perl6! | 07:18 | |
cognominal | I waited masak to wake up to file the bug :) | ||
moritz isn't sure that's a bug | |||
moritz isn't sure it's not a bug either | 07:19 | ||
ShimmerFairy | on the one hand, it does feel a bit inconsistent with how it works in grammars, on the other hand it feels like this is the kind of thing where you should be using grammars already. | 07:20 | |
I'm not sure if non-grammar regex/token/rule declarations should "attach" to whatever implicit grammar regexes pull from when not in grammars, overriding declarations and such. | 07:23 | ||
cognominal | github.com/perl6/specs/blame/maste...x.pod#L342 | ||
masak | I'm too drowsy to backlog :) I'll leave that for later. | 07:24 | |
07:25
FROGGS joined
|
|||
cognominal | the given examples use m:s// so they are not grammars | 07:25 | |
could we blame the greeks for that too? | 07:26 | ||
ShimmerFairy | Said examples show how to _use_ sigspace, but I don't see any explicit example showing how to _change_ sigspace's behavior. | 07:27 | |
DrForr | Heh. I just fixed handling of RE modifiers in Perl-Mogrify last night. (with the exception of /x :) ) | 07:29 | |
07:30
abraxxa joined
07:39
vendethiel left,
nnms left
07:40
vendethiel joined
|
|||
masak | does Rakudo have something like Perl 5's `readlink`? | 07:42 | |
moritz | masak: resolve, I think | 07:43 | |
IO::Path.resolve | |||
07:43
Hor|zon joined
|
|||
moritz | m: say '/usr/bin/editor'.IO.resolve | 07:44 | |
camelia | rakudo-moar 2e612a: OUTPUT«"/usr/bin/editor".IO» | ||
masak | oh, nice. | 07:46 | |
japhb++ # implementation | |||
moritz | $ ./perl6-m -e ' say "/usr/bin/editor".IO.resolve' | ||
"/usr/bin/vim.gtk".IO | |||
07:48
Hor|zon left
07:54
Hor|zon joined
07:58
dakkar joined
07:59
dalek left
08:00
dalek joined,
ChanServ sets mode: +v dalek
08:02
vendethiel left
|
|||
[TuxCM] | Inline::Perl5 broken: Merging GLOBAL symbols failed: duplicate definition of symbol HLL | 08:04 | |
DrForr | Just as an aside I had good luck sending him a github issue as well :) | 08:05 | |
08:05
g4 joined,
g4 left,
g4 joined
08:24
vendethiel joined
08:30
espadrine_ left
|
|||
[TuxCM] | test 50000 46.251 46.162 | 08:47 | |
test-t 50000 46.427 46.337 | |||
there has been time that it was 36! | |||
09:06
verzz joined
09:11
brrt left
09:13
bin_005 joined
09:16
andreoss joined
09:20
brrt joined
|
|||
kanl | m: my @a = 1 .. 3; my @b = < a b c >; my @c = @a Z @b; for @c -> $a, $b { $a.say; $b.say; }; for @a Z @b -> $a, $b { $a.say; $b.say; } | 09:22 | |
camelia | rakudo-moar 2e612a: OUTPUT«1a2b3c1 a2 bToo few positionals passed; expected 2 arguments but got 1 in block <unit> at /tmp/TW7_7hQB4q:1» | ||
kanl | m: my @a = 1 .. 2; my @b = < a b >; my @c = @a Z @b; for @c -> $a, $b { $a.say; $b.say; }; for @a Z @b -> $a, $b { $a.say; $b.say; } | ||
camelia | rakudo-moar 2e612a: OUTPUT«1a2b1 a2 b» | ||
kanl | so Z seems to be buggy with odd sized lists | 09:23 | |
masak | nope. | 09:24 | |
kanl | masak: care to elaborate on that "nope"? :) | 09:25 | |
vendethiel | what's buggy here? | ||
kanl | am i misunderstanding the usage of Z then? | 09:26 | |
vendethiel | flattening, I think | ||
m: my @a = 1 .. 3; my @b = < a b c >; for @a Z @b -> ($a, $b) { $a.say; $b.say; } | |||
camelia | rakudo-moar 2e612a: OUTPUT«1a2b3c» | ||
vendethiel | kanl: for @a Z @b -> $a, $b {} will have $a = @a[0], @b[0] | 09:27 | |
and $b be @a[1], @b[1] (<- this comma is the lsit one) | |||
kanl | vendethiel: ic. so @c = @a Z @b flattened? | 09:28 | |
vendethiel | kanl: yes, list assignment flattens :) | 09:29 | |
kanl | got it, thanks! | ||
ShimmerFairy | But if list assignment flattens, then how come: | 09:30 | |
m: my @a = [0,1], [2,3]; my @b = @a[0]; say @b.perl; | |||
camelia | rakudo-moar 2e612a: OUTPUT«[[0, 1]]<>» | ||
vendethiel | ShimmerFairy: [] is an itemized list (currently) | 09:31 | |
GLR will (most probably) change this | |||
ShimmerFairy | That is the first time I have ever heard of [] being that. | 09:32 | |
vendethiel | m: for 1, [2, 3, 4], (5, 6) -> $a { say "hey $a" }; | ||
camelia | rakudo-moar 2e612a: OUTPUT«hey 1hey 2 3 4hey 5 6» | ||
vendethiel | m: my @a = 1, [2, 3, 4], (5, 6); for @a -> $a { say "hey $a" }; | 09:33 | |
camelia | rakudo-moar 2e612a: OUTPUT«hey 1hey 2 3 4hey 5hey 6» | ||
kanl | so then when is GLR happening? wouldn't it break tons of existing code? | ||
vendethiel | it probably will, yes | 09:34 | |
ShimmerFairy | I haven't seen an explicit description of GLR yet, but I'm _hoping_ it'll make lists sane in Perl 6. | ||
vendethiel much the same | |||
there's one draft, though | |||
DrForr | And just a few months before release :) | 09:35 | |
vendethiel | ShimmerFairy: github.com/perl6/specs/blob/master...-draft.pod | ||
DrForr: I'm ready to trade a bit of my time to fix my code for sanity | |||
DrForr | Oh, I am too, it's just the whole "just before release" bit. | 09:36 | |
ShimmerFairy | Well, I can't say I've kept quiet about how dumb lists can be in Perl 6 over the years :P | 09:37 | |
09:37
vendethiel left
|
|||
DrForr | Just stability issues, and worried that it's going to go in just before YAPC::EU and potentially break demo code when we should be touting successes :) | 09:39 | |
09:42
brrt left
09:45
yeahnoob left,
rindolf joined
09:46
Ven joined
09:51
andreoss left,
espadrine_ joined,
espadrine_ is now known as espadrine
09:59
bin_005 left,
bin_005_i joined
10:04
tinyblak left,
tinyblak joined
10:07
tinyblak left
10:09
brrt joined
10:15
vendethiel joined
10:20
xinming joined
|
|||
kanl | wouldn't it be nice to be able to @a Z -> [ $a, $b ] { } @b, directly? | 10:21 | |
otherwise have to overload an operator | 10:22 | ||
or, -> $a, $b {}, post GLR | 10:23 | ||
10:27
gfldex joined
10:31
dayangkun left
10:32
Ven left
10:33
virtualsue joined,
pecastro left
|
|||
dalek | kudo/nom: 6967186 | (Nick Logan)++ | .travis.yml: non-legacy travis-ci config buildtime-- |
10:36 | |
kudo/nom: 533d1a9 | lizmat++ | .travis.yml: Merge pull request #469 from ugexe/travis-nolegacy non-legacy travis-ci config |
|||
10:44
TEttinger left
|
|||
kanl | m: my %h = a => 1; %h.push: a => 1; %h.say; | 10:47 | |
camelia | rakudo-moar 2e612a: OUTPUT«a => 1» | ||
kanl | doc.perl6.org/routine/push | 10:48 | |
my %h = a => 1; %h.push: b => 1; %h.say; | 10:49 | ||
m: my %h = a => 1; %h.push: b => 1; %h.say; | |||
camelia | rakudo-moar 2e612a: OUTPUT«a => 1» | ||
kanl | so .push on hash no longer autovivify either? | 10:50 | |
moritz | m: my %h = a => 1; %h.push: (b => 1); %h.say; | ||
camelia | rakudo-moar 533d1a: OUTPUT«a => 1, b => 1» | ||
moritz | kanl: it's the named vs. positional argument thingy again | 10:51 | |
ShimmerFairy | m: my $a = a => 1; my %h = $a; say %h.perl; %h.push($a); say %h.perl | ||
camelia | rakudo-moar 533d1a: OUTPUT«{:a(1)}<>{:a([1, 1])}<>» | ||
ShimmerFairy | That example in the docs assumes that implicit *%_ doesn't exist (and it shouldn't) | ||
kanl | moritz: got it. thanks! i seem to keep falling over the same spot :p | 10:53 | |
nine | [TuxCM]: cannot reproduce an Inline::Perl5 failure here | 10:55 | |
[TuxCM] will retry | 10:58 | ||
10:58
verzz left
|
|||
kanl | m: my @a = < a b c >; my %h = a => 1; @a.map: { %h.push: $_ => 1 }; %h.say; | 11:01 | |
camelia | rakudo-moar 533d1a: OUTPUT«a => 1 1, b => 1, c => 1» | ||
kanl | so in $_ is not treated as named in this case? | 11:02 | |
lizmat | m: my @a = < a b c >; my %h = a => 1; @a.map: { %h.push: $_ => 1 }; %h.perl.say | 11:03 | |
yoleaux | 12 Jul 2015 22:49Z <japhb> lizmat: I was referring to the fact that perl6's command line options don't seem to affect the REPL (or at least, not all of them). In my particular class, -I wasn't affecting @*INC in the REPL, and ugexe seemed to indicate --ll-exception was problematic as well. | ||
camelia | rakudo-moar 533d1a: OUTPUT«{:a([1, 1]), :b(1), :c(1)}<>» | ||
lizmat | kanl: I'm not sure what you expected? Seems to work as planned to me | ||
kanl | further back, my %h = a => 1; %h.push: b => 1; %h.say; | 11:04 | |
[TuxCM] | nine, still got it | ||
ShimmerFairy | The question is why %thing.push(a => 1) goes to *%_ but %thing($_ => 1) doesn't. | ||
[TuxCM] prepares gist (waiting for test to finish) | 11:05 | ||
nine | [TuxCM]: I do see random test failures running make test in a loop. But they're very infrequent :/ And they are all of the "No subtests run" kind | 11:07 | |
kanl | lizmat: things like this confuse a newbie like me. because it _seems_ to be inconsistent, when actually there are actually sound reasons behind the seemingly inconsistency. | ||
[TuxCM] | but you run locally, not from an installed Inline::Perl5 | ||
11:08
tinyblak joined
|
|||
lizmat | kanl: yeah, I see what you mean, but I'm on record not to rant about that anymore | 11:08 | |
kanl | i'll shut up :) | ||
ShimmerFairy would argue the extent to which implicit *%_ is a sound reason :P | 11:09 | ||
[TuxCM] | gist.github.com/Tux/2a769f16bd5505be78b6 | ||
lizmat | kanl: please don't | 11:10 | |
you strengthen my point | |||
it's just that if you feel as strongly about it as I do, you should let yourself be heard | 11:11 | ||
nine | I see the same errors locally and with the installed Inline::Perl5. But not your's. Though considering the randomness of my failures, it looks like some memory corruption. Like the heisenbug I tracked a couple of months ago that turned out to be a GC bug in NativeCall | ||
ShimmerFairy | lizmat: oh, are you talking about that time you argued against the conflation of pairs and named parameters? If so, this is definitely a case where I'm left wondering why it's like this. | 11:12 | |
lizmat | there's nothing more *I* can say about it | ||
ShimmerFairy: indeed | |||
ShimmerFairy | m: sub foo(:$bar) { say $bar }; my $baz = "bar"; foo(bar => "Hello!"); foo($baz => "World!") | 11:13 | |
camelia | rakudo-moar 533d1a: OUTPUT«Hello!Too many positionals passed; expected 0 arguments but got 1 in sub foo at /tmp/oFlm1yBicd:1 in block <unit> at /tmp/oFlm1yBicd:1» | ||
ShimmerFairy | I've never encountered this before, but it feels very, very wrong. | 11:14 | |
FROGGS | jnthn: ping | 11:15 | |
kanl | lizmat: from a user adoption pov, these so-called inconsistencies may be offputting to people and turn some of them away, just saying. but speaking for myself, i'm not that easily frustrated/discouraged :) | ||
ShimmerFairy | Those two calls should definitely be consistent, though how so is another point :) | ||
11:15
tinyblak left
|
|||
FROGGS | jnthn: what does a for loop return in statement level? this here? github.com/rakudo/rakudo/blob/nom/...er.pm#L201 | 11:16 | |
lizmat | kanl ShimmerFairy : teaching and user adoption are the most important reasons to separate :a(42) and a => 42 in meaning | 11:17 | |
especially since you cannot use a => 42 as an adverb in @a[42]:exists and the like | 11:18 | ||
kanl | *nod* | ||
lizmat | so newbies are first taught to use :a(42) notation for slices and the like | ||
and then learn they can also use a => 42 for custom code to indicate a named parameter | 11:19 | ||
but not for slices | |||
ShimmerFairy | lizmat: I'm on board with not mixing pairs and named params. I've actually thought about it before, but never complained about it much (if at all). They're such different things, I wonder why they deserve to share syntax, and in a not-always-clear fashion to boot. | ||
11:19
rurban left
|
|||
kanl | as a user with some p5 experience, i'd have to agree with ShimmerFairy on that | 11:20 | |
ShimmerFairy | lizmat: And I mentioned a few days ago how my mind sees a => 42 as a Pair-ish thing, and :a(42) as a named param-ish thing. I'm not too likely to write foo(a => 42) , and I definitely wouldn't write %h = :a(42) | 11:21 | |
kanl | old p5 habbits can be quite harmful | ||
11:22
atroxaper left
|
|||
tadzik | 25 years from now we'll still be afraid to use $a and $b so we don't break sort | 11:25 | |
it'll be like with goto. "Ancients told us to never use goto!" "But it was completely different back then!" "LOL, doesn't matter, stay away from it anyway!" | 11:26 | ||
(yes, I'm pretty sure prefix:<LOL> will still be around in 25 years) | |||
(maybe for the same reason) | |||
ShimmerFairy | What's this about breaking sort? | ||
lizmat | $a and $b have a special meaning in P5 wrt to sort | 11:31 | |
11:31
bjz joined
|
|||
ShimmerFairy | Ah, that explains why I don't know about it :) | 11:31 | |
lizmat | in p5 one can say sort @a, { $a cmp $b } where $a and $b would be the two parameters to the code block | 11:32 | |
similar to P6's { $^a cmp $^b } | |||
except in P5 they are fixed to the names "$a" and "$b" | 11:33 | ||
hence you can use $a and $b anywhere in P5 code without defining them, even with "use strict" | |||
so they're really pretty magical | |||
in P5 | |||
itz__ | is compiling to mbc on OS X several times slower than a couple of days ago or is it me? | 11:35 | |
11:35
itz__ is now known as itz
|
|||
lizmat | itz: not sure, could be | 11:36 | |
11:36
FROGGS left
|
|||
itz | I'll nuke .rakudobrew just in case | 11:37 | |
11:42
tinyblak joined
11:52
pecastro joined
11:56
kurahaupo left
12:02
bin_005_i left
|
|||
itz | hmm it seems to affect certain modules only | 12:10 | |
jnthn | afternoon, #perl6 | 12:17 | |
yoleaux | 11 Jul 2015 21:02Z <japhb> jnthn: What are your thoughts on irclog.perlgeek.de/perl6/2015-07-11#i_10881267 and irclog.perlgeek.de/perl6/2015-07-11#i_10881334 ? Having no good resolution kinda gets in the way of a nice refactoring (for now, I'm copying the required private methods into each role that would want to consume them, and then changing the names to not collide between the roles which is ... blech.) | ||
12 Jul 2015 20:46Z <FROGGS> jnthn: I think MVMExceptionBody needs an MVMObject *label, so the payload can be used for: LABEL.leave(42) | |||
12:17
rurban joined
|
|||
jnthn | .tell japhb I think the one at irclog.perlgeek.de/perl6/2015-07-11#i_10881271 should indeed DWYM; feel free to file a ticket on that | 12:19 | |
yoleaux | jnthn: I'll pass your message to japhb. | ||
12:22
atroxaper joined
|
|||
lizmat tries to catch some more sleep | 12:25 | ||
12:26
rindolf left
12:27
atroxaper left
|
|||
arnsholt | jnthn: How accessible is the multi-dim stuff from Perl 6 currently? I've got an idea which might be a good fit for giving it a real-worldish spin | 12:28 | |
timotimo | o/ | ||
jnthn | arnsholt: It ain't yet, but I intend for it to be later this week. | ||
arnsholt | Spiffy! I'll keep an eye out for it =) | 12:29 | |
12:32
yakudza joined
12:35
itz is now known as _itz,
itz joined
|
|||
RabidGravy | remember kids, doing "sub trait_mod:<is> .... " without a multi will get you really confused ... | 12:38 | |
well the symptons are somewhat confusing to me anyway | |||
12:42
FROGGS joined
|
|||
FROGGS | $ perl6 -e 'say (FOO: for ^3 { FOO.leave(123); say "alive" }); say "ho!"' | 12:43 | |
123 | |||
ho! | |||
masak: ^^ | |||
dunno how sane my implementation is though | |||
jnthn: ^^ | |||
masak | woo! \o/ | 12:44 | |
FROGGS, you nice person you! | |||
FROGGS | :D | ||
jnthn | FROGGS++ | 12:45 | |
FROGGS | I'll push my stuff in a minute | ||
jnthn | Would be interested to see that stuf,f yes | ||
*stuff | |||
FROGGS | jnthn: please review then :o) | ||
12:51
telex left
12:52
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
telex joined
12:54
verzz joined
13:03
christovchristov joined
13:06
amurf joined
13:09
brrt left
13:10
amurf left
|
|||
dalek | p/leave: 10af152 | FROGGS++ | src/vm/moar/QAST/QASTOperationsMAST.nqp: map {get,set}label, and handle CONTROL_RETURN + label |
13:12 | |
masak looks, too | |||
13:14
raiph joined
|
|||
masak | so the handler name is called RETURN on the nqp level? even though it's a leave? | 13:14 | |
13:16
andreoss joined
|
|||
andreoss | with token { <line> ** 9 } what separator is assumed? | 13:18 | |
13:19
bjz left
13:20
bjz joined
|
|||
dalek | kudo/leave: 6744251 | FROGGS++ | src/core/ (2 files): and handle CONTROL_RETURN + label in MapIter |
13:20 | |
FROGGS | masak / jnthn: I pushed all the things | ||
13:20
lucasb joined
|
|||
FROGGS | masak: aye, CONTROL_RETURN already existed | 13:21 | |
andreoss: none | |||
masak | FROGGS: here my ignorance of the specifics is showing, but... | 13:23 | |
FROGGS | masak: I just can tell that it works for the one-liner I posted, I'm not sure the implementation is sensible | ||
13:23
kaare__ is now known as kaare_
|
|||
masak | FROGGS: ...it seems to me that a `return` and a `leave` might take you to different locations. how does that square with using CONTROL_RETURN for both? | 13:23 | |
oha | isn't LEAVE a phaser executed before exiting? like a guard? why for 1..3 { FOO.leave(); say "alive" } doesn't print "alive" 3 times? | 13:24 | |
FROGGS | return does not use CONTROL_RETURN AFAICS | ||
it invokes a lexical &RETURN or so | |||
oha | is leave in this context different than the phaser | ||
shouldn't be .last() ? | 13:25 | ||
masak | FROGGS: maybe make sure that the lexical &RETURN doesn't use CONTROL_RETURN...? | ||
m: sub foo { sub return(|c) { say "nuh-uh!" }; return 42; say "alive" }; foo | |||
camelia | rakudo-moar 533d1a: OUTPUT«nuh-uh!alive» | ||
jnthn | I don't think it uses it at the moment, but it maybe should eventually | 13:26 | |
dalek | ast: 570c8cc | (Steve Mynott)++ | S32-io/spurt.t: fix spurt on file handle deprecation |
||
jnthn | The history on this is that Parrot never got lexical exception handler lookup | ||
But it had a different, and rather convenient, way to implement it | |||
masak | if there is a CONTROL_RETURN, but only &leave uses it, maybe rename it CONTROL_LEAVE? :P | 13:27 | |
jnthn | And we've kinda carried that forward | ||
Path of least resistance and all that | |||
andreoss | FROGGS: why does it work with \n and whitespaces between <line>? | ||
FROGGS | andreoss: maybe your token/rule line allows it? | ||
andreoss | i specified nothing about whitespaces | 13:28 | |
FROGGS | andreoss: is line a rul? | ||
andreoss | some default rule is applied | ||
FROGGS | rule* | ||
or is it a token? | 13:29 | ||
andreoss | rule | ||
FROGGS | see | ||
andreoss | with token it's actually the same | ||
FROGGS | a rule allows arbitrary whitespace at the end | ||
hmm, should not be | |||
13:31
colomon joined
|
|||
andreoss | sorry, i've been mistaken and changed rule to token only for TOP | 13:32 | |
13:36
andreoss left
|
|||
dalek | p: cd7a532 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/MultiDimArray (3 files): Get multi-dim object arrays working on JVM. |
13:41 | |
13:43
jaffa4 joined
|
|||
jaffa4 | hi | 13:43 | |
How would you copy a hash? | |||
PerlJam | jaffa4: my %hash = %other-hash; | 13:44 | |
jaffa4 | as a reference? | ||
and make it a reference? | |||
my $h = %hash; | |||
El_Che | jercos: a reference is not a copy, but an alias (changes to the "copy" will change the original) | 13:45 | |
jaffa4 | I would ike to have reference to a copy | 13:46 | |
geekosaur | what | ||
why do you need a reference? for the most part references are a perl5-ism | 13:47 | ||
jaffa4 | my %h2 = %h; my $r = %h2; | ||
Is there an easier way? | |||
geekosaur | things you shouldn't need to do don;t generally come with easier ways | 13:48 | |
jnthn | $(my % = %h) probably works | ||
13:48
molaf joined
|
|||
El_Che | (lol this is the #perl6 tab, I thought I was in #perl) | 13:49 | |
jnthn | Well, but {%h} does copy too :) | ||
13:49
aborazmeh left
|
|||
jnthn | so my $r = {%h} or so | 13:49 | |
nine | m: my %a = a => 1, b => 2; my $b = $(my % = %a); $b<b> = 1; say %a.perl; say $b.perl; | 13:51 | |
camelia | rakudo-moar 533d1a: OUTPUT«{:a(1), :b(2)}<>{:a(1), :b(1)}» | ||
13:51
khw joined
|
|||
[Coke] | Note: the TPF grants committee is looking for grants to fund. Historically we haven't gotten many perl 6 grant requests. If someone has a good idea for a grant, don't let the fact that it's six instead of five stop you. | 13:51 | |
jaffa4 | like what? | 13:52 | |
Coke | |||
Coke, what is the url? | 13:54 | ||
PerlJam | jaffa4: news.perlfoundation.org/2015/07/cal...uly-1.html | 13:55 | |
jaffa4 | jnthn: I getr postcircumfix:<{ }> not defined for type Bloc | ||
jnthn: thanks for the other version, that works | 13:59 | ||
christovchristov | hey Im consideirng using perl for a webspider but concerned about performance vs using php.. does anyone have any performance info where I can read more? | ||
PerlJam | christovchristov: sounds like you want #perl rather than #perl6 | 14:00 | |
14:01
colomon left
|
|||
christovchristov | ah. my bad. Ofcourse it was a more generic question :) cheers | 14:01 | |
PerlJam | christovchristov: no worries | ||
christovchristov: though, if I were you, I would do some profiling myself :) | 14:02 | ||
14:04
colomon joined,
itz left
14:06
n0tjack joined
14:07
colomon left
|
|||
tadzik | I'm continually surprised that Perl is one of the very few languages apparently that get stuff like gist.github.com/tadzik/80987d58011eeff3d96f right | 14:09 | |
TIL that C# and Go don't either | |||
moritz | christovchristov: in general, web spidering is IO (network) limited, not performance limit | ||
tadzik | I thought only Python is like that | ||
moritz | christovchristov: so you don't have to worry much about the performance of the implementation language | ||
PerlJam | moritz: #perl is enthusiastically telling him that. :) | 14:10 | |
moritz | ok :-) | ||
jnthn | A language that lets you manage multiple concurrent requests easily is worth having for it, though :) | ||
nine | Which I guess would be pretty much any language except PHP | ||
14:11
christovchristov left
14:13
skids joined
|
|||
dalek | p: 11dd464 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/MultiDimArray (10 files): Support native/packed multi-dim arrays on JVM. |
14:15 | |
14:18
g4 left
|
|||
masak | nine: but PHP has other nice/redeeming features, such as... ah... | 14:21 | |
... | |||
arnsholt | It's not BrainFuck, I guess? | 14:24 | |
jaffa4 | I found some weird behaviour concerning and and && see codepaste.net/yier8s | 14:25 | |
Could anyone explain that? | |||
nine | But BrainFuck should be easily compilable to a very fast binary, shouldn't it? | ||
arnsholt | Not necessarily | 14:26 | |
14:26
lizmat left
|
|||
arnsholt | It can actually be harder to optimise very low-level stuff | 14:27 | |
masak | jaffa4: before I opened that link, I went "oh, I bet jaffa4 got precedence wrong" | ||
jaffa4: I was right :D | |||
DrForr | jaffa4: && and 'and' have differing precedence. | ||
masak | m: say True and False | ||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
masak | m: say (True and False) | ||
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
masak | jaffa4: ^ | ||
jaffa4: if you don't understand precedence, and the differing precedence between `&&` and `and`, I would heartily recommend not using `and` | 14:28 | ||
14:28
VinceDee joined
|
|||
masak | jaffa4: it *has* a good use, but people who don't understand its precedence won't use it right. | 14:28 | |
14:29
colomon joined
|
|||
jaffa4 | masak: in the example, && gave bad result and, AND gave good one | 14:29 | |
DrForr | jaffa4: && is binding tighter than you expected. | ||
jaffa4 | a change from Perl 5? | 14:30 | |
DrForr | They're different languages, yes. | ||
dalek | p: 0da71d8 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/MultiDimArrayInstanceBase.java: Good errors for size-changing ops. |
14:31 | |
p: 0743f03 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/MultiDimArrayInstanceBase.java: Do rest of positional API in MultiDimArray on JVM. |
|||
jnthn | Phew, 140 out of 188 tests. :) | ||
jaffa4 | masak: I assumed it stayed the same for Perl6, some things did not change | 14:32 | |
tadzik | I think it's the same as in Perl 5, this particular thing | ||
vendethiel | tadzik: you'll be pleased to know C#5 fixes that :) | ||
tadzik | vendethiel: oh, I am :) | ||
vendethiel: I' | |||
vendethiel: I'm also sad to realize that Unity is not likely to adopt it any time soon :P | |||
vendethiel | tadzik: Unity uses a butchered version of C# already :) | 14:33 | |
tadzik | yeah, I noticed :P | ||
on ancient mono | |||
*shudder* | |||
vendethiel | .oO( "let's remove access modifiers, they look too confusing" ) |
||
RabidGravy | I thought that 'and' was lower precedence than '&&' in perl 5 too | ||
tadzik | access modifiers? | ||
masak | jaffa4: it did stay the same. | 14:34 | |
jaffa4: Perl 5 has exactly the same distinction between `&&` and `and`. I suggest you learn it. | |||
skids | jnthn++ cruising along on native multidim... guess I'd better dust off the Keccak specs. | ||
masak | jaffa4: or, if you don't feel like learning it (which is fine), I suggest only using `&&`. | ||
vendethiel | tadzik: "public void X()" <- only "void X()" works in unity# | ||
hoelzro | o/ #perl6 | 14:35 | |
lucasb | Good monday to everyone. I can use .subst directly, but sometimes I felt like wanting to use s/// with .subst semantics, not .subst-mutate. Do you think there is room for an adverb that does that, just like P5's s///r ? (I know that :r is already taken for something else) | ||
vendethiel | lucasb: I asked about the same some time ago :P | 14:36 | |
tadzik | vendethiel: nah, both work | ||
skids | Wasn't that S///? | ||
jaffa4 | masak: I used &&, that did not seem to work | ||
vendethiel | tadzik: really? there's something they changed wrt that, but I can't remember right now :). I only used unity for 2 weeks | ||
tadzik | I mean, I even think that the latter might not, if you expect it to be public | ||
vendethiel: certain magic methods do that, yeah :D | 14:37 | ||
like void Awake(), void Update() etc | |||
those Unity fetches via reflection and stuff | |||
jaffa4 | masak: as in Perl 5 | ||
ShimmerFairy | jaffa4: As I understand the code, you need parens around defined (stuff) , so (defined (stuff)) && morestuff | ||
tadzik | actually, not sure if they break if you make them public explicitely, but knowing Unity, they might :P | ||
vendethiel | tadzik: no, I was right. it doesn't work like that in c#. | ||
tadzik: in unity#, no access modifier = public, not in c# | 14:38 | ||
tadzik | oh | ||
huh | |||
class attributes for example don't show up in the editor if they're not public | |||
lucasb | vendethiel: I must read the logs more often. :) What was the answer when you asked about this? | ||
14:38
tinyblak left
|
|||
tadzik | I'd be surprised if it recognized private methods as public and callable then | 14:38 | |
14:39
lizmat joined
|
|||
masak | jaffa4: you're not 100% successful in providing golfed examples. this makes it harder to help you. | 14:39 | |
jaffa4: it also makes it harder for *you* to see what the problem is with your code, since it's still tangled with all these inessentials. | 14:40 | ||
jaffa4: if you put whitespace between `defined` and the `(...)` thing, that means something different than `defined(...)` | |||
jaffa4: *that* is the difference between Perl 5 and Perl 6 that's tripping you up. | |||
lucasb | skids: I tried S///, but I don't understand how it works | ||
masak | jaffa4: thanks to ShimmerFairy for putting me on the right track. I didn't see that before. | 14:41 | |
lucasb | skids: I didn't know it existed :) | ||
vendethiel | tadzik: not sure. but all the methods you define for unity are declared with "public" | ||
aren't* | |||
masak | m: my $a = True; my $b; say defined $a && $b; say defined($a) && $b # jaffa4: see the difference? | 14:42 | |
camelia | rakudo-moar 533d1a: OUTPUT«False(Any)» | ||
dalek | p: 9ccd292 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/MultiDimArrayInstance (11 files): Support cloning multi-dim arrays on JVM. |
||
masak | m: my $a = True; my $b = 4; say defined $a && $b; say defined($a) && $b | ||
camelia | rakudo-moar 533d1a: OUTPUT«True4» | ||
jercos | El_Che: good to know :p | 14:43 | |
14:44
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
jaffa4 | masak: here is the more complete example codepaste.net/gw4fh1 | 14:45 | |
masak | *sigh* :) | ||
jaffa4: hold on, going to repeat the explanation I wrote to you above. | 14:46 | ||
ohb | tadzik, (about closures) i believe in java it will complain that you need to make it final (to avoid differentiating between shallow and deep binding) alghouth they are more anon-classes that could be used as closures | ||
masak | jaffa4: if you put whitespace between `defined` and the `(...)` thing, that means something different than `defined(...)` | ||
jaffa4: *that* is the difference between Perl 5 and Perl 6 that's tripping you up. | |||
skids | m: my $f = "aaa"; my $g = $f ~~ S/a/b/; $f.say; $g.say # lucasb. It's in release notes but apparently broken? | ||
camelia | rakudo-moar 533d1a: OUTPUT«aaaFalse» | ||
14:47
tinyblak joined
|
|||
jaffa4 | masak: I see... so it is not about precedence | 14:47 | |
14:47
tinyblak left
|
|||
jaffa4 | I think many will trip after me | 14:47 | |
masak | in a way it is | ||
jaffa4: so, in essence, you're confused by two things: (a) different precedence between `&&` and `and`, and (b) the fact that function calls become listops if they have whitespace after them | |||
14:48
rindolf joined
|
|||
masak | jaffa4: learn the rules of the language. don't just say "I think many will trip after me" | 14:48 | |
jaffa4: Perl 6 is not a random set of rules. it's a well-thought-out set of rules. learn them. | |||
jaffa4 | I know many , even this one, I just tend to think in Perl5 | 14:49 | |
masak | jaffa4: there are good reasons behind this change of parsing. | ||
jaffa4 | I used Perl5 for 13 years | ||
masak | jaffa4: if you don't learn the new behavior, you will keep being surprised and your programs will have bugs. | ||
lucasb | skids: Thanks! I'm only getting booleans as return too, that's why I didn't understand. | ||
masak | jaffa4: to be on the safe side, always write `foo()`, not `foo ()` | 14:50 | |
jaffa4: but better than that is learning the rules. | |||
jaffa4 | What does define () do? | ||
masak | m: sub foo(|c) { say "{c.elems} arguments passed" }; foo(); foo () | 14:51 | |
camelia | rakudo-moar 533d1a: OUTPUT«0 arguments passed1 arguments passed» | ||
masak | jaffa4: see the above? | ||
jaffa4: does it explain things? | |||
jaffa4 | m: sub foo(|c) { say "{c.elems} arguments passed" }; foo(); foo (),() | 14:53 | |
camelia | rakudo-moar 533d1a: OUTPUT«0 arguments passed2 arguments passed» | ||
masak | right. | ||
in `foo()`, the parentheses are just there for grouping the arguments. | |||
in `foo ()`, the parentheses are an argument (an empty list) | 14:54 | ||
jaffa4 | ok | 14:55 | |
14:55
JimmyZ_ joined
|
|||
ShimmerFairy | m: sub foo(|c) { say "{c.elems} argument{"s" if c.elems - 1} passed: {c.perl}" }; foo(); foo (); foo (), (); # just showing off what c gets | 14:55 | |
camelia | rakudo-moar 533d1a: OUTPUT«0 arguments passed: \()1 argument passed: \(())2 arguments passed: \((), ())» | ||
14:55
khw left
|
|||
masak | jaffa4: the second for is called a "listop". it exists in Perl 5 too, like `print 1, 2, 3;` | 14:55 | |
14:56
amurf joined
|
|||
masak | jaffa4: the difference is that if you do `print (1, 2, 3)` in Perl 5, the parens just become a delimiter, like `print(1, 2, 3)` | 14:56 | |
14:56
colomon left
|
|||
dalek | p: 3f9c111 | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java: Implement special 2D/3D ops on JVM. |
14:56 | |
masak | jaffa4: not so in Perl 6. if you put in the whitespace in Perl 6, the parens always mean "list" | ||
jaffa4: the rule is much more consistent in Perl 6, and avoids certain kinds of Perl 5 mistakes, like `print ($a + $b ) * $c;` | 14:57 | ||
$ perl -Mstrict -wE'my ($a, $b, $c) = (1, 1, 100); say ($a + $b) * $c' | 14:58 | ||
say (...) interpreted as function at -e line 1. | |||
Useless use of multiplication (*) in void context at -e line 1. | |||
2 | |||
$ perl6 -e'my ($a, $b, $c) = (1, 1, 100); say ($a + $b) * $c' | |||
200 | |||
m: my ($a, $b, $c) = 1, 1, 100; say ($a + $b) * $c # without the superstitious parentheses this time ;) | 14:59 | ||
camelia | rakudo-moar 533d1a: OUTPUT«200» | ||
15:00
amurf left
15:09
khw joined
15:12
itz joined
15:13
aborazmeh left
15:20
zakharyas left
15:22
tinyblak joined
15:24
captain-adequate joined
15:28
FROGGS left
|
|||
lucasb | I found about S/// :) It was mentioned in the changelog for June, but not in the release announcement, maybe because it wasn't finished. It only works without the "~~" | 15:32 | |
m: $_ = 'abc'; say S/a/x/; .say | 15:33 | ||
camelia | rakudo-moar 533d1a: OUTPUT«xbcabc» | ||
lucasb | m: $_ = 'abc'; say $_ ~~ S/a/x/; .say | ||
camelia | rakudo-moar 533d1a: OUTPUT«Falseabc» | ||
TimToady | m: say S/a/x/ given 'abc' | 15:36 | |
camelia | rakudo-moar 533d1a: OUTPUT«xbc» | ||
TimToady | there's one workaround | ||
not sure it's where we want to end up though | |||
15:36
stux|RC-only left,
awwaiid left,
[particle] left
15:37
coffee` left,
asdf12z_ left,
bonsaikitten left,
oha left,
_sri left,
timbunce left,
psch joined,
nwc10 joined,
dagurval joined,
awwaiid joined,
bloonix joined,
krakan joined,
bobkare joined,
xiaomiao joined,
_sri joined,
hahainternet joined,
Pauekn joined,
tony-o joined,
Mouq joined,
revdiablo joined,
oha joined,
timbunce joined,
burnersk joined,
bowtie joined,
tinita joined,
[ptc] joined,
stux|RC-only joined,
[particle] joined,
bowtie is now known as Guest4451,
go|dfish joined
15:38
diegok joined,
dpk joined
|
|||
itz | m: $*ARGFILES=open "/etc/issue"; say slurp(); | 15:38 | |
camelia | rakudo-moar 533d1a: OUTPUT«open is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting:1 in sub open at src/RESTRICTED.setting:9 in block <unit> at /tmp/WcTziM8_NQ:1» | ||
15:39
dg joined
|
|||
itz | damm :) | 15:39 | |
lucasb | TimToady: cool :) | ||
15:39
lestrrat joined
|
|||
itz | anyway of testing a filehandle? | 15:39 | |
15:39
FROGGS joined
|
|||
PerlJam | itz: testing it for what? | 15:40 | |
itz | well I wanted to show the difference between | ||
$*ARGFILES=open "/etc/issue"; say slurp(); | |||
$*ARGFILES=open "/etc/issue"; say slurp-rest(); | |||
I wonder if the second form should work and replace the first? | 15:41 | ||
instead of having to use $*ARGFILES=open "/etc/issue"; say $*ARGFILES.slurp-rest(); | 15:42 | ||
FROGGS | jnthn: I have the suspicion that p6routinereturn is not quite what I want for Block.leave :o) | 15:46 | |
PerlJam | itz: I'm not even sure why we have slurp and slurp-rest. I would have just used slurp for both of those things. | 15:48 | |
lucasb | PerlJam: +1 :) | ||
itz | slurp is deprecated on a file handle | ||
japhb | .tell jnthn Great, glad it makes sense to you too; I filed RT #125606 for the "Role requiring private method" issue. | ||
yoleaux | 12:19Z <jnthn> japhb: I think the one at irclog.perlgeek.de/perl6/2015-07-11#i_10881271 should indeed DWYM; feel free to file a ticket on that | ||
japhb: I'll pass your message to jnthn. | |||
15:49
Spot__ joined,
clkao joined
|
|||
lucasb | To me, .slurp-rest feels like: Why the "rest"? I just opened the filehandle. Has anybody read a little of it before me? | 15:49 | |
TimToady | you could've | ||
but the main reason is to distinguish from .slurp, which implies a close | 15:50 | ||
.slurp-rest doesn't | |||
PerlJam | oh, and slurp-rest doesn't close? | ||
ShimmerFairy | I personally never understood (or even heard) the rationale for .slurp-rest | ||
TimToady | hard to understand if you haven't heard it :) | 15:51 | |
lucasb | I understand, but to me I don't see anything wrong with IO::Path.slurp *closing* and IO::Handle *don't closing* the handle. | ||
TimToady | it was confusing people | ||
lucasb | That's two different classes; they do different things with the messages they receive | ||
itz | should slurp-rest() behave on $*ARGFILES as slurp() did? | 15:52 | |
ShimmerFairy | TimToady: it did put a hamper in me doing open("file").slurp , out of an interest in being explicit about the file opening. I don't know why, but I don't like slurp("file") as much. | ||
itz | actually it doesn't close it so not I guess (?) | 15:53 | |
15:53
nys joined
15:54
JimmyZ_ left,
JimmyZ_ joined
|
|||
[Coke] wonders if we'll ever be able to do strict exception handling like in Java. | 15:55 | ||
TimToady has heard very few people claim that was a desirable feature | 15:56 | ||
[Coke] | was just burned by this in another language-on-top-of-jvm, where we had a bit of code that threw an exception outside of any try/catch handlers, and it blew up in prod about 2 years after it was deployed. (whereas in java, it wouldn't even have compiled) | ||
TimToady: well, +1 from me, fwiw. :) | 15:57 | ||
ShimmerFairy | When I was learning Java for a while, it was certainly interesting. But I didn't appreciate being forced to use try { } catch blocks (since I don't like how it makes you add another level of indentation to the happy path). | ||
However, the try-with-resources (or whatever it's termed) thing was a nice touch :) | |||
[Coke] | I also find the boilerplate it demands painful in java sometimes. nice to have the suspenders if you want them, though. | 15:58 | |
15:58
atroxaper joined
|
|||
ShimmerFairy | I also find it painful in C++, which is why I don't use exceptions in C++ as much as I would otherwise like. (And it's why I appreciate Perl 6's CATCH { } blocks and how they don't need a try part ☺) | 15:59 | |
15:59
ggherdov joined
16:00
JimmyZ__ joined
|
|||
TimToady bows | 16:00 | ||
japhb | Too bad we don't have someone present who can tap you on the shoulder with a sword and bestow a knighthood. | 16:01 | |
SerTimToady | |||
16:01
JimmyZ_ left
|
|||
itz | I think the Ser prefix lessens life expectancy (at least on TV) | 16:02 | |
japhb | On reflection I wonder if that ceremony was a reminder that the regent could be choosing to remove the head, rather than merely tap them on the shoulder. | ||
TimToady | well, one gets tapped for other duties, which then shortens your life span :) | 16:03 | |
japhb | Heh | ||
16:03
atroxaper left
|
|||
TimToady apologizes for mixing one/you | 16:03 | ||
geekosaur | japhb, more or less. (more accurately, that accepting the knighthood specifically puts you in a position where the regent can remove your head) | 16:04 | |
TimToady | rather than hanging, I suppose... | ||
japhb | geekosaur: Ah, interesting. | 16:05 | |
PerlJam imagines the french had a hard time knighting people with a guillotine | |||
japhb | That shoulder tap had a hell of a bite. | 16:06 | |
jaffa4 | m: say [1]==[2]; | 16:07 | |
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
jaffa4 | m: say [1]==[2,3]; | 16:08 | |
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
jaffa4 | m: say (1)==(2,3); | ||
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
geekosaur | mm, is that numifying to the length? | ||
japhb | geekosaur: I'm betting yes. | ||
ShimmerFairy | yep, that's what == does | ||
jaffa4 | How can I make full comparison for content as well? | 16:09 | |
TimToady | eqv | ||
jaffa4 | m: say [1] eqv [2]; | ||
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
jaffa4 | m: say [1] eqv [1]; | ||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
jaffa4 | m: say (1) eqv (1); | ||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
jaffa4 | m: say (1) eqv (2); | ||
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
jaffa4 | m: say (1,2) eqv (1,2); | 16:10 | |
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
ShimmerFairy | That reminds me, it'd be nice if [[1,2]] ~~ [[1,2]] DWIMmed | 16:11 | |
m: say [[1, 2]] ~~ [[1, 2]] | |||
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
ShimmerFairy | (at least 'eqv' works in that case) | ||
TimToady | m: say (1,2) === (1,2) | ||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
TimToady | m: say [1,2] === [1,2] | ||
camelia | rakudo-moar 533d1a: OUTPUT«False» | ||
16:11
diana_olhovik joined
|
|||
dalek | ast: db20bc7 | (Steve Mynott)++ | S32-io/slurp.t: partially fix deprecation |
16:12 | |
16:16
itz left
16:17
_itz is now known as itz
|
|||
jaffa4 | What is ("2", 4, 3, "1").list and ("2", 4, 3, "1")? | 16:20 | |
.perl gives both | |||
What is the difference? | |||
TimToady | that's the List/Parcel distinction that may or may not go away with the GLR | 16:22 | |
Parcel is basically a tuple type, immutable if its parts are immutable | 16:23 | ||
lists are a more like arrays, but without enforced containers on each element | |||
but the main difference is lists are conceptually lazy, while parcels are not | 16:24 | ||
16:25
tinyblak left
|
|||
jaffa4 | How can I convert a parcel to a list? | 16:25 | |
TimToady | (a parcel may contain a lazy list, but that's different) | ||
ShimmerFairy | m: say ("2", 4, 3, "1").WHAT; say ("2", 4, 3, "1").list.WHAT | ||
camelia | rakudo-moar 533d1a: OUTPUT«(Parcel)(List)» | ||
jaffa4 | ok | 16:26 | |
TimToady | parcels are primarily for argument lists, which need to evaluate all the arguments at the top level before doing the call | ||
but some of those evaluated arguments can be lazy | |||
jaffa4 | I had something like this map {}, @b eqv (1,2,3,4)...... | 16:27 | |
TimToady | (if we didn't evaluate all the arguments, we couldn't do multiple dispatch on the actual type) | ||
jaffa4 | and it did not work | ||
TimToady | yeah, eqv requires two arguments of identical type | ||
I think ~~ would've worked there | 16:28 | ||
m: say map { $_ }, 1,2,3,4 ~~ (1,2,3,4) | 16:29 | ||
camelia | rakudo-moar 533d1a: OUTPUT«1 2 3 False» | ||
TimToady | oops | ||
m: say (map { $_ }, 1,2,3,4) ~~ (1,2,3,4) | |||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
TimToady | m: say (map { $_ }, 1,2,3,4) eqv (1,2,3,4).list | ||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
TimToady | but yeah, that one is a bit of a WAT | ||
jaffa4 | and I can see it can be array too | 16:30 | |
TimToady | m: say [map { $_ }, 1,2,3,4] eqv [1,2,3,4] | ||
camelia | rakudo-moar 533d1a: OUTPUT«True» | ||
16:30
TEttinger joined
|
|||
TimToady | but constructing two arrays is kinda wasted effort, if that's all you do with 'em | 16:31 | |
jaffa4 | it printed Array.new("2", 4, 3, "1") | ||
TimToady | that looks like an old version | ||
jaffa4 | m: my @b = ("2",4,3,"1"); say @b.perl; | 16:32 | |
camelia | rakudo-moar 533d1a: OUTPUT«["2", 4, 3, "1"]<>» | ||
TimToady | that's what it's printed for a couple months now | ||
and we're hoping to lose the <> soon | |||
(more GLR adjustments) | 16:33 | ||
b2gills | kanl: (from backlog) this works: `m: my @a = 1,2; my @b = <a b>; @a Z[&(-> $a, $b { .say for $a, $b, '' })] @b` | ||
m: my @a = 1,2; my @b = <a b>; @a Z[&(-> $a, $b { .say for $a, $b, '' })] @b | |||
camelia | rakudo-moar 533d1a: OUTPUT«1a2b» | ||
16:35
JimmyZ_ joined
16:36
JimmyZ__ left
|
|||
b2gills | The comments in this change: github.com/perl6/roast/commit/570c8cc952 don't represent the actual code, as the files aren't open | 16:36 | |
16:40
dha joined
|
|||
jaffa4 | WHere is the module list< | 16:40 | |
dha | Not sure how up to date it is, but modules.perl6.org | 16:44 | |
tadzik | as up to date as it gets | 16:45 | |
jaffa4 | Where should I add a new entry to the module list? | ||
tadzik | fork and edit the list on github.com/perl6/ecosystem | 16:46 | |
dalek | osystem/jaffa4-patch-1: 1451955 | jaffa4++ | META.list: Update META.list added Dependency-Sort |
16:48 | |
16:57
abraxxa left
16:59
JimmyZ_ left
17:05
dakkar left
|
|||
cognominal | according to Antidote, adouber, the french for "to knight" comes from Frankish "to hit". Apparently used in English, when you want to unmess the chessboard www.chessgames.com/perl/chessgame?g...mp;kpage=5 | 17:09 | |
geekosaur | ...I dub thee... (aha!) | 17:12 | |
17:12
JimmyZ_ joined
|
|||
RabidGravy | I may need treatment, I appear to be using "my $foo = do given .... " an awful lot | 17:19 | |
17:19
JimmyZ_ left
|
|||
ugexe | you and me both | 17:19 | |
flussence | wasn't writing it "do given" supposed to be a temporary workaround? | 17:20 | |
jercos | do given ye for all in some | ||
FROGGS | jnthn: how am I meant to return a value from a block (early)? | 17:24 | |
skids | Will there be a difference, post-GLR, between how one would MMD multisigs with components like :($a) and :(*@s) when you do func() <== lazy-thing? i.e. will it always start the iterator to look at the first arguments, or is a feed a special case? | 17:26 | |
17:31
rurban left
17:40
espadrine left
|
|||
jnthn | FROGGS: Probably needs an nqp::leave op, which will emit the appropriate VM-level return_* instruction, if it's being done from within the block. | 17:41 | |
yoleaux | 15:48Z <japhb> jnthn: Great, glad it makes sense to you too; I filed RT #125606 for the "Role requiring private method" issue. | ||
moritz | FROGGS: today I saw a car with license plate FR GS (plus some numbers) and immediatly thought of you :-) | 17:44 | |
17:48
molaf_ joined
|
|||
masak | [Coke]: I think traits can get you pretty close to having checked exceptions in Perl 6. the one missing component is having a just-parsed Routine check itself whether it throws exceptions (say) doing a predefined role. | 17:50 | |
FROGGS | moritz: I've got one with FR-O 665 at home :o) | ||
masak | [Coke]: that last feature (installing hooks on parsing certain code elements) is something I hope to add as part of the macro grant. | ||
17:51
rurban joined
|
|||
moritz | FROGGS: :-) | 17:51 | |
17:52
molaf left
17:54
kurahaupo joined
|
|||
dha | So, in p6 pod, "|" is special inside X<> entries. What do you do if you need a literal "|" inside an X<>? | 17:54 | |
(and, although I don't see it documented "$!" inside an X<> seems to be problematic as well. | |||
) | |||
lucasb | I like being able to use different syntax for creating the same kind of thing: -> $a,$b { $a+$b }, { $^a + $^b }, (* + *) | 18:02 | |
wrt to pairs vs. named parameters, I wouldn't make them different things, instead I would prefer if they were even more equal. | |||
Maybe this wouldn't be technically possible, but in my messy world, I would have enjoyed if things were like these: | |||
In sub f(:$a), f('a'=>1) and f($pair) would be a named parameters, since the signature clearly says it doesn't take positionals. | |||
In sub f($x), f(a=>1) and f(:a(1)) would be a pair positional, since the signature clearly says it doesn't take named parameters. | |||
Don't ask me about other edge cases, because I don't know :) | |||
TimToady | that would be fragile in the face of refactoring to multi, which happens a lot | 18:03 | |
and I don't think you're gonna get jnthn++ to rewrite the binder any time soon :) | 18:04 | ||
masak | we had an extensive discussion the other day. | 18:05 | |
I'll say again what I said then: I like the local optimum we're in, and I haven't seen an argument so far that makes me want to change things. | |||
the whole thing *is* a bit of a waterbed bump issue. and we're not getting rid of the bump, we can only push it around. | 18:06 | ||
18:06
Hor|zon left
|
|||
masak | in light of that, let's not. | 18:06 | |
lucasb | Thanks TimToady++, masak++; I understand my opinion is a dream; just wanted to say it :) | ||
18:06
kurahaupo left
|
|||
masak | lucasb: you can always have fun in slangs :) | 18:07 | |
TimToady | to go with Tuxic, we also need Toxic, Texic, Taxic, and Tixic | ||
lucasb | .oO( Masakix and Toadix too? ) |
18:08 | |
TimToady | you've already got Toadix :) | 18:09 | |
lucasb | yeah, P6 already is Toadix :) | ||
ShimmerFairy | masak: I don't see it as a waterbed issue; what problems would arise from making a => 42 always be a Pair and :a(42) always be a named parameter, and never the other way? ("Would break existing code" doesn't count :P) | 18:14 | |
18:14
kurahaupo joined
|
|||
masak | ShimmerFairy: a fair question. let me think about it a bit. | 18:17 | |
moritz | it would bar :$a for Pair usage | 18:19 | |
FROGGS | I guess that's nonsense? | 18:20 | |
~/dev/MoarVM$ perl6 -e 'use nqp; say (FOO: for ^3 { nqp::leave(123); say "alive" }); say "ho!"' | |||
123 123 123 | |||
ho! | |||
ShimmerFairy | I've never seen that, actually. I can only recall seeing :$a in function calls and the like. | ||
dha | hm... that's unfortunate. | 18:27 | |
m: my $x = 54;printf "One less than %d is %d\n", $x, --$x; | |||
camelia | rakudo-moar 533d1a: OUTPUT«One less than 53 is 53» | ||
dha | Possibly even more unfortunate: | 18:28 | |
m: my $x = 54;printf "one less than %d is %d\n", $x, $x--; | 18:29 | ||
camelia | rakudo-moar 533d1a: OUTPUT«one less than 53 is 54» | ||
TimToady | so don't do that | ||
mst | dha: yeah, that's completely expected | ||
ShimmerFairy | I forget, isn't that kind of stuff traditionally the dreaded "undefined behavior" in C-land ? | ||
mst | I wrote an entire blog post about not doing that | ||
dha | The latter is expected? Ok... | ||
mst | well, more, 'weird stuff happening when you use --$thing and $thing in the same arglist is expected' | 18:30 | |
dha | Yeah, ok, that I can accept. | ||
ShimmerFairy | (that is, doing stuff with a variable multiple times in an expression, when at one point in the expression you use one of the increment/decrement ops) | ||
dha | BUT THIS MAKES IMPLEMENTING 99 BOTTLES OF BEER ON THE WALL MORE ANNOYING. | ||
Well, this seems to work better... | 18:31 | ||
m: $x = 54;say "one less than $x is {--$x}" | 18:32 | ||
camelia | rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GaKVqDlSjBVariable '$x' is not declaredat /tmp/GaKVqDlSjB:1------> 3<BOL>7⏏5$x = 54;say "one less than $x is {--$x}"» | ||
dha | m: my $x = 54;say "one less than $x is {--$x}" | ||
camelia | rakudo-moar 533d1a: OUTPUT«one less than 54 is 53» | ||
dha | ...but I'm not convinced it's reliable. | ||
And I suspect I'm smart to be so unconvinced. | 18:33 | ||
TimToady | well, there's a statement sequence inside the block, so arguably there's a sequence point | ||
18:33
amurf joined
|
|||
ShimmerFairy | what about for 99...1 { say "One less than $x is {$x-1}" } ? | 18:34 | |
18:34
Hor|zon joined
|
|||
dha | So... that *would* be reliable? | 18:34 | |
TimToady | functional programming without side effects? | 18:35 | |
masak | m: my $x = 54;printf "one less than %d is %d\n", $x, $x-- | ||
camelia | rakudo-moar 533d1a: OUTPUT«one less than 53 is 54» | ||
masak | I'm with dha. that's a bug. in sprintf. | ||
m: say $x, $x-- | |||
camelia | rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/oxfqTHSEPcVariable '$x' is not declaredat /tmp/oxfqTHSEPc:1------> 3say 7⏏5$x, $x--» | ||
masak | m: my $x = 54; say $x, $x-- | 18:36 | |
camelia | rakudo-moar 533d1a: OUTPUT«5354» | ||
masak | hm. or a bug elsewhere? | ||
I've always thought of Perl 6 as having sequence points, and each argument being at least one sequence point, left-to-right. | |||
dha | Well, that definitely smells like a bug to me. Well beyond a result one might expect by altering a term within a statement. | ||
TimToady | you can't depend on the order of side effects like that | ||
ShimmerFairy | If C/C++ considers that kind of usage undefined behavior (wouldn't know offhand), I'm not prepared to call it a bug. I'm sure the ISO guys know what they're doing, most of the time :P | 18:37 | |
18:37
dwarring joined,
spider-mario joined
|
|||
dalek | osystem: 1451955 | jaffa4++ | META.list: Update META.list added Dependency-Sort |
18:37 | |
osystem: fd56d1b | (David Warring)++ | META.list: Merge pull request #49 from perl6/jaffa4-patch-1 Update META.list add Dependency-Sort |
|||
masak | TimToady: I'm surprised to hear that. I'll have to revise my understanding of argument evaluation, then. | ||
TimToady | yes, it evaluates left-to-right, and you still can't depend on the interaction of side effects with references | ||
18:38
amurf left
|
|||
TimToady | it evaluates $x and returns $x, not it's value | 18:38 | |
masak | *nod* | ||
TimToady | we can't do otherwise till we know how it's to be bound | ||
masak | oh, that is true. | ||
TimToady | so this is a Will Not Fix | ||
masak silently shuffles over to the "yeah, so don't do that" camp | 18:39 | ||
basically this falls out of having `is rw` | 18:40 | ||
TimToady | or even default ro that can cheat with rw for efficiency | ||
which is what the current design is optimized for | |||
otherwise we'd have to pessimize everything to 'is copy' | 18:41 | ||
jnthn | heh, was just about to make the points TimToady++ just did, but by the time I caught up wiht backlog he'd made 'em | 18:44 | |
foo($pair) becoming a named breaks the "we always statically/syntactically know what is a named arg and a positional arg" | |||
Which would be horrible from a compiler/performance perspective, if I'm wearing that hat. | 18:45 | ||
But I don't want it from a refactoring/obvious visual mapping to behavior perspective either ;) | |||
18:47
atroxaper joined
|
|||
jnthn | Rightly, lets see if I can nail the last 12 VM-level multi-dim tests on JVM... | 18:48 | |
18:51
khw left
18:52
atroxaper left
|
|||
[Coke] | what are you using for compact storage on the JVM? | 18:57 | |
moritz | IO::Notification.watch_path gives me a FileChangeEvent::FileRenamed for both created and deleted files | ||
is that expected? | |||
jnthn | [Coke]: A depressing amount of copy-paste code...and JVM native arrays. | 18:58 | |
moritz: Good question, iirc it's a fairly direct exposure of what libuv tells us. | 18:59 | ||
19:04
telex left
19:06
telex joined,
khw joined
19:07
nowan_ joined,
pullphinger joined,
pullphinger left
|
|||
timotimo | it could be that it's platform-dependent, or maybe even dependent on what exactly the application does to create a file or delete it? | 19:08 | |
19:08
pullphinger joined
|
|||
timotimo has not done much with filesystem watchers yet | 19:08 | ||
19:09
nowan left
|
|||
dha | In the p5->p6 doc, in the bit about whitespace, it shows these contrasting examples: | 19:13 | |
$seen {$_} ++; # Perl 5 | |||
$seen{$_}++; # Perl 6 | |||
Should that second one not be C<%seen{$_}++> ? | |||
masak | yes, it should. | 19:16 | |
today I had a silly idea for a slang -- I thought I'd share. | 19:17 | ||
dha | Oh good. if you haven't beaten me to it, I'll change that. :-) | ||
dalek | c: e7051e3 | (David H. Adler)++ | lib/Language/5to6.pod: Changed Perl 6 example in Whitespace section from C<$seen{$_}++> to |
19:19 | |
dha | masak - Slang is good. :-) | ||
masak | so, let's say you have a `class C ` and a `my %h{C}` -- then the entries in %h could almost be seen as a kind of "external attribute" or "outside-in attributes". and we could allow `$c.%h` to mean `%h{$c}`. | ||
good idea, or great idea? :P | 19:20 | ||
it would be kind of like `$c.&sub()`, but for data. | 19:21 | ||
jnthn notes that $c.@foo already has a meaning | 19:24 | ||
masak | that somehow doesn't bother me much. | 19:25 | |
I'd also be fine with the syntax `$c.%h{}`, which mirrors `$c.&foo()` more closely. | |||
RabidGravy | Hmm as it currently stands I think Audio::Encode::LameMP3 is going to be too slow, the copying of large arrays to CArrays and back is really quite costly | 19:30 | |
jnthn | RabidGravy: What're you copying them from/to? | ||
[Coke] | masak: scoping on that seems.. hard. | ||
masak | RabidGravy: if only someone was working on compact multidim arrays... :P | 19:31 | |
[Coke]: how so? `$c` and `%h` must both be in scope, or course. it's literally just sugar for `$h{$c}`. | 19:32 | ||
RabidGravy | masak :) | 19:34 | |
dalek | p: 5c3771f | jnthn++ | t/moar/02-multidim.t: Eliminate bogus test. nqp::numdimensions op is for use on instances only. |
19:35 | |
p: b61ab1e | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/reprs/MultiDimArray (12 files): Implement serialize/deserialize of MultiDimArray. |
|||
RabidGravy | jnthn, basically @array -> CArray[$type] -> lame_encode(CArray) -> CArray[uint8] -> Buf | ||
19:35
rindolf left
|
|||
dha | So, in p5's perlsyn, it indicates that all declarations take place at compile time. a) is that still true in p6 and b) is there any reason that should be explicitly pointed out if it isn't? | 19:36 | |
jnthn | It'd be desriable to eliminate 2 of those steps :) | ||
dha: Yes, it's still true in Perl 6; there's also more things that count as declarations. | |||
19:37
bin_005_i joined
|
|||
jnthn | m: sub foo() { say "I'm here!" }; BEGIN foo; | 19:37 | |
camelia | rakudo-moar 533d1a: OUTPUT«I'm here!» | ||
jnthn | That one I guess is same as Perl 5 | ||
m: class C { method m() { say "I'm here!" } }; BEGIN C.m; | |||
camelia | rakudo-moar 533d1a: OUTPUT«I'm here!» | ||
jnthn | But classes also come into existence at BEGIN time | 19:38 | |
m: class C { method m() { say "I'm here!" }; BEGIN C.m; } # this too, even... | |||
camelia | rakudo-moar 533d1a: OUTPUT«I'm here!» | ||
jnthn | But don't do that :P | ||
(the final one I did, that is) | |||
dha | ok. I think that may be out of the scope of the Declarations section of perlsyn anyway. | ||
jnthn | Maybe so. BEGIN time is very much a thing in Perl 6 though :) | 19:39 | |
So much so I managed to do a whole hour's talk about it :P | |||
[Coke] | masak: oh. meh? | 19:41 | |
dha | This is why, in the documents I'm working on, I make a point of saying that these documents are meant to guide you from p5 to p6 and, therefore, will not be exhausively documenting p6. :-) | 19:42 | |
masak | [Coke]: I could see it being useful. I sometimes want to "annotate" my own or other others' objects with externally available information. | ||
[Coke]: like, say, in a DFS algorithm, I want to mark nodes as "seen" or "visited". | 19:45 | ||
dalek | p: ef58e0d | jnthn++ | t/jvm/02-multidim.t: Give t/jvm a copy of the multi-dim tests. |
19:46 | |
19:48
[Sno] left
|
|||
RabidGravy | jnthn, yeah, unfortunately you can't do anything with the CArrays without passing the length around | 19:48 | |
dalek | p: 80a51ca | jnthn++ | t/jvm/02-multidim.t: Add uncomposed/type-object edge-case tests. The JVM implementation nails these, but MoarVM probably won't yet. |
19:51 | |
19:52
rurban left
|
|||
hoelzro | when determining the longest literal prefix for a rule, I see that | alternation variants can extend the literal prefix. Does the same apply for ||? | 19:57 | |
masak | no. | 19:58 | |
hoelzro | thanks masak | ||
jnthn | Yeah, hitting a sequential alternation marks the end of the declarative prefix. | 20:00 | |
(just checked that's exactly what happens in the code) | |||
hoelzro | I saw the behavior, just checking to see that it made sense spec-wise =) | ||
jnthn | aye belive so | 20:01 | |
*aye, I believe so... | |||
FROGGS | 'think so too fwiw | ||
aye feel you forgot something there :P | |||
TimToady | m: say 'food' ~~ / 'foo' | ('food' || 'doof')/ | 20:02 | |
camelia | rakudo-moar 533d1a: OUTPUT«「foo」» | ||
FROGGS | doof O.o | ||
TimToady | hmm, STD would've picked 'food' there | ||
20:02
TEttinger left
|
|||
FROGGS | ò.ó | 20:02 | |
TimToady | it counts the first part of the || as declarative | ||
20:02
darutoko left
|
|||
jnthn | TimToady: Declarative but optional, I presume? | 20:03 | |
TimToady | it counts the 'food' as part of LTM, iirc | ||
on the assumption that most || are just error throws | 20:04 | ||
m: say 'food' ~~ / 'foo' | ('food' <!> || 'doof')/ | 20:05 | ||
camelia | rakudo-moar 533d1a: OUTPUT«「foo」» | ||
dha | Ok, so in Perl 5, C<if>, C<unless>, C<while>, C<until>, C<for>, C<foreach>, and C<when> can be used as statement modifiers. Other than C<do {...} while (blah)> being replaced with C<repeat {...} while(blah)>, are there any restrictions in p6 on these being used as statement modifiers? | ||
20:05
diana_olhovik left
|
|||
masak | TimToady: well, does that have any support in S05? otherwise S05 should probably mention that... | 20:06 | |
RabidGravy | dha, and no foreach | ||
hoelzro | fwiw, Grammar::Tracer disagrees with the longest literal prefix conclusion =/ | ||
masak | dha: yes, you can only nest conditional modifiers inside loopy ones. no other combination, at least not without parens. | ||
m: .say if $_ %% 2 for 1..10 | 20:07 | ||
camelia | rakudo-moar 533d1a: OUTPUT«246810» | ||
masak | m: .say for 1..10 if True | ||
camelia | rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Q3__3m6WqyMissing semicolonat /tmp/Q3__3m6Wqy:1------> 3.say for 1..10 if 7⏏5True» | ||
dha | RabidGravy - Well, foreach is now for, and the c-style for is now loop. | ||
masak - uh... not sure if I'm clear on what you're saying there. | 20:08 | ||
TimToady | masak: depends on how you read it...it says that LTM is terminated by a || | 20:09 | |
dha | Are you saying that I can't do C<< foo() if $x > 5 >>? Or possibly that I can do that, but it would have to be C<< foo() if($x > 5 >>? | ||
sorry, ($x > 5) | 20:10 | ||
jnthn | dha: No, you can do C<< foo() if $x > 5 >> just fine | ||
masak | dha: I'm saying it has to be `stmt if .. for ..` in that order, but the `if` can be any conditional (or missing) and the `for` can be any loop (or missing) | ||
jnthn | dha: It's that you can't do like C<< foo() for @a if $x > 5; >> for example | ||
TimToady | masak: actually, it's explicitly required at S05:2885 | 20:11 | |
masak | right, loops may not nest inside confitionals | ||
TimToady: ok, good. | |||
TimToady | so this is a bug, by that | ||
masak submits rakudobug | 20:12 | ||
TimToady | m: say 'food' ~~ / 'foo' | ('food' <!> || die "Should die here")/ | ||
camelia | rakudo-moar 533d1a: OUTPUT«「foo」» | ||
dha considers how to phrase this... | |||
hoelzro | the longest literal prefix is a static property of a Regex, right? would it make sense to expose that as a property on a Regex object, so that users can discover what it is without having to dive into rakudo internals? | ||
masak .oO( well yeah, if it's correctly implemented... ) :P | 20:13 | ||
TimToady | hoelzro: as currently defined, ab [ cd | ef ] has two longest literals | 20:14 | |
hoelzro | ah, so the longest literal for tie breaking depends on which actually matched, right? | ||
20:14
frobisher joined
|
|||
TimToady | right | 20:15 | |
it's not clear whether those semantics will survive some of the optimizations I'd like to do, though | |||
hoelzro | alright | ||
20:16
dha left
|
|||
RabidGravy | right, it took a gnat's cock over an hour to encode a 5:50 WAV file to a 320kbps WAV at moderate quality | 20:16 | |
this clearly won't work for streaming | |||
:-\ | |||
TimToady | not yet | 20:17 | |
RabidGravy | 320kbps MP3 rather | ||
20:19
frobisher is now known as dha
|
|||
FROGGS | hah, working on leave() almost makes me feel that I know what I'm doing :P | 20:19 | |
dalek | p: bd3a92a | jnthn++ | tools/build/MOAR_REVISION: Bump to MoarVM with some multi-dim fixes. |
20:20 | |
p: 65d85a3 | jnthn++ | t/moar/02-multidim.t: Run some extra multi-dim tests on Moar. |
|||
dha | I guess my remaining question about statement modifiers is, is there some way in which C<loop> can be used as one? | 20:22 | |
masak | no. | ||
dha | Didn't think so. ok. | ||
RabidGravy | am I right in saying that the return type plays no role whatsoever in multi dispatch? | 20:25 | |
FROGGS | correct | 20:26 | |
would be nice if it was though, IMO | |||
though maybe it would cause too much trouble | 20:27 | ||
like forcing the caller to be strict on the expected return type to not have more than one mmd candidate | 20:28 | ||
RabidGravy | yeah especially chaining multi methods to multi methods | ||
jnthn | Indeed | 20:29 | |
FROGGS: I'll look at your leave work tomorrow :) | 20:30 | ||
20:31
kaare_ left
|
|||
TimToady still wonders whether a small return should just be called "ret" | 20:31 | ||
jnthn got done with the JVM porting of the multi-dim array underpinnings | |||
dha | Small Prophet, Quick Return. | 20:33 | |
RabidGravy | not a slight return then | 20:35 | |
20:37
dwarring left
|
|||
dha | Quite frankly, I'm still surprised that they let him get away with that title, but wouldn't let him use "Is There A Doctor In The Horse" | 20:37 | |
20:37
synbot6 joined
|
|||
FROGGS | jnthn: it changed in the meantime :P | 20:38 | |
jnthn | FROGGS: Yes, I noticed I've more commits to look at now ;) | ||
FROGGS | jnthn: no, not committed yet, but will do before going to bed | 20:39 | |
20:39
synbot6 left
|
|||
jnthn | OK :) | 20:40 | |
Gonna get some rest...had an early morning | |||
'night | |||
FROGGS | gnight jnthn | 20:41 | |
RabidGravy | nighty night | 20:42 | |
masak | 'night, #perl6 | ||
FROGGS | m: say Block.^mro | 20:44 | |
camelia | rakudo-moar 533d1a: OUTPUT«(Block) (Code) (Any) (Mu)» | ||
20:50
n0tjack left
20:51
xfix left
20:53
FROGGS left
|
|||
dha | Are there any significant differences between p5's C<goto> and p6's C<goto>? | 20:57 | |
PerlJam | dha: yeah, the latter doesn't work yet :) | 20:58 | |
dha | Heh. But if it *did* work... | ||
Am I safe in saying "It doesn't work. But when it does work, it will be pretty much the same as it was in Perl 5"? | 21:02 | ||
PerlJam | I think p6's goto is a little more structured, but I'd check S04 to be sureer. | ||
dha | Yeah, I looked at S04. It made my brain hurt. | ||
Also, I seem to have found another search bug at doc.perl6.org. Searching for "..." gives a result, but when you go to it the page is not found. | 21:04 | ||
21:06
meisl joined
|
|||
meisl | hello #perl6 | 21:06 | |
21:08
pullphinger left,
lucasb left
21:10
[Sno] joined,
skids left
21:13
colomon joined
21:14
_sri left,
_sri joined
21:22
espadrine joined
21:26
colomon left
21:27
colomon joined
21:35
ilogger2 joined,
ChanServ sets mode: +v ilogger2
21:45
][Sno][ joined
22:05
synbot6 joined
22:11
amurf joined
22:15
amurf left
22:19
dha joined
|
|||
dha | Achievement unlocked: perlsyn finished. | 22:20 | |
(sort of, anyway.) | 22:21 | ||
22:23
atroxaper joined
22:28
atroxaper left
|
|||
RabidGravy | right, bed time. | 22:34 | |
22:56
amurf joined
23:03
skids joined
|
|||
dha | Do we have a Getopt kind of module for Perl 6 yet? Or some kind of built in capacity for dealing with command line flags in programs? | 23:03 | |
skids | So, what was the rationale behind having unhandled Failures carp when DESTROYed? | 23:05 | |
23:05
dha left
|
|||
skids | dha: sub MAIN does some stuff. But only if you want to conform to what it does. Not that that's a bad idea for new apps, but it isn't getopt and can't emulate legacy stuff. | 23:06 | |
raiph | dha: perl6advent.wordpress.com/2010/12/...main-subs/ | 23:10 | |
skids | Hrm, is there a way to remove a submethod from a parent class when subclassing it? | 23:11 | |
raiph | I've got 'Foo.pm6' in cwd. Script 'Bar.pl6' contains 'use Foo;'. But 'perl6 Bar.pl6' says "Could not find Foo...". What am I doing wrong? | 23:15 | |
skids: submethods don't get inherited | |||
skids trying to figure out how to subclass Failure and remove DESTROY. | 23:16 | ||
I don't want that behavior. | |||
raiph | skids: will shadowing the submethod suffice? | 23:17 | |
skids | Nope, tried that. | ||
Also tried self.Bool to autohandle it in the subclasse's DESTROY, but that doesn't seem to work either. | 23:18 | ||
I don't see why the behavior is useful to begin with, IMO one should have to use a specially flaovored Failure to get GC warnings. | 23:19 | ||
Just because I create a Failure doesn't mean I want it active. If I decide otherwise and throw it in the trash it should just go away. | 23:21 | ||
raiph sees that perl6 -I. *does* work after all | 23:33 | ||
skids | Anyway, on more minor Failure related issues, comments/bikeshedding for github.com/rakudo/rakudo/pull/470 is welcome. | 23:42 | |
raiph surprised that perl6 -I. seems to have stopped working again | 23:43 | ||
skids | I've never use -l. specifically. | ||
raiph | ah, just figured it out. was getting extensions wrong. | 23:44 | |
skids: do you use PERL6LIB? | |||
skids | sometimes, or "use lib" in the script... the latter especially with t/ directories. | ||
Or -l./something. I'm usually not working with scripts in the cwd. | 23:45 |