»ö« 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:21
Akagi201 joined
00:27
AlexDani` joined
00:29
AlexDaniel left,
nys left,
nys joined
00:32
vendethiel left
00:46
AlexDani` left
00:47
vendethiel joined
01:01
Akagi201 left
01:05
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
raiph | m: say 'ffl'.uc # (also even thornier stuff like 'i'.uc when locale is Turkish) RT #125556 | 01:07 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=125556 | ||
camelia | rakudo-moar 01edd3: OUTPUT«ffl» | ||
01:11
BenGoldberg joined
01:25
leont left
01:29
vendethiel left
01:32
ssqq joined
01:39
vendethiel joined
|
|||
ssqq | how to compiler foo.pm6 souce code to foo.movam binary file, then could run with moar foo.movam | 01:43 | |
dalek | kudo-star-daily: 0e60149 | coke++ | log/ (9 files): today (automated commit) |
01:47 | |
rl6-roast-data: 41c8882 | coke++ | / (9 files): today (automated commit) |
|||
01:48
geekosaur left
01:52
geekosaur joined
02:03
vendethiel left
02:04
vendethiel joined
02:05
beastd left
02:08
nys left
02:21
noganex joined
02:24
noganex_ left
|
|||
colomon_ | Trying to install DateTime::TimeZone on latest rakudo moar via panda ends with “Aborted (core dumped)” | 02:26 | |
02:29
petercommand left
02:32
tinyblak joined
02:33
tinyblak left,
tinyblak joined,
adu joined
02:36
petercommand joined
02:47
ssqq left,
gfldex left
02:51
vendethiel left
02:53
Ben_Goldberg joined
02:56
BenGoldberg left
02:59
vendethiel joined
03:12
bin_005 joined,
tinyblak_ joined
03:16
tinyblak left
03:23
vendethiel left
03:32
vendethiel joined
|
|||
raiph | colomon_: ==> Successfully installed DateTime::TimeZone (perl6 -v --> This is perl6 version 2015.06-177-g01edd37 built on MoarVM version 2015.06-48-g017d184) | 03:45 | |
03:48
Ben_Goldberg left
03:49
bin_005 left
03:58
khw left
|
|||
dalek | kudo/nom: a59ab30 | (Nick Logan)++ | src/core/IO/Path.pm: remove Str.path leftovers in IO::Path.ACCEPTS ./perl6 -e 'say $*CWD.ACCEPTS($*CWD)'; Method 'abspath' not found for invocant of class 'Str' in block <unit> at -e:1 |
04:02 | |
kudo/nom: 365a1a6 | lizmat++ | src/core/IO/Path.pm: Merge pull request #461 from ugexe/patch-8 remove Str.path leftovers in IO::Path.ACCEPTS |
|||
04:07
diana_olhovik_ joined
04:12
kurahaupo left,
adu left
04:13
kurahaupo joined
04:16
raiph left
04:19
atroxaper joined
04:20
atroxaper left,
atroxaper joined
|
|||
dalek | kudo/nom: e3d6b7d | lizmat++ | src/Perl6/Grammar.nqp: Make use of \$ \% \@ \& \\d a worry Inspired by discussion started at irclog.perlgeek.de/perl6/2015-07-05#i_10852425 ShimmerFairy++ geekosaur++ BenGoldberg++ timotimo++ |
04:24 | |
04:35
quester joined
|
|||
dalek | kudo/nom: cf65f54 | lizmat++ | src/Perl6/ (2 files): Introduce "no worries" pragma Worries (usually Perl 5 lookalike warnings) will not be emitted when a "no worries" pragma is used in that lexical scope. Inspired by discussion at irclog.perlgeek.de/perl6/2015-07-05#i_10852580 timotimo++ skids++ ShimmerFairy++ for inspiration |
04:39 | |
lizmat | m: my $a = \3 | 04:40 | |
yoleaux | 5 Jul 2015 22:13Z <skids> lizmat: you're probably already aware of it, but PR#454 will prevent Parameter.perl from emitting "\%" and "\&" | ||
camelia | ( no output ) | ||
lizmat | $ 6 'my $a = \3' | ||
Potential difficulties: | |||
To refer to a positional match capture, just use $0 (numbering starts at 0). Parenthesize as \(...) if you intended a capture of a single numeric value. | |||
$ 6 'no worries; my $a = \3' | |||
(clean) | |||
.tell skids tbh, I'm not completely following what's happening in PR454, so am reluctant to merge | 04:41 | ||
yoleaux | lizmat: I'll pass your message to skids. | ||
lizmat commented on timotimo's PR 236 | 04:45 | ||
04:47
vendethiel left
|
|||
skids | lizmat: It's dealing with anonymous parameters like those found in protos. When you .perl those, what gets emitted cannot be parsed due to unspace, and there are some other obvious issues. | 04:47 | |
yoleaux | 04:41Z <lizmat> skids: tbh, I'm not completely following what's happening in PR454, so am reluctant to merge | ||
skids | for example: | ||
m: :($? is parcel).perl.say | |||
camelia | rakudo-moar 365a1a: OUTPUT«:(\?)» | ||
skids | m: :(\?).perl.say | ||
camelia | rakudo-moar 365a1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HSN3sgLb1qUnable to parse expression in signature; couldn't find final ')' at /tmp/HSN3sgLb1q:1------> 3:(\7⏏5?).perl.say expecting any of: constraint» | ||
skids | and | 04:48 | |
m: :($ is parcel where True).perl.say | |||
camelia | rakudo-moar 365a1a: OUTPUT«:(\ where { ... })» | ||
skids | m: :(\ where { ... }).perl.say | 04:49 | |
camelia | rakudo-moar 365a1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/X1GmnYnPtVCannot do non-typename cases of type_constraint yetat /tmp/X1GmnYnPtV:1------> 3:(\ where { ... }7⏏5).perl.say» | ||
lizmat | is there a ticket for these problems? | ||
skids | maybe for some of them. And some are new/my fault in that when I wrote the Parameter.sigil patch I didn't know what to do with 'is parcel' things. | 04:50 | |
lizmat | with the GLR on its way, I'm not even sure "is parcel" is going to be a thing of the future | 04:52 | |
skids | You think sigilless parameters will go away? | 04:53 | |
lizmat | no, the "is parcel" thing | 04:54 | |
skids | Well, currently "$ is parcel" and "\" are the same thing. | 04:55 | |
lizmat just learned something | 04:58 | ||
m: sub a($a is parcel) { ++$a }; my $b = 42; say a $b | 04:59 | ||
camelia | rakudo-moar e3d6b7: OUTPUT«43» | ||
lizmat | m: sub a(\a) { ++a }; my $b = 42; say a $b | ||
camelia | rakudo-moar e3d6b7: OUTPUT«43» | ||
skids | At any rate, I'll either have to have the PR in, or replicate the code within the lexical scope of .assuming for my new .assuming code to be mergeable. | ||
Yeah, the "sigilless" variables are actually bind-only things. So they'll surprise people trying to use them as such. | 05:00 | ||
m: my \a = 1; a++ | |||
camelia | rakudo-moar e3d6b7: OUTPUT«Cannot assign to an immutable value in block <unit> at /tmp/LwWgR90gbV:1» | ||
lizmat | skids: I'm not too happy with '@$%&'.index($sigil).defined; | 05:02 | |
feels hacky | 05:03 | ||
skids | I could put it back to being a ~~ but I figured that was more efficient. | ||
lizmat | also, $name.substr(0,1) ne '\\' maybe better as !$name.starts-with('\\') ? | ||
ah well, it's in a .perl, right? | |||
dalek | kudo/nom: 1c9ad4f | skids++ | src/core/Parameter.pm: Handle "is parcel" better in Parameter.perl and Parameter.sigil This modifies: Parameter.sigil to only be '\' when it would otherwise be '$' but the parameter 'is parcel' Parameter.perl to emit 'is parcel' in the cases where unspace would mess up a re-parse, not to emit '\%' or '\&' anymore and use 'is parcel' instead for those, and to correctly add an 'is parcel' to '|c is parcel'. I don't know if the last one makes any sense, but if it doesn't it probably should not parse in the first place. |
05:04 | |
kudo/nom: 6e8c751 | skids++ | src/core/Parameter.pm: Remove redundant conditional |
|||
kudo/nom: 73297ef | lizmat++ | src/core/Parameter.pm: Merge pull request #454 from skids/assuming Handle "is parcel" better in Parameter.perl and Parameter.sigil |
|||
skids | Yeah true. I didn't know about .starts-with. I could fix those up if you like as a separate commit. | ||
lizmat: thanks a lot. | 05:05 | ||
lizmat | nah, that's ok | ||
05:05
sivoais left
05:06
sivoais joined
|
|||
skids | I'll add some idempotency tests for those tomorrow. | 05:09 | |
skids up way too late. | |||
as usual. | |||
lizmat | good night, skids! | 05:11 | |
lizmat up way too early | |||
PSA: if anybody has anything of note to mention for the Perl 6 Weekly, let me know | 05:12 | ||
expected publication time: around 12 hours from now (yes, I've done most of the work already) | 05:13 | ||
05:14
skids left
05:19
diana_olhovik_ left,
tinyblak joined
05:23
tinyblak_ left,
[Sno] left
05:29
baest_ is now known as baest
05:43
yeahnoob joined
|
|||
dalek | kudo/nom: df5da3f | lizmat++ | src/core/Any.pm: Remove unnecessary fouling of the namespace |
05:43 | |
05:43
Psyche^ joined
05:47
Psyche^_ left
05:51
diana_olhovik joined
05:55
kaare_ joined
|
|||
dalek | kudo/nom: f2d9c9f | lizmat++ | src/core/Any.pm: Sanitize adverb error reporting |
06:06 | |
lizmat catches up on some sleep | 06:07 | ||
ShimmerFairy | sleep well, lizmat o/ | ||
ugexe | skids: strange error on windows for Sum, Cannot find method 'array[uint32]', testers.p6c.org/reports/55027.html | 06:22 | |
06:23
kanl joined
|
|||
ugexe | fwiw, this shows that line itself normally works on the same machine: gist.github.com/ugexe/499a7adddb2550c3339e | 06:30 | |
06:32
abraxxa joined
06:35
FROGGS joined
|
|||
kanl | is there a safer/more efficient way to find out the "width" of a range? it may be undesirable to { my $r = 1 .. 1000000000; $r.elems.say }. and since the bounds may not be integer, one subtracting them may also be undesirable.. | 06:35 | |
FROGGS | since ranges can consist of arbitrary steps, only generating the list will give a correct answer I think | 06:37 | |
yoleaux | 5 Jul 2015 21:31Z <brrt> FROGGS: if he cares enough about the 'system dynasm' option to object to me removing it | ||
FROGGS | .tell brrt Ummm, what? | ||
yoleaux | FROGGS: I'll pass your message to brrt. | ||
kanl | FROGGS: i guess i should rephrase my question, how would one determine the 'distance' between the bounds of a range? | 06:39 | |
m: my $r = 1 .. *; $r.elems.say; # this should be fast. | 06:40 | ||
camelia | rakudo-moar f2d9c9: OUTPUT«Inf» | ||
kanl | while 1 .. 1000000000 takes long. | 06:41 | |
FROGGS | well... that sounds like subtracting is the best choice, no? | ||
kanl | but a .. aaaaaaaaaaaaa can't be simply subtracted | 06:42 | |
06:42
wolf_work left
|
|||
FROGGS | hmmmm | 06:43 | |
kanl | please lemme know if i'm missing some simple and obvious solution if there's already one :) | ||
Timbus | do you not want .bounds | ||
FROGGS | seems like I'm not awake enough yet :o) | ||
Timbus | Range.bounds | 06:44 | |
06:44
telex left
|
|||
kanl | m: my $r = a .. aaaaaaaaaaaaa; say [-] $r.bounds | 06:44 | |
camelia | rakudo-moar f2d9c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AUKqsu37xdPreceding context expects a term, but found infix .. insteadat /tmp/AUKqsu37xd:1------> 3my $r = a ..7⏏5 aaaaaaaaaaaaa; say [-] $r.bounds» | ||
kanl | m: my $r = 'a' .. 'aaaaaaaaaaaaa'; say [-] $r.bounds | ||
camelia | rakudo-moar f2d9c9: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏a' (indicated by ⏏) in block <unit> at /tmp/7T0QNNoYbu:1» | ||
Timbus | letters seems tricky, fair enough | 06:45 | |
kanl | just noting that the current implementation of .elems of the Range type may not be efficient enough | 06:46 | |
06:46
telex joined
06:47
espadrine joined
06:51
zakharyas joined
|
|||
labster | m: my $t = DateTime.now; say $t.second, " ", $t.whole-second; | 06:52 | |
camelia | rakudo-moar f2d9c9: OUTPUT«45 45» | ||
labster | Woo, got it right on the seconds boundary! | 06:53 | |
(or not) | |||
kanl imagines Range implemented as $min => $offset, then iterating/traversing would be calling .succ $offset number of times. | 06:55 | ||
make that $offset + 1 :) | 06:56 | ||
06:57
Foxcool joined
|
|||
kanl | kind of a related question, is there a version of .succ that can take an offset? | 07:00 | |
07:01
domidumont joined
|
|||
kanl | i.e. something like { my $s = '01'; $s.succ( 3 ) } # gives '04' | 07:01 | |
07:02
amurf left
|
|||
kanl | would be hella nice and handy if there is already one. | 07:02 | |
labster | m: say "01".succ(3); | 07:03 | |
camelia | rakudo-moar f2d9c9: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in block <unit> at /tmp/LZdrKZ5HmP:1» | ||
FROGGS | m: say ("01".succ xx 3) | 07:04 | |
camelia | rakudo-moar f2d9c9: OUTPUT«02 02 02» | ||
labster | apparently not, but it's not a bad idea. Save you a loop | ||
FROGGS | err | ||
labster: you just move the loop | 07:05 | ||
kanl | labster: it's not just a matter of looping. rather, it's directly getting there. | ||
07:05
domidumont left
|
|||
kanl | eagerly looping may not be a good idea, just saying. | 07:06 | |
labster | m: my $s = "01"; $s.=succ for ^3; say $s; | ||
camelia | rakudo-moar f2d9c9: OUTPUT«04» | ||
07:06
domidumont joined
|
|||
FROGGS | I think it is the same as with .lines calling .get repeatedly... | 07:07 | |
you can/should/want to implement .succ and .pred for your own type, and then everything will just work | 07:08 | ||
labster | Yes, but for some data types, we should just be able to add the integer instead of 1. | ||
FROGGS | allowing a parameter to .succ just makes it complex for your own implementation | ||
true | |||
labster | class Cool { method succ(Int $x) { my \this = self; this.=succ for ^$x; this } } ? | 07:12 | |
07:12
darutoko joined
|
|||
labster | and then fast path ones we know how to do better? | 07:12 | |
kanl | <more rant> also, to me a Range type being immmutable and without any kind of arithmetic operation is kinda limited. something like { 1 .. 4 ,& 2 .. 6 } getting 2 .. 4 would be pretty useful/practial stuff. that said, A Range object would need to be in a listy container. since some ops may result in "holes", i.e. subtraction | 07:13 | |
</rant> | |||
labster | m: say DateTime.new(now).second, " ", DateTime.now.second | 07:15 | |
camelia | rakudo-moar f2d9c9: OUTPUT«10.460504 10» | ||
07:16
aborazmeh left
07:18
bjz joined
07:19
mr-foobar left,
bjz left
07:20
bjz joined
07:21
bjz left
07:22
RabidGravy joined,
brrt joined
|
|||
moritz | kanl: I'd suggest you implement such operations as a module | 07:24 | |
kanl: and if many people use it, we can ponder its adaption into core | 07:25 | ||
kanl | moritz: that is what i'm doing. but my fu is weak :) | ||
oha | can I my regex foo { ... <foo>* ... } ? | ||
moritz | kanl: time to up your fu, I'd say :-) | ||
oha: yes | |||
though be careful that it always consumes at least one character, otherwise <foo>* will loop infinitely | 07:26 | ||
oha | moritz, it says "Method 'foo' not found for invocant of class 'Cursor'" | ||
RabidGravy | marnin! | ||
moritz | m: my regex foo { a }; say 'a' ~~ / <foo> / | ||
camelia | rakudo-moar f2d9c9: OUTPUT«「a」 foo => 「a」» | ||
07:26
espadrine left
|
|||
moritz | m: my regex foo { a <foo>* }; say 'aa' ~~ / <foo> / | 07:26 | |
camelia | rakudo-moar f2d9c9: OUTPUT«Method 'foo' not found for invocant of class 'Cursor' in regex foo at /tmp/vk4jJW0Q8H:1 in block <unit> at /tmp/vk4jJW0Q8H:1» | ||
moritz | huh | ||
m: my regex foo { a <&foo>* }; say 'aa' ~~ / <foo> / | 07:27 | ||
camelia | rakudo-moar f2d9c9: OUTPUT«「aa」 foo => 「aa」» | ||
moritz | oha: I don't know why it works in /.../ and not 'my regex ... { }', but with <&foo>, it works | ||
oha | ok | ||
moritz | could be a bug | ||
oha | not sure what's the & for, but i will just blindly use it for now | ||
moritz | for lexical lookups | ||
oha | moritz, maybe it can't "unfold" it? | 07:28 | |
moritz | oha: dunno | ||
just like sub f() { }; say &foo.name | |||
lexical routines are installed with a leading & in the lexpad | |||
07:32
[Sno] joined
07:34
aborazmeh joined,
aborazmeh left,
aborazmeh joined
07:36
g4 joined,
g4 left,
g4 joined
|
|||
kanl | m: my $r = '1' .. 2; $r.bounds.map: { .WHAT.say }; $r.list.map: { .WHAT.say }; | 07:46 | |
camelia | rakudo-moar f2d9c9: OUTPUT«(Str)(Int)(Str)(Str)» | ||
kanl | m: my $r = 1 .. '2'; $r.bounds.map: { .WHAT.say }; $r.list.map: { .WHAT.say }; | 07:47 | |
camelia | rakudo-moar f2d9c9: OUTPUT«(Int)(Int)(Int)(Int)» | ||
kanl | why is .max.WHAT not necessarily consistent with .min.WHAT? | 07:48 | |
07:58
bjz joined
|
|||
DrForr | Looking at that we clearly need a .FOX namespace in order to implement map{.FOX.say} :) | 08:00 | |
kanl | what's .FOX? | 08:02 | |
08:03
quester left
|
|||
DrForr | Nothing that exists right now, it's just a joke. | 08:03 | |
www.youtube.com/watch?v=jofNR_WkoCE | |||
kanl | www.youtube.com/watch?v=eF9R5aWFzkA | 08:05 | |
a better one to dance to, imho :) | |||
DrForr | I prefer his flat-floot floozie. :) | ||
*foot | 08:06 | ||
(which I can't find on YouTube.) | 08:08 | ||
08:12
dakkar joined
08:15
yeahnoob left,
domidumont left
08:16
domidumont joined
08:17
espadrine joined
08:20
yeahnoob joined
|
|||
El_Che | 32q | 08:21 | |
oops | 08:22 | ||
[ptc] | El_Che: :wq :-P | 08:23 | |
08:26
bin_005 joined
08:28
mr-foobar joined
08:32
vendethiel joined
08:33
rmgk joined
|
|||
kanl | does anyone object to me filing a bug on Range type's .elems being eager? | 08:34 | |
08:34
rindolf joined
|
|||
vendethiel | are worries "only" for p5-like errors? I'd love a pragma that disables *only that* :-). | 08:35 | |
(the commit messages says "usually", and I'm worried I'd disable other interesting warnings with a "no worries") | 08:36 | ||
.oO( we should introduce a "be happy" version ) |
08:37 | ||
08:43
g4 left
|
|||
kanl | [perl #125559] | 08:45 | |
synbot6 | Link: rt.perl.org/rt3/Public/Bug/Display...?id=125559 | ||
vendethiel | kanl: what other solution is there :)? | 08:46 | |
08:47
g4 joined,
g4 left,
g4 joined
|
|||
kanl | finding the distance between bounds seems a more viable solution, though not sure if it's doable. but one certainly/apparently does not have to eagerly loop over 1 .. * to for .elems to give Inf | 08:49 | |
08:50
amurf joined
|
|||
kanl | that said, it is certainly doable in case of Int. | 08:51 | |
vendethiel | kanl: for 1..*; we know we have an infinite loop | ||
kanl | and for 1..100000000? | ||
m: (1..100000000000).elems.say; | 08:52 | ||
camelia | rakudo-moar f2d9c9: OUTPUT«(timeout)» | ||
vendethiel | that's not an infinite loop. but yes, calculating elem that way is probably not the best | 08:54 | |
08:55
amurf left,
aborazmeh left
|
|||
kanl | therefore i'd like to consider i a bug :) | 08:55 | |
^it | |||
09:00
virtualsue joined
09:05
tinyblak_ joined,
VinceDee left,
VinceDee joined
09:09
tinyblak left
09:12
virtualsue left
09:20
tinyblak_ left
09:21
tinyblak_ joined
09:29
kanl left,
kanl joined
09:35
gfldex joined
09:45
atroxaper left
09:46
atroxaper joined,
domidumont left,
domidumont joined
09:50
cognominal left,
cognominal joined
10:03
yeahnoob left
10:11
TEttinger left
|
|||
sjn has cleaned up pad.hackeriet.no/p/p6-deploy a little today. It's less of a braindump now, but would still benefit from some discussion | 10:12 | ||
tadzik, daxim: ^ | |||
sjn is especially interested in thoughts on what of it may go into S11 :) | 10:13 | ||
El_Che | sjn: Having a look. What about application deployment like a [jwe]ar or fatpack? Out of scope? | 10:15 | |
sjn | no | 10:17 | |
definitely not out of scope | |||
El_Che: feel free to add a little about that :) | 10:18 | ||
sjn thinks fatpack/[jwep]ar would be analogous to docker images | 10:21 | ||
El_Che | well, docker is what's in Vogue and the Cosmopolitan this week | 10:22 | |
but containers is not the answer for everything | |||
a lightweight container is a heavy dependency :) | 10:23 | ||
sjn | nah, it depends | 10:24 | |
it's not like everyone *must* use buzzword-du-jour technology | |||
El_Che | there are no docker containers in Solaris (there are zones) | ||
sjn | but being "mindshare-compatible" is probably smart, therefore container-awareness | ||
El_Che | sure | ||
sjn | zones are close enough for my concern :) | 10:25 | |
(same goes for jails) | |||
El_Che | I mean, "next to a simple drag and drop method" | ||
sjn | that's a point too | ||
El_Che | what makes go a winner for sysadmins types now? just drop the binary and run | ||
sjn | mm. for user-facing installations, that's the way to go | 10:26 | |
(e.g. something like they do in OSX) | |||
BUT | |||
there's a missing bit here, which is really important | |||
sjn hopes to get some thoughts about that from lizmat and FROGGS and perhaps tadzik: Is there a way to do modify the module search path from "the outside"? (e.g. if I install a Perl 6 application in a separate directory, what do I have to do to make "use" work with the modules that came bundled with the application? | 10:28 | ||
nine | sjn: perl6 -I and use lib just like in Perl 5? | 10:29 | |
10:30
itz joined
|
|||
sjn | sure, use lib could work | 10:30 | |
itz | morning | ||
nine | Also there's %ENV<PERL6LIB> | ||
sjn | although I've never been a fan of putting relative paths into "use lib" or @INC (or whatever is Perl6's equivalent) | ||
hm | 10:31 | ||
PERL6LIB might work if one had a wrapper script or something like that for the application | |||
itz: good *! | 10:32 | ||
10:36
Possum left
|
|||
nine | A wrapper script, that could be generated by the installation mechanism | 10:37 | |
sjn isn't happy with that idea :-| | |||
is there a way to get the current library search path from perl6? | 10:39 | ||
sjn would hope it was available with "perl6 -V", but I can't see it at a first glanec | 10:40 | ||
glace* | |||
glance* | |||
itz | I'm still getting two test failures with OS X - t/spec/S24-testing/line-numbers.t and t/spec/S32-io/IO-Socket-INET.t | ||
sjn looks at perl6 -V moar::libdir | 10:42 | ||
10:42
FROGGS left,
dayangkun left
10:46
virtualsue joined
|
|||
nine | m: say @*INC | 10:51 | |
camelia | rakudo-moar f2d9c9: OUTPUT«file#/home/camelia/.perl6/2015.06-186-gf2d9c9f/lib inst#/home/camelia/.perl6/2015.06-186-gf2d9c9f file#/home/camelia/rakudo-inst-1/share/perl6/lib file#/home/camelia/rakudo-inst-1/share/perl6/vendor/lib file#/home/camelia/rakudo-inst-1/share/perl6/site/lib…» | ||
nine | sjn: ^^^ | 10:52 | |
itz | hmmm seems to be qqx relatged and in scrollback | ||
^ related | |||
masak | good afternoon, #perl6 | 10:54 | |
moritz | \o, masak | ||
10:55
leont joined
11:06
kanl left
11:11
FROGGS joined
|
|||
sjn | nine: what's that #inst and #file prefix for? | 11:14 | |
good *, masak :) | |||
11:17
larion joined
|
|||
lizmat | good *, #perl6! | 11:21 | |
sjn: they indicate the type of CompUnitRepo object that should be used | |||
file# is for CompUnitRepo::Local::File | |||
inst# is for CompUnitRepo::Local::Installation | 11:22 | ||
sjn | hm | 11:24 | |
FROGGS | m: say CompUnitRepo::Local::File.short-id # obtained like this | 11:25 | |
camelia | rakudo-moar f2d9c9: OUTPUT«file» | ||
lizmat | sjn: you can also write your own CompUnitRepo module, which you could use in an app | 11:29 | |
11:31
timbunce_ joined
11:37
atroxaper left
11:38
atroxaper joined
11:39
Alina-malina left,
timbunce_ left
|
|||
dalek | line-Perl5: 78008b5 | (Stefan Seifert)++ | / (2 files): Support named parameters of .new method of imported P5 classes. use Foo:from<Perl5>; Foo.new(foo => 'custom'); |
11:43 | |
11:47
atroxaper left
|
|||
DrForr | Hee. I *think* I was needing that over the weekend. | 11:53 | |
nine | DrForr: why didn't you say so? :) Have been debugging all Saturday and this would have been a nice easy fix in between ;) | 11:57 | |
DrForr | As you may have seen I was working on something else :) | ||
dalek | kudo/nom: 626f906 | lizmat++ | src/core/ (2 files): Mogrify adverb slice logic into an Exception So that we can properly test for them. This should probably be run at compile time somehow, but for now runtime will do. |
12:02 | |
12:05
domidumont left
12:06
domidumont joined
|
|||
DrForr | Getting a failure here in t/from.t - Looks like you're assuming Moose is installed. | 12:18 | |
nine: ^^^^ | 12:20 | ||
12:24
AlexDani` joined,
AlexDani` is now known as AlexDaniel
|
|||
[Coke] | moritz: regarding your rant, you can coerce types in signatures, if you want. several core subs do that, IIRC. | 12:28 | |
DrForr | nine: Maybe change Moose to a core Perl5 module name instead? (I haven't looked at the test.) | 12:30 | |
12:31
rurban joined
12:33
brrt left
12:34
brrt joined,
Possum joined,
brrt left
|
|||
masak | nine: github.com/niner/Inline-Perl5/pull/26 | 12:37 | |
nine++ # Inline::Perl5 | |||
12:38
cognominal left,
cognominal joined
|
|||
dalek | line-Perl5: 2618b36 | masak++ | README.md: fix s/cought/caught/ typo |
12:38 | |
line-Perl5: 3325ebd | niner++ | README.md: Merge pull request #26 from masak/patch-1 fix s/cought/caught/ typo |
|||
nine | masak: thanks for fixing my spelling errors! | ||
timotimo | *cough* *cough* | 12:39 | |
dalek | line-Perl5: 7bfcb32 | (Stefan Seifert)++ | t/ (2 files): Fix test failing if Moose is not installed Move the new test to t/from.t which already checks for Moose. |
12:42 | |
nine | DrForr: fixed. Thanks for the report! I want to specifically test Moose there, since it's very importent in the Perl 5 world. | ||
masak | important* ;) | 12:45 | |
or, less likely, impotent* | |||
nine | I guess, I shouldn't try to spell anything today | ||
El_Che | masak: lol | ||
nine | Moose is quite potent, I assure you :) | 12:46 | |
El_Che | when it hasn't drink too much anyway | ||
masak | nine: "Today is a day for eschewing convention and embarking on a creative endeavor." :P | ||
El_Che | even my answer sounds drunk | ||
12:48
atroxaper joined
|
|||
itz | is there any simple way to use File::Find on more than one thread? | 12:48 | |
masak | decommute & | ||
jnthn | yoleaux: I can haz messages??? | 12:49 | |
yoleaux | 4 Jul 2015 19:45Z <hoelzro> jnthn: could you weigh in on irclog.perlgeek.de/perl6/2015-07-04#i_10848766 if you have some time? | ||
dalek | kudo/nom: d2faa16 | lizmat++ | src/core/Any.pm: Make sure nogo's are repeatable |
||
12:52
atroxaper left
|
|||
oha | is there a better way? multi sub f(Str $uri, ...) { return callwith(URI.new($uri), ...); } | 12:54 | |
other than having URI inherits from Cool :) | 12:55 | ||
jnthn | return callwith(...) is better spelled nextwith | ||
oha | jnthn, right. still, if i have a dozen of multis with URI, i need to make another dozen with the combinations of Str | 12:56 | |
jnthn | hoelzro: Multi-dispatch will never consider a native candidate for a boxed argument, 'cus otherwise that candidate would always mean we ignore the boxed one. And we really have to hit the Int candidate for int. | ||
hoelzro: Uh, *for Int. Otherwise we go truncating big integers all over the place. | |||
We are a little more liberal with only subs, since it doesn't much hurt to Make It Work there. | 12:57 | ||
hoelzro | jnthn: alright, thanks for weighing in(t)! | ||
12:59
SmokeMachine_ left,
SmokeMachine joined
13:00
lucasb joined,
Alina-malina joined
|
|||
leont | What is the new way to do xAB@foo = $a ?? foo !! NilxBB? | 13:01 | |
I just tried xAB()xBB but it didn't seem to DWIM | 13:02 | ||
lizmat | s/Nil/() | ||
ah> | 13:03 | ||
? | |||
leont | (erm, may be PEBKEC) | ||
I changed it, but precompiled versions weren't automatically updated. | |||
13:04
aborazmeh joined
13:05
aborazmeh left,
aborazmeh joined
|
|||
lucasb | m: say Real.new | 13:06 | |
camelia | rakudo-moar 626f90: OUTPUT«Memory allocation failed; could not allocate 8192 bytes» | ||
lucasb | I think this is because Real.Str calls .Bridge, that calls .Num, that calls .Bridge again, etc. | ||
13:07
mr-foobar left
13:08
raiph joined
|
|||
[Coke] | m: say Real.new(3) | 13:09 | |
camelia | rakudo-moar 626f90: OUTPUT«Default constructor for 'Real' only takes named arguments in any at src/gen/m-Metamodel.nqp:1676 in block <unit> at /tmp/hr1f2WfYnA:1» | ||
timotimo | it occurs to me that a channel with many irc bots is kind of like a shared commandline | 13:12 | |
dalek | ast: 887c43f | lizmat++ | S32-array/adverbs.t: Tests for array slice adverb exception handling |
13:13 | |
leont | Why can't I get a Proc::Status from a Proc? | 13:14 | |
timotimo | oha: you could spell the type in your multi subs "URI(Str)" that way you'd get them coerced | ||
leont | And why do some docs say run/shell returns one and others the otherx85 | ||
timotimo | leont: probably have to wait for it to exit? | ||
13:14
bin_005 left
|
|||
leont | That sounds logical, but there's no wait method documented | 13:15 | |
timotimo | hm | ||
timotimo hasn't looked into the new things yet | |||
nine | Phew! | ||
[ptc] | maybe wait just isn't documented yet? | ||
leont | Trying it out now | ||
No such method 'wait' for invocant of type 'Proc' | |||
13:16
aborazmeh left
|
|||
nine | Today, I've for the first time tried to use Inline::Perl5 for a real program and instantly hit two bugs. The one I fixed earlier and a very strange utf8-related one. Just about 5 hours later, I've finally proven it to be a Perl 5 or URI::Encode bug :) | 13:17 | |
Or....not :( | |||
itz | is there any doc for gather/take? | 13:18 | |
nine | itz: look for take | 13:19 | |
leont | It seems foo.?bar doesn't work anymore on a type object (or at least I think it used to) | 13:20 | |
itz | nine: ah | 13:21 | |
leont | Does anyone have a working example of run(:out)? | 13:22 | |
dalek | p/multidim: a9dedf4 | jnthn++ | t/moar/02-multidim.t: Tests for cloning a multi-dim array. |
13:23 | |
lucasb | Interesting that Proc::Status in IO/Handle.pm says it'll be removed together with pipe(). run/shell return a Proc object, but I didn't see any way to wait for the process to finish. | 13:25 | |
dalek | ast: 665d368 | lizmat++ | S32-array/adverbs.t: Add array slice callable adverb tests |
13:27 | |
leont | Yeah, this seems rather unfinished | 13:29 | |
13:30
muraiki joined
13:32
gcole joined
13:33
g4 left
|
|||
lucasb | I made a mistake; I think run do waits for the process to finish before returning :) | 13:33 | |
I tried: run('bash', '-c', 'sleep 2; echo foo'); say 'ok' | |||
13:35
domidumont left
|
|||
lucasb | say run('bash', '-c', 'exit 42').status +> 8 # says 42 | 13:35 | |
PerlJam | lucasb: note that there's also Proc.exitcode (so that you don't have to do the bitshift dance) | 13:37 | |
lucasb | PerlJam: yeah, thanks :) also: +run(...) | 13:38 | |
13:40
domidumont joined
|
|||
leont | Well, my code relies on Proc::Status, because it was previously handling input from Proc::Async | 13:42 | |
And Proc::Status was actually pretty useful, since it provides the abstraction but also the raw data | 13:43 | ||
oha | m: use URI; sub f(URI(Str) $x) { ... }; f("x.com"); | ||
camelia | rakudo-moar d2faa1: OUTPUT«===SORRY!===Could not find URI in any of: file#/home/camelia/.perl6/2015.06-188-gd2faa16/lib inst#/home/camelia/.perl6/2015.06-188-gd2faa16 file#/home/camelia/rakudo-inst-2/share/perl6/lib file#/home/camelia/rakudo-inst-2/share/perl6/ven…» | ||
oha | timotimo, nice, but i can't make it to work. any reference or keywords I should look for? right now it fails with: Method 'URI' not found for invocant of class 'Str' | 13:44 | |
timotimo | oha: maybe you get URI with "star:" | ||
oh, of course | |||
dalek | ast: 87dd187 | lizmat++ | S32-hash/adverbs.t: Tests for hash slice adverb exception handling |
||
timotimo | yeah, you can install a candidate for the coercion multi, i forgot what it's called; COERCE perhaps? | ||
oha | timotimo, my problem tho is that i can't find any reference in the docs, so i can't dig it on my own | ||
lizmat | timotimo: I don't think COERCE is implemented, or completely thought out for that matter | 13:45 | |
timotimo | mhm | ||
oha | i just found something on S13 | ||
13:46
Woodi left
13:47
Woodi joined
|
|||
tadzik | oha: hmm, I wonder if one could make sub f($uri as URI) work | 13:48 | |
oh, a solution came up already | |||
timotimo | didn't we deprecate the "as" syntax? | ||
no, not a solution, sadly | |||
tadzik | I don't know, did we? :) | ||
oha | tadzik, same same | ||
timotimo | it seems like it's still in there | 13:49 | |
problem is, currently the coercion type syntax relies on the type coming in to have a method that can coerce into the type you want | |||
tadzik | rihgt | ||
you could augment it! | |||
tadzik hides | |||
nine | Ok, it really is a bug in Perl 5's URI! | 13:50 | |
timotimo | nine: hooray! | ||
nine | And in Geo::Coder::OSM as well. URI::query_form cannot deal with a mix of Unicode string/UTF-8 encoded parameters and Geo::Coder::OSM is manually encoding one parameter (though it works without) and passing through others. | 13:52 | |
lucasb | m: say Rational | 13:53 | |
camelia | rakudo-moar d2faa1: OUTPUT«No appropriate parametric role variant available for 'Rational' in any specialize at src/gen/m-Metamodel.nqp:2470 in any compose at src/gen/m-Metamodel.nqp:2780 in any make_pun at src/gen/m-Metamodel.nqp:1641 in any find_method at src/gen/m…» | ||
lucasb | I know Real and Rational are roles, not objects. I was just playing with printing them. | ||
Do you think it would make sense to have default parameters of [Int,Int] in Rational, like Rational[::Nu = Int, ::De = Int] ? | |||
tadzik | m: say i*Rational | ||
camelia | rakudo-moar d2faa1: OUTPUT«No appropriate parametric role variant available for 'Rational' in any specialize at src/gen/m-Metamodel.nqp:2470 in any compose at src/gen/m-Metamodel.nqp:2780 in any make_pun at src/gen/m-Metamodel.nqp:1641 in any find_method at src/gen/m…» | ||
nine | Could easily happen in a pure Perl 5 application as well. Inline::Perl5 just makes it more probable, since all strings get their UTF-8 flag set. | ||
tadzik | :( | ||
13:55
tinyblak_ left
|
|||
PerlJam | Inline::Perl5++ sussing out Perl 5 bugs :) | 13:55 | |
13:56
tinyblak joined
|
|||
leont | Yay! It seems the synchronous TAP::Parser is actually working as intended now :-) | 13:56 | |
13:56
aborazmeh joined,
aborazmeh left,
aborazmeh joined
14:00
tinyblak left
|
|||
[Coke] | timotimo: how is that a problem? | 14:02 | |
like, if we had a coercion to Int, and you passed in some random object... how would that work without a method to call? | 14:03 | ||
14:03
skids joined
|
|||
leont | And it seems Proc::Status simply stopped existing or some such | 14:07 | |
PerlJam | [Coke]: If there were a generic coercion thingy (presumably that's what COERCE is supposed to be). Something like: multi sub COERCE(Thingy, Int) returns Int { ... } | 14:09 | |
lucasb | For the coercion Foo(Bar) to work, there must be a Bar.Foo method, right? Would make sense for the coercion to also search for a Foo.new(Bar) method? | 14:10 | |
14:10
mr-foobar joined
|
|||
oha | lucasb, and which one should win, if both are present? | 14:11 | |
lucasb | maybe first try Bar.Foo, then search Foo.new(Bar) ? :) | ||
oha | (can i suggest a warning when you use $1 when there is only 1 capture block? it took me a while to understand why it matched but didn't captured) | 14:12 | |
PerlJam | oha: that sounds like a good idea. Similar to the P5 "variable used only once" message I guess. | 14:13 | |
oha | lucasb, so you are saying that Bar is better at knowing how Foo should be created, then Foo? | ||
PerlJam, the fact that it is undefined my trigger the warning, but yeah... i didn't expected the first was $0 so i spent some time to realize it | 14:14 | ||
lucasb | class Bar { method Foo { Foo.new(self or some such) } | ||
14:15
dalek left
|
|||
oha | lucasb, that's the easy case, and it will probably be symmetric then. but what if the coercion is more complex? | 14:15 | |
14:15
dalek joined,
ChanServ sets mode: +v dalek
|
|||
oha | Bar.new(a,b); Foo.Bar() { Bar.new(x,y); } | 14:16 | |
lucasb | oha: I don't know. Either Foo or Bar will have to know how to convert between each other. Just brainstorming ideas... :) | 14:18 | |
oha | what if there is a multi sub coerce(From, To) { } ? | 14:19 | |
timotimo | i think something like that was planned, yeah | 14:21 | |
dalek | kudo/nom: d9c1e26 | timotimo++ | src/core/Failure.pm: make Failure objects a tiny bit smaller |
14:22 | |
14:23
larion left,
larion joined
14:24
mathw_ is now known as mathw
|
|||
timotimo | does someone with JS (and perhaps angular in particular) skills want to have a look at the profiler template in nqp's repository? | 14:25 | |
a) it's quite slow and allegedly upgrading to the next angular version gives a nice speed boost "for free", but just uping the version makes all ng-show attributes stop working | |||
b) the breadcrumb navigation in the call graph section is easily flustered and then there's no way to go back to the root of the call graph; perhaps a universal "up" navigation button that's failsafe would be nice | 14:26 | ||
14:27
khw joined,
pullphinger joined,
aborazmeh left
|
|||
dalek | p/multidim: 472df2c | jnthn++ | t/moar/02-multidim.t: Test special-case 2D/3D array access ops. |
14:28 | |
p/multidim: cb7e790 | jnthn++ | t/moar/02-multidim.t: Tests for serialize/deserialize of MultiDimArray. |
|||
p: 188d7e0 | jnthn++ | tools/build/MOAR_REVISION: Bump to MoarVM with multi-dim array support. |
14:29 | ||
14:29
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
dalek | Heuristic branch merge: pushed 16 commits to nqp by jnthn | 14:30 | |
14:31
tinyblak joined
|
|||
lucasb | m: .say for Int.new, Num.new, Rat.new | 14:36 | |
camelia | rakudo-moar d2faa1: OUTPUT«000» | ||
lucasb | m: Complex.new | ||
camelia | rakudo-moar d2faa1: OUTPUT«Cannot call new(Complex: ); none of these signatures match: (Complex $: Real \re, Real \im, *%_) in block <unit> at /tmp/bkPrAioNog:1» | ||
lucasb | Do you think it would make sense to have a default value of 0+0i for complex numbers as well? | ||
14:39
larion left
|
|||
PerlJam | might as well if we have defaults for the others | 14:39 | |
14:45
smls joined
14:50
Sqirrel joined
|
|||
jnthn | m: use Test; sub foo(::T) { { my T $b; is $b, Int; } }; foo(1) | 14:51 | |
camelia | rakudo-moar d2faa1: OUTPUT«Method 'defined' not found for invocant of class 'T' in sub is at lib/Test.pm:113 in sub foo at /tmp/a0NNpLccJr:1 in block <unit> at /tmp/a0NNpLccJr:1» | ||
timotimo | i didn't break that with my recent signature lowering work, did i? | 14:52 | |
jnthn | timotimo: No | 14:53 | |
lucasb | m: sub foo(::T) { my T $b; say $b }; foo(1) | 14:57 | |
camelia | rakudo-moar d2faa1: OUTPUT«(Int)» | ||
lucasb | m: sub foo(::T) { { my T $b; say $b } }; foo(1) | ||
camelia | rakudo-moar d2faa1: OUTPUT«Method 'gist' not found for invocant of class 'T' in sub foo at /tmp/GSlPTQKx6t:1 in block <unit> at /tmp/GSlPTQKx6t:1» | ||
14:58
aborazmeh left
|
|||
dalek | kudo/nom: 87687ea | jnthn++ | src/Perl6/Metamodel/GenericHOW.nqp: Look in outer scopes for type var instantiation. Fixes RT #125537. |
14:58 | |
ast: 201f031 | jnthn++ | S06-signature/type-capture.t: Test for RT #125537. |
14:59 | ||
14:59
nowan left
|
|||
lucasb | m: say .perl for <1/2>, <1/3> | 15:02 | |
camelia | rakudo-moar d2faa1: OUTPUT«0.5<1/3>» | ||
lucasb | Shouldn't Rats always have a .perl representation as Rats? There is special casing for multiples of 2 and 5 in Rat.perl | ||
15:02
nowan joined
|
|||
smls | jnthn: I've been thinking more about the situation with `method elems` for custom Positional types. Would it be possible for the Positional role to provide a default implementation which simply dies when called, and overrides the one from Any that always returns 1 ? | 15:05 | |
15:05
zoosha joined
|
|||
smls | That would force positional containers to implement it themselves, while other things would sill get the one from Any. | 15:06 | |
jnthn | smls: Hmm, may be workable | 15:07 | |
The role doesn't require much of anything at the moment... | 15:09 | ||
Thing is though | |||
AT-POS is the exact same situation | |||
15:10
kurahaupo left
|
|||
jnthn | Also, I fear that, since you may want to write a multi elems, we'd end up making a mess for folks | 15:10 | |
lizmat | PSA: Perl 6 Weekly will be published in about 4 hours from now: let me know anything newsworthy I should let the world know about | 15:11 | |
jnthn | ('cus you normally *do* just want to implement the :D case) | ||
lizmat | meanwhile, I'm cycling& | ||
jnthn | lizmat: I got done with the key MoarVM underpinning for multi-dimensional arrays (including having things like a 3x3x3 int array being a single packed blob of memory) | 15:12 | |
lizmat: And will work next on Perl 6 level support for this. | |||
15:12
tinyblak left
|
|||
jnthn | Guess that's my main news :) | 15:12 | |
smls | jnthn: As for "expecting authors to remember implementing .elems", it looks like you didn't implement it in CArray for example... :P | ||
15:13
tinyblak joined
|
|||
smls | $my-native-array[*-1] silently overrides the first elem, rather than dying with "sorry, a native array can't know its length" | 15:13 | |
[Coke] | Any sixers in NYC? I'll be down near penn station for 2 days this week. | ||
15:14
domidumont left
|
|||
virtualsue | bah, i made a branch off MoarVM instead of a fork | 15:14 | |
virtualsue needs to level up on git wizardry | 15:15 | ||
jnthn | smls: And...it's apparently taken until now for it to not bite anyone :P | 15:17 | |
15:17
tinyblak left
|
|||
itz | virtualsue: the "github" wrapper "git" allows "git fork" | 15:18 | |
dalek | kudo/nom: 37f384e | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.nqp: Actually return instantiated Scalar. Fixes RT #124940. |
15:23 | |
ast: 0210f20 | jnthn++ | S06-signature/type-capture.t: Unfudge test for RT #124940. |
|||
15:23
zakharyas left,
kurahaupo joined
|
|||
smls | What's the recommended way to restrict a method to defined invocants, without using a custom invocant parameter name instead of self? | 15:24 | |
method elems (:D:) { ...} ? | |||
method elems (Any:D $:) { ... } ? | |||
moritz | method elems (::?CLASS:D:) { ... } | 15:25 | |
iirc I've specced (aka speculated) a bare :D to default to the invocant type, but it's not implemented | |||
smls | ok | 15:26 | |
nine | Sounds like a very common use case | 15:27 | |
smls | I guess making :D the default and requiring an explicit :U or :_ or :* for accepting type objects, would be too radical at this point? :P | ||
nine: Indeed | |||
15:28
FROGGS left
|
|||
skids | I'd say that's useful not just for invocants. But might conflict with adverb literals. If that turns out to be a big deal maybe *:D? | 15:29 | |
dalek | ast: c24974b | jnthn++ | S05-capture/dot.t: Correct test identified in RT #125003. It wrongly assumed that a Capture matched multiple times stringifies to the final match, whereas it's actually an array of all of them. |
||
ugexe | lucasb: my $proc = run("$*EXECUTABLE", "-e", "say 1; die", :out); say "out: {$proc.out.lines}"; | 15:31 | |
smls | m: dd Array.elems | ||
camelia | rakudo-moar d2faa1: OUTPUT«0» | ||
smls | ^^ the buil-in containers don't seem to restrict stuff to defined invocants | ||
15:31
diana_olhovik left
|
|||
smls | m: dd (Array)[5] | 15:31 | |
camelia | rakudo-moar d2faa1: OUTPUT«$v = Any» | ||
smls | looks like undefined arrays behave like empty arrays :P | 15:32 | |
skids | smls: autoviv. | ||
15:33
telex left
|
|||
smls | Hm. Are you sure that's not a separate mechanism? | 15:33 | |
itz | grrr I want gather/take in perl5 now :) | ||
15:33
tinyblak joined
|
|||
moritz | smls: there many built-ins that restrict methods to defined invocants | 15:33 | |
m: say DateTime.later(:1hour) | 15:34 | ||
camelia | rakudo-moar d2faa1: OUTPUT«Cannot look up attributes in a type object in block <unit> at /tmp/SQsVKV4wzI:1» | ||
moritz | hm | ||
:( | |||
15:34
telex joined
|
|||
smls | method later (DateTime $: *%unit) ;) | 15:34 | |
nine | It's less that they restrict and more that they explode ;) | ||
smls | looks like it | 15:35 | |
moritz | mlenz@mlenz-workstation:~/p6/rakudo (nom)$ git grep ':D:'|wc -l | 15:36 | |
977 | |||
m: Buf.push(42) | |||
camelia | rakudo-moar d2faa1: OUTPUT«Cannot modify an immutable Buf in any at src/gen/m-Metamodel.nqp:1676 in block <unit> at /tmp/0UflDs2Cm0:1» | ||
moritz | m: say Code.static_id | ||
camelia | rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Code' instance, but a type object was passed. Did you forget a .new? in block <unit> at /tmp/GuNV8RynSn:1» | ||
moritz | finally :-) | ||
m: say Num.isNaN | 15:37 | ||
camelia | rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Num' instance, but a type object was passed. Did you forget a .new? in block <unit> at /tmp/LMCzJRKQJe:1» | ||
15:40
nys joined
|
|||
TimToady | lizmat: if you like, you can mention that I've been privately prototyping the new non-flattening list and array semantics to see where the new gotchas will be | 15:43 | |
smls | re. changing the default: It wouln't have to be changing "Type:" to mean "Type:D:" by default. Just make it so that when no explicit invocant is specified at all, it assumes "::?CLASS:D:" instead of "::?CLASS:". | 15:44 | |
TimToady | that doesn't work for constructors | ||
smls | so, constructors would have to specify an explicit invocant | 15:45 | |
RabidGravy | theoretically would be it be possible for .assuming() to return a Code with a "proper" signature based on the original one? | ||
smls | but most other methods wouldn't have to anymore. | 15:46 | |
ugexe | speaking of assuming, it doesn't work on jvm :( | ||
skids | RabidGravy: yes I have a patch. I will subit it tonight. | ||
RabidGravy | skids++ # nice one | ||
jnthn | dinner & | 15:47 | |
lucasb | ugexe: thanks for that run() snippet. that is about that S24-testing/line-numbers.t test? | ||
geekosaur | belated lizmat++ | ||
ugexe | i saw you and leont asking how to use run | ||
geekosaur running on way too little sleep... pity today's schedule disallows a nap | |||
lucasb | ugexe: oh, ok | 15:48 | |
skids | RabigGravy: You can test this fork if you're up for it: github.com/skids/rakudo/commit/975...8856e2e240 | ||
leont | lizmat++ # P6 Weekly caused me to update TAP::Parser for synchronous support :-) | 15:50 | |
timotimo | ooh awesome | 15:51 | |
lizmat++ | |||
15:59
abraxxa left
16:04
VinceDee left
16:11
diana_olhovik joined
16:13
davido__ left
|
|||
leont | I'm currently organizing my code into multiple files with multiple related classes. It seems precompilation isn't agreeing with this notion, any suggestions? | 16:16 | |
Is this a common issue? Should I reorganize? | 16:17 | ||
ugexe | sounds like you need to rewrite your META file | ||
provides section specifically | |||
16:18
davido__ joined,
dha joined,
dha left,
dha joined
|
|||
leont | Right, I had a pull request for that! | 16:19 | |
16:19
atroxaper joined
|
|||
leont | Without description, so I didn't realize it might be related | 16:20 | |
16:20
tinyblak left
16:21
uncleyea1 joined,
tinyblak joined,
uncleyear left
|
|||
timotimo | yeah, without the "provides", the "use" statement will not find stuff | 16:22 | |
dalek | ast: 557532a | (Lucas Buchala)++ | S24-testing/line-numbers.t: Change use of qx// to run() in test |
16:23 | |
ugexe | i believe it may have more to do with building the dependency order by mapping namespaces to file paths | ||
leont | The PR doesn't seem to have fixed it, but it is missing classes so I guess I should amend it further | ||
16:24
atroxaper left
|
|||
lucasb | ^^ please review if everything is fine with my commit, thanks | 16:24 | |
ugexe | you should trace the build order and see if you think it looks correct | ||
leont | It does actually | 16:25 | |
xABCannot invoke this object (REPR: Null, cs = 0)xBB is not a very helpful error | |||
16:26
tinyblak left,
Gruber is now known as Grrrr
|
|||
ugexe | i say that because im not sure panda parses dependency order for provides correctly when there are multiple namespaces mapped to a single path | 16:28 | |
16:29
itz left
|
|||
ugexe | as in, the topological sort should not count FILE.pm with class A and class B twice if FILE2.pm depends on class A and class B | 16:29 | |
is it on the ecosystem that i can pull down? | 16:31 | ||
timotimo | lizmat: perhaps you can put my call for help for the profiler template into the weekly to find someone with js experience and a bit of free time? | 16:32 | |
leont | Yes, as TAP::Harness | 16:33 | |
dha | Assignment operators. Can one assume that they work similarly in p6 to the way they do in p5? S03 indicates so, but the operators document at docs.perl6.org only documents C<=> and C<< => >>. | 16:34 | |
16:35
spider-mario joined
|
|||
dha | Also, the string coercing bitwise operators now experimentally in p5 (C<&.=>, etc.) ... I'm guessing they're probably not in p6 | 16:35 | |
? | |||
ugexe | oh i see what you mean | 16:36 | |
for now, you probably need to declare the entire name. | 16:37 | ||
package TAP { class Generator { | |||
16:38
uncleyea1 is now known as uncleyear,
uncleyear left,
uncleyear joined
|
|||
ugexe | probably has to be TAP::Generator for the current build order to be generated in its current fashion | 16:38 | |
leont | I see | 16:42 | |
Well, at least that isn't a very big change :-) | |||
Though I'm doing that in multiple placesx85 :-/ | 16:43 | ||
ugexe | jvm is failign to build during .\perl6-j.bat --target=jar --output=lib/Test.pm.jar -Ilib lib/Test.pm on both windows and linux | 16:44 | |
[Coke] | getting a spectest failure on os x locally: Unable to execute 'PERL6_BINARY=/Users/williamcoleda/sandbox/rakudo/perl6 sh t/spec/S32-io/IO-Socket-INET.sh 7 1024' in block <unit> at t/spec/S32-io/IO-Socket-INET.t:170 | 16:49 | |
timotimo | dha: but => isn't an assignment operator | 16:50 | |
16:50
rindolf left
|
|||
[Coke] | guessing that PERL6_BINARY isn't being passed through somewhere. | 16:51 | |
dha | Well, operators lists it under "Item Assignment Precedence" so, although I can see how one might say "that defines the precedence level, rather than the operators in that precedence level", it's confusing in that respect. | ||
16:52
AlexDaniel left
|
|||
TimToady | m: say Int.new | 16:53 | |
camelia | rakudo-moar d2faa1: OUTPUT«0» | ||
TimToady | is there any use case for Int.new returning 0 rather than blowing up? | ||
ShimmerFairy | my Int $a; defaulting to 0, perhaps? | 16:54 | |
TimToady | m: my Int $a; say $a | ||
camelia | rakudo-moar d2faa1: OUTPUT«(Int)» | ||
TimToady | doesn't | ||
dalek | ast: cf81ec2 | coke++ | / (31 files): kebab case skip-rest Even in comments and old fudges. |
||
16:55
Jonis joined
|
|||
[Coke] | TimToady: he's suggesting that maybe that's why it doesn't. | 16:55 | |
... oh. I see what camelia says tehre. nevermind. | 16:56 | ||
nine | TimToady: as always the non-existence of a use-case is much harder to prove than the existence. | ||
timotimo | "i want a new instance of what i was given, so i'll just call .new on the thing i was given"? | ||
[Coke] | lots of failures in the last moar-jit spectest run: | ||
github.com/coke/perl6-roast-data/b....out#L3891 | |||
ShimmerFairy | TimToady: to be honest, I'm not sure there's much of a use-case for Int.new in user code :P | ||
ugexe | m: my $x = Int.new; my $y = Int; say 1 if $x; say 2 if $y # i guess the expectation of this is the question | 16:57 | |
camelia | ( no output ) | ||
ShimmerFairy | [Coke]: Were you referring to me just then, ooc? | ||
TimToady | yes (s)he was :) | ||
ShimmerFairy | I wasn't sure, because I'm not a he :) | 16:58 | |
TimToady: I was reminded of something a bit earlier: Should ~& and friends _really_ still be coercing strings to buffers? I'm of the opinion that you should explicitly convert to the buffer you want if you need to use the "stringwise" bit ops. | 16:59 | ||
PerlJam | Is Int.new how we autoviv? | 17:00 | |
TimToady | don't think so | ||
ShimmerFairy: it's more like "ABCD" should be considered an allomorphic literal if used by a buffer op | 17:01 | ||
17:02
FROGGS joined
|
|||
smls | so it should throw an exception when given a Str that has non-ASCII chars? | 17:02 | |
TimToady | that has been suggested | ||
17:02
dakkar left
|
|||
ShimmerFairy | I'd prefer it warn you and leave the consequences of not being more specific to the programmer :) | 17:02 | |
TimToady | or possibly non-Latin-1 | ||
for a use case, see rosettacode.org/wiki/Find_the_missi...ion#Perl_6 | 17:03 | ||
17:04
leont left
|
|||
ShimmerFairy | If you do limit the range of allowable characters, I think 7-bit ASCII is just a bit too restrictive. | 17:04 | |
TimToady | I think the RC entry needs 8 bits, at least | ||
Juerd | ShimmerFairy: It's the only thing you can re-encode to most other currently fashionable encodings without changing the binary representation, so ASCII does make sense. | 17:05 | |
ShimmerFairy | Juerd: sure, but I think allowing 0x80..0xFF single-byte representations isn't too much to ask for :) | 17:06 | |
Juerd | If it would allow latin1, then what does that even mean? Does it allow utf8 encoded source code with only code points under 256, or should the source itself be latin1 encoded? And isn't it a bit weird to auto-decode as latin1 for a binary-as-in-data operator? | ||
ShimmerFairy: There's the thing, there's no easy way to even get those in your code if your editor (TEXT editor) is but a bit sane. | 17:07 | ||
ShimmerFairy | Juerd: this is why I've always thought the ~ style bitops shouldn't accept strings, and force you to convert to the buffer you want :) | ||
TimToady: that is a pretty nice use-case though. | 17:08 | ||
smls | Juerd: I don't think that problem applies here | ||
Juerd | Maybe we just need different delimiters for binary data. | ||
q:base64/.../ # :) | |||
smls | If you have a Str, you already know the meaning of each char unambiguously | ||
timotimo | q:hexdump:to<end> | 17:09 | |
Juerd | smls: What's the "meaning" of a character in binary-as-in-data context? | ||
timotimo: <3 | |||
smls | well, in the case proposed above, latin-1 by default | ||
Juerd | smls: I think that that case makes less sense than restricting to ASCII. | ||
TimToady | sometimes prohibiting nonsense also prohibits sense | 17:10 | |
Juerd | utf-8 encoded latin1-compatible codepoints aren't binary data. | ||
ShimmerFairy | I like to think of the potential acceptable range as "Characters U+0000 through U+00FF encoded in UTF-32, but with only the least significant byte kept" :P | ||
Juerd | ASCII is the only thing that we're still using where text and binary are specced as the same thing. | 17:11 | |
iso8859 as a thing you might want to mention anywhere in your documentation or source made sense when Perl 6 was conceived, but it's 2015 now :) | 17:12 | ||
TimToady | thing is, xoring sets high bits; do we require people to xor an even number of times? | ||
smls | TimToady: Your rosetta solution could be made to work by adding a simple ».encode("latin-1") right? | ||
ShimmerFairy | It would, but it would look slightly less nice, I'd have to admit. | ||
TimToady | just ».encode will work | ||
since UTF-8 is fine for ASCII | 17:13 | ||
smls | right | ||
[Coke] | ShimmerFairy, TimToady: apologies. | ||
ugexe | latin-1 wont explode on invalid utf-8 though i thought | ||
ShimmerFairy | [Coke]: don't worry too much about it, I was getting it wrong until not too long ago myself :P | 17:14 | |
I personally think Latin1 is the best choice if some sort of limit ends up being used. | 17:16 | ||
TimToady rejoices that all kinds of people feel safe here, except maybe trolls | |||
ShimmerFairy | TimToady: well, I'm not the first of my kind here, so that helps :) | ||
Latin1 is the most common extension of ASCII (as I understand it), so it would cover a lot of cases. And if it doesn't do the right thing for you, then there's always .encode() | 17:17 | ||
|Tux| | safe is so relative. sometime the info I get here almost makes my brain explode. hence not safe | ||
TimToady | m: say (~^'ABCD').WHAT | 17:19 | |
camelia | rakudo-moar d2faa1: OUTPUT«(Failure)» | ||
masak | ShimmerFairy: [backlogging] I just want to say congratulations on the -- as au++ would say -- runtime polymorphism. :D | ||
ShimmerFairy wonders how possible it is to argue that Unicode is actually the most common extension of ASCII nowadays... | |||
masak: thanks :3 | 17:20 | ||
masak | ShimmerFairy: now the change in nick makes a bit more sense, too. | ||
I mean, the timing of it. | 17:21 | ||
PerlJam | masak: good save :) | 17:22 | |
ShimmerFairy | masak: yes, my previous nick was almost comically gendered once the issue came up :) | ||
masak | ShimmerFairy: strangely, yes. I don't really know *why* your prev nick would count as gendered, but it somehow does. | 17:23 | |
ShimmerFairy | masak: first names like "Lou" are homophones to "lue", that's why | ||
masak | oooooh | ||
good thing you found a nick that's hardly gendered at all :P :P :P | 17:24 | ||
TimToady notes the relationship of rnd with shimmer however :) | |||
17:25
zakharyas joined
|
|||
RabidGravy | (I may have somewhat overstated the simplicity of the libmp3lame binding - it's got about a billion optional parameters) | 17:26 | |
masak | RabidGravy: well, you know what they say. first, make it work. then, support all the billion optional paramters. | ||
timotimo | RabidGravy: how does C handle optional parameters? | 17:27 | |
ShimmerFairy | I worked with the theora library once, and I remember my biggest headache was dealing with the YUV colorspace (which of course isn't the library's fault) | ||
RabidGravy | masak, yup | 17:28 | |
moritz | timotimo: usually by having a struct with a member for each option | ||
timotimo: and allowing them to be NULL | |||
ShimmerFairy | C doesn't let you assign default values to parameters? | 17:29 | |
moritz | nope | ||
and variadic functions are a pain in C | 17:30 | ||
RabidGravy | timotimo, moritz in common with most libraries of this genre it has a static opaque "handle" and a squillion get/set functions | ||
|Tux| | new Capture warning makes me need to change a sheet in my talk :) | 17:31 | |
masak | progress++ # \o/ | 17:32 | |
moritz | RabidGravy: better than MUMPS (a FORTRAN library) where you set all the options yourself in that not-opaque-enough handle | ||
|Tux| | (staying in touch)++ | ||
FWIW I don't really like the fact that it is a single line. It doesn't read well | 17:34 | ||
Potential difficulties: | |||
To pass an array, hash or sub to a function in Perl 6, just pass it as is. | |||
For other uses of Perl 5's ref operator consider binding with ::= instead. | |||
Parenthesize as \(...) if you intended a capture of a single variable. | |||
at -e:1 | |||
------> my @a = 1,2; $a = \?@a; $a.WHAT.say | |||
that reads much better | |||
masak | |Tux|: agreed. care to change it? | 17:35 | |
|Tux| | *I* won't :) | ||
masak | oh... :/ pity. | ||
ShimmerFairy | |Tux|: but you just did! (see backlog) | ||
masak .oO( whaddya take me for, a *core* developer!? ) | |||
|Tux| | err, yes! | 17:36 | |
17:36
beastd joined
|
|||
geekosaur | I did look around for other long warnings and they didn't seem to be autowrapped | 17:36 | |
er, not auto-, hard- | |||
|Tux| | this one is exceptionally long | ||
ShimmerFairy | (btw, if 'no worries' ends up blocking other, not-P5 warnings, I wonder if it would be worth it to have a new kind of warning for P5 warnings, <.p5ism("...")> or such) | 17:37 | |
geekosaur | there was an earlier suggestion to have typed warnings like there are typed errors/exceptions currently | ||
moritz | ShimmerFairy: we already have <.obs> for obsoletion warnings | 17:38 | |
ugexe | timotimo: your last commit seems to be where jvm stops building | ||
ShimmerFairy | moritz: should the Perl 5 warnings prefer <.obs> then? | ||
geekosaur: For some reason I'm reminded of how the C preprocessor has #error but not #warning (discounting GCC's nonstandard support for it) | 17:40 | ||
moritz | yes | ||
ShimmerFairy: I thought they did already | |||
ShimmerFairy | moritz: the 'no worries' pragma came about to block Perl 5-based <.worry> messages (by blocking all <.worry> messages) | 17:41 | |
17:42
rindolf joined,
zakharyas left
|
|||
[Coke] | "perl6 core" "who's your friend?" # throwback to an ancient chip & dale cartoon, yikes. | 17:43 | |
moritz | ShimmerFairy: doing a "git grep '\.obs'" and a "git grep '\.worry'", I get the impression that there is more p5 specific with <.obs> than with <.worry> | ||
but then <.obs> is fatal, so you cannot easily disable it | |||
ShimmerFairy | Hm. Well, the point of 'no worries' is to not tell people like me about how the Perl 5 code I'm trying to wrote won't DWIM, because I don't know any Perl 5 in the first place. | 17:45 | |
*write | |||
itz_ | I think the more common case is people knowing Perl 5 | 17:46 | |
dha | And, now... annoying questions about heredocs... :-) | 17:47 | |
masak | yay | ||
dha | The heredoc docs include this line: C<my $escaped = escaque(q:to/TERMINATOR/, language => 'html');>. Should I assume that "escaque" "esacape" there? and, if so, is there actually an C<escape> function? | 17:48 | |
ShimmerFairy | itz_: sure, that's why the warnings are on by default. I just want to turn off the warnings that mean nothing to me :) | ||
smls | dha: I think that's just meant do show how one can use a heredoc inside an expression | 17:50 | |
*to | |||
dha | Also, the heredoc strings are specified as, e.g. C</END/> for "END". Are these regexes, or some odd quoting construct specific to heredoc syntax? | ||
smls - Well, yes, but I don't have any idea what an "escaque" is, and it might confuse people. | 17:51 | ||
smls | escaque() is not a built-in function; just meant as a hypothetical example | ||
moritz | dha: not a regex | ||
m: say qw/foo bar baz/.join('|') | |||
camelia | rakudo-moar d2faa1: OUTPUT«foo|bar|baz» | ||
moritz | the quoter/.../ thingy isn't reservied for heredocs | ||
smls | dha: Right, it might be clearer to change it to "my-escaping-function(" | 17:52 | |
dha | moritz - ah. So those are just part of the quoting operator syntax, and could just as easily be C<q:to{TERMINATOR}> | ||
smls - ok. I think I'll patch that so it makes more sense. | |||
dalek | c: 0178965 | moritz++ | lib/Language/quoting.pod: Try to clarify example for heredocs, dha++ |
17:53 | |
moritz | dha: I'm afraid I'm faster :-) | ||
dha | Finally (I think). | ||
moritz - No worries. As long as it gets done. | |||
:-) | |||
ShimmerFairy | Yes, the use of // to delimit is simply a convention that's developed over time. (masak has noted before how he doesn't like it too much :P) | ||
dha | ShimmerFairy - right. I really should have realized that. the C<:to> got in between the q and the / and confused me for a moment. | 17:54 | |
17:55
domidumont joined
|
|||
dha | And finally(?), it used to be that if you surrounded your terminator string with single quotes or double quotes it either didn't interpolate or did. Is there a way to make that distinction in Perl 6? For instance, using C<qq> instead of C<q>? | 17:55 | |
smls | I like square brackets as quote delims personally, as in q:to[END] | ||
dha | (That's how I would guess it would work but it's not documented in the quoting documentation. | ||
smls | qq:to vs q:to I think | 17:56 | |
17:56
espadrine left
|
|||
dha | I guess I'll have to write a test... *sigh* | 17:57 | |
:-) | |||
smls | synopses confirm it: design.perl6.org/S02#Heredocs | ||
17:58
ShimmerFairy left
|
|||
dha | Well, hopefully it's actually implemented... :-) | 17:58 | |
smls | :) | ||
18:00
brrt joined
|
|||
dha | Yep. it works. whew. | 18:01 | |
dalek | c: 39d9449 | moritz++ | lib/Type/IO/Pipe.pod: Bare-bones documentation for type IO::Pipe |
18:02 | |
ugexe | typo says 'method prodc' | ||
moritz | ugexe: thanks | ||
dalek | c: d42aeab | moritz++ | lib/Type/IO/Pipe.pod: Two small fixes in IO::Pipe docs * IO::Handle is a class, not a role * typo in method name, ugexe++ |
18:03 | |
c: ee67d9f | moritz++ | type-graph.txt: Add IO::Pipe to type graph |
|||
18:10
ShimmerFairy joined
18:11
smls_ joined,
smls left
|
|||
lucasb | If the only thing a .new method does is call nqp::create(self).BUILD(...), then why have an explicit .new method at all, since this is what the inherited .new would do anyway? Yesterday I asked about Capture.new; here are other examples: | 18:14 | |
m: class R is Range {}; R.new(1,2) | |||
camelia | rakudo-moar d2faa1: OUTPUT«Method 'BUILD' not found for invocant of class 'R' in block <unit> at /tmp/7bCxgvL4E9:1» | ||
lucasb | m: class C is Complex {}; C.new(1,2) | ||
camelia | rakudo-moar d2faa1: OUTPUT«Method 'BUILD' not found for invocant of class 'C' in block <unit> at /tmp/dTymn3Jt__:1» | ||
18:15
raiph left
18:16
raiph joined
|
|||
moritz | lucasb: it is likely that Range.new is much older than our object construction mechanism | 18:16 | |
hoelzro | while working on a script, I discovered that LEAVE blocks are scheduled right away, instead of once the line they're found on has been reached (ex. I expected the LEAVE phaser here to never be run: die "uh-oh"; LEAVE say 'hi') | 18:18 | |
lucasb | For example, if something like Range's nqp::create(self).BUILD(-Inf, Inf, ...) was changed to self.new(-Inf, Inf, ...) it would work all right? | ||
hoelzro | if one is doing clean up on an object bound to a variable (ex. $db), is it idiomatic to CYA and do LEAVE $db && $db.close? | ||
18:18
mr-foobar left
|
|||
dha | Hmm... taking longer than I would expect for github changes to propagate... | 18:20 | |
[Coke] | hoelzro: the timing makes sense, given the compile time phasers. | 18:21 | |
moritz | hoelzro: yes | ||
hoelzro | [Coke]: it makes sense to me now, but surprised me at first | ||
I've also noticed with LEAVE (and POST) phasers that if the phaser throws an exception during an unwind, the original exception is masked unless one uses an explicit CATCH block; would anyone be opposed to improving the top level error handler to print out all exceptions being thrown? | 18:22 | ||
18:23
[Sno] left
|
|||
[Coke] | I wouldn't expect having multiple exceptions being thrown simultaneously to make sense. | 18:23 | |
isn't it always the most recent one that was thrown? | 18:24 | ||
hoelzro | m: die 'uh-oh'; LEAVE die 'leaving'; CATCH { default { .say } } | ||
camelia | rakudo-moar d2faa1: OUTPUT«uh-oh in block <unit> at /tmp/YINsD8hy8s:1leaving in block <unit> at /tmp/YINsD8hy8s:1» | ||
hoelzro | [Coke]: if the exception propagates to whatever handles uncaught exceptions, only the most recent is printed | 18:25 | |
my use case is for the Xapian binding I'm working on; if I do this: | |||
my $db = Xapian::WritableDatabase.new('test.db', $mode); LEAVE $db.close | 18:26 | ||
if opening the database fails, seeing "Any has no method close" doesn't help me | |||
[Coke] | I would expect that if close throws an exception, that's what you get. | ||
so you'd have to wrap your leave in a try. | |||
LEAVE try {$db.close}; # ingore any exceptions here, don't care. | 18:27 | ||
18:27
domidumont left,
mr-foobar joined
|
|||
hoelzro | or do the $db && $db.close trick | 18:27 | |
that just feels...weird to me | 18:28 | ||
that the original reason for stack unwinding is hidden | |||
[Coke] | hoelzro: you ever program in java? | ||
hoelzro | heh, not for a while | ||
but iirc in Java you can link exceptions | |||
for better or for worse | |||
ugexe | m: class Foo { method close { say 2; }; }; sub Bar { LEAVE { Foo.new.?close }; }; sub Baz { LEAVE { Foo.new.?blargh }; }; Bar(); Baz() | 18:31 | |
camelia | rakudo-moar d2faa1: OUTPUT«2» | ||
18:37
brrt left
18:39
Sqirrel left
18:41
lucasb left
18:43
raiph left
|
|||
masak | it is correct that I don't like // delimiters too much for heredoc markers. it's a pity they seem to be the default/convention. | 18:45 | |
reason I don't like them is exactly that they signal "regex!" without being one. | |||
I think my current favorite is <> as delimiters | |||
dha | I can see that, but they're pretty much traditional for the q operators as well. | 18:48 | |
But, hey! You can do whatever you want! | |||
masak boggles | 18:51 | ||
vendethiel waves | 18:52 | ||
18:53
espadrine joined,
domidumont joined
|
|||
jercos | is there an "I really know what I'm doing" flag for typed buffers? | 18:54 | |
ugexe | m: Buf[uint32].perl.say # ? | 18:55 | |
camelia | rakudo-moar d2faa1: OUTPUT«Buf[uint32]» | ||
jercos | say I have a string that was mistakenly decoded as utf-8 and happened to be valid... .encode("utf-8").decode("latin-1") throws a "Can not decode a utf-8 buffer as if it were latin-1" | ||
which is generally correct, but seems counterproductive in the corner-cases where I want that to happen, despite the potential consequences | 18:56 | ||
masak | I'm... a little bit surprised that's not already allowed. | ||
jercos | the other way around seems to be | ||
masak | I don't think of a buffer as a "utf-8 buffer". I think of it as a sequence of ints. | ||
jercos | m: "Hello, world".encode("utf-8").decode("latin-1") | ||
camelia | rakudo-moar d2faa1: OUTPUT«Can not decode a utf-8 buffer as if it were latin-1 in block <unit> at /tmp/VL3o4vTpEN:1» | ||
jercos | m: "Hello, world".encode("latin-1").decode("utf-8") | 18:57 | |
camelia | ( no output ) | ||
FROGGS | m: "Hello, world".encode("utf-8").WHAT | ||
camelia | ( no output ) | ||
FROGGS | m: say "Hello, world".encode("utf-8").WHAT | ||
camelia | rakudo-moar d2faa1: OUTPUT«(utf8)» | ||
ShimmerFairy | masak: surely you don't mean the utf8 type though, right? :) | ||
FROGGS | it is not a buf8 | ||
masak | jercos: anyway. I completely agree with you. | ||
jercos: it should go ahead and try... and *then* fail with a failing position if it's not actually decodable as latin-1. | 18:58 | ||
masak submits rakudobug | |||
ShimmerFairy: I have no idea. do I? | |||
oh, from what FROGGS++ eval'd it seems I do. | |||
well, I will stop submitting a rakudobug if someone tells me why this is a feature, not an annoyance ;) | 18:59 | ||
ShimmerFairy | m: say buf8.new("Hello, world".encode("utf-8")).decode("latin1") | ||
camelia | rakudo-moar d2faa1: OUTPUT«Hello, world» | ||
ShimmerFairy | ^ Once you don't have a Unicode buffer type, it'll work as expected | 19:00 | |
jercos | hrm... would that incur the same cost as buf8.new(.list)? | 19:01 | |
it definitely seems hackier than I would expect | |||
dha | Hm... Am I crazy, or does the latter example at doc.perl6.org/syntax/-%3E seem odd to be in the documentation for C<< -> >>? | ||
FROGGS | m: my &d = Blob.^find_method('decode'); say "Hello, world".encode("utf-8").&d('latin-1') # is that error message correct? | ||
camelia | rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Blob' instance, but a type object was passed. Did you forget a .new? in any at src/gen/m-Metamodel.nqp:1676 in block <unit> at /tmp/c6lQpnpoDa:1» | ||
FROGGS | ohh wait | 19:02 | |
m: my &d = Blob[uint8].^find_method('decode'); say "Hello, world".encode("utf-8").&d('latin-1') # is that error message correct? | |||
camelia | rakudo-moar d2faa1: OUTPUT«Invocant requires a 'Blob[uint8]' instance, but a type object was passed. Did you forget a .new? in any at src/gen/m-Metamodel.nqp:1676 in block <unit> at /tmp/wegl2_fkWe:1» | ||
FROGGS | hmmm | ||
19:02
colomon_ left
|
|||
ShimmerFairy | jercos: I think ideally you'd be able to use a .buf8 method, but for some inexplicable reason there have never been methods for converting to various buffer types. | 19:02 | |
19:03
diana_olhovik left
|
|||
jercos | maybe a .genericize for specialized buffer types? | 19:03 | |
'twould spit out a buf8 for utf8, buf16 for utf16, so on so forth? :p | |||
19:03
domidumont left,
colomon joined
|
|||
smls_ | m: say (-> $a, $b { $a ** 2 + $b ** 2})(3, 4) | 19:04 | |
camelia | rakudo-moar d2faa1: OUTPUT«25» | ||
smls_ | dha: Yeah, it's a little odd. This ^^ might be more appropriate. | ||
ugexe | m: "Hello World".encode('utf-8').unpack("A*").say | ||
camelia | rakudo-moar d2faa1: OUTPUT«Hello World» | ||
ShimmerFairy | I think it'd be better if we simply had the appropriate type conversion methods :P (also less letters) | 19:05 | |
Wait, since when did we have (un)pack implemented? | |||
FROGGS | since two years at least | ||
smls_ | only partially though I think | ||
dha | Yeah, the current example to be a digression from documenting the arrow operator into documenting general block syntax. | ||
FROGGS | smls_: aye | ||
dha | s/block/Block/; | ||
ShimmerFairy | FROGGS: I was under the impression that they weren't there at all, because the spec mentions zip about them. | 19:06 | |
19:07
diana_olhovik_ joined
|
|||
smls_ | dha: Ah, it's because that section is automatically extracted from /language/functions where it is actually called "Blocks and Lambdas" | 19:07 | |
dha | oop. That strikes me as efficient, but wrong. :-) | 19:08 | |
smls_ | Maybe the way we do that extraction/aggregation needs more thought | ||
dha | I vote yes, fwtw. | ||
smls_ | Do we even need /syntax/* pages? It's not like they're represented in the menu. | 19:09 | |
Maybe we just need to point to /language/syntax.html#some_subsections when you search for syntax tokens | 19:10 | ||
19:18
smls_ is now known as smls
|
|||
dha | What the.... C<while> isn't documented??? | 19:28 | |
masak | dha: it's kind of an experimental feature. | ||
:P | |||
[Coke] | dha: your sacrifice is appreciated. :) | ||
(it really is, thanks!) | 19:29 | ||
PerlJam | yeah, dha++ | ||
masak | waitwait, we perform sacrifices to create documentation nowadays? | ||
dha | It's my... I don't know, "pleasure" seems a bit much... :-) | ||
masak | I must have missed that. | ||
[Coke] | :) | ||
smls | jnthn: Is the return value of ASSIGN-POS and BIND-POS significant? | 19:30 | |
dha | So, I'm looking at the bit on No-Ops in perlop. Can I assume that C<1 while foo();> still works? Or has it become horribly complicated? | 19:34 | |
19:37
mohij joined
|
|||
masak | dha: :) | 19:38 | |
dha: that bit still works | |||
smls | m: 1 while $++ < 5; | ||
camelia | ( no output ) | ||
dha | Huh. Seems that C<300 for (1..1000000);' | ||
also works. | |||
masak wonders if `1` is the best thing to put there, in terms of things-that-leak-memory | 19:39 | ||
smls | m: 1 | ||
camelia | ( no output ) | ||
19:39
Peter_R joined
|
|||
smls | ^^ why no "useless use of literal in void context"? | 19:39 | |
dha | (in perlop, it says that 1 and 0 are special case to not emit warnings in void context) | ||
smls | masak: Then what is? | ||
dha | (but now, it seems a number in void context is ok even if it's not 1 or 0) | 19:40 | |
vendethiel | dha: I think that's for perl5 modules :) | ||
(that are, iirc, supposed to return 1 if loaded correctly) | |||
dha | vendethiel - could be for that too (and, yes, they are). But it also seems to be special cased for a virtual no-op. | ||
19:40
FROGGS left
|
|||
dha | m: 300 | 19:41 | |
camelia | ( no output ) | ||
dha | m: "boo!" | ||
camelia | ( no output ) | ||
vendethiel | m: { 300 }; | ||
camelia | ( no output ) | ||
19:41
VinceDee joined
|
|||
dha | Hm... yeah, should those be emitting warnings? | 19:41 | |
vendethiel would think so | 19:42 | ||
smls | m: 300; 400 | ||
camelia | rakudo-moar d2faa1: OUTPUT«WARNINGS:Useless use of constant integer 300 in sink context (line 1)» | ||
smls | ah | ||
just the last one in the file doesn't warn | |||
vendethiel | oooh. that doesn't warn because it's "returned", then? | ||
smls | yeah | ||
dha | Hm. fwiw, perl 5 doesn't warn unless you specifically enable warnings. | 19:43 | |
smls | use warnings; is on by default in P6 | ||
dha | (which is, I guess, unsurprising, but p6 should have warnings on by default, no?) | ||
19:44
amurf joined
|
|||
dha | right. | 19:44 | |
m: 1, 1 | |||
camelia | ( no output ) | ||
vendethiel | that's a list :) | ||
m: SEQ(1; 2) | |||
camelia | rakudo-moar d2faa1: OUTPUT«WARNINGS:Useless use of constant integer 1 in sink context (line 1)» | ||
dha | m: 1, 0 | ||
camelia | ( no output ) | ||
dha | oh, right. | ||
m: 1; 1; | |||
camelia | rakudo-moar d2faa1: OUTPUT«WARNINGS:Useless use of constant integer 1 in sink context (line 1)» | ||
vendethiel | we don't really have perl5's "soft comma" (as I think they call it) | ||
lizmat | p6weekly.wordpress.com/2015/07/06/...t-was-hot/ <---- the new Perl 6 Weekly | 19:46 | |
vendethiel | lizmat++ | ||
dha | lizmat++ | ||
colomon | lizmat++ | 19:47 | |
dha | So... Now I'm confused. Does C<1 while foo();> work or not? | ||
1 does not seem to be special cased as it is in p5. | |||
masak | m: sub foo { state $n = 2; return True if $n-- }; say "OH HAI" while foo() | ||
camelia | rakudo-moar d2faa1: OUTPUT«OH HAIOH HAI» | ||
masak | dha: it works. | 19:48 | |
vendethiel | > vendethiel mentioned an an interesting paper on recursion vs corecursion. For the aficionado, I think. | ||
yes, indeed... uses some jargon as well | |||
masak | m: sub foo { state $n = 2; say "OH HAI"; return True if $n-- }; 1 while foo() | ||
camelia | rakudo-moar d2faa1: OUTPUT«OH HAIOH HAIOH HAI» | ||
lizmat | dha: maybe "loop { foo() }" is more idiomatic Perl 6 | ||
masak | dha: I'm not aware that `1 while foo();` is special-cased in Perl 5. | ||
19:48
amurf left
|
|||
dha | masak - perlop says yes. | 19:48 | |
masak | lizmat: that doesn't do the same! o.O | ||
smls | masak: Well, it "works" in that it produces not side-effects. | ||
But does it guarantee not to run out of memory? | 19:49 | ||
19:49
ggoebel joined
|
|||
masak | lizmat: `loop` loops forever. `while foo()` stops if foo() returns something falsy. | 19:49 | |
lizmat | duh | ||
dha | I'm currently dealing with perldoc.perl.org/perlop.html#No-ops | ||
masak | smls: does `1 while foo();` *guarantee not to run out of memory* in Perl 5!? | 19:50 | |
smls: what if foo() allocates lots of stuff? | |||
smls | dha's link seems to suggest it does | ||
well, that's different :) | |||
skids | (backlogging) IIRC the use case for Int.new was something to do with subclassing/$?CLASS.new/etc and was asked after by -- ergh I forget who -- doing TZ support. | 19:51 | |
lizmat | std: while say "foo" | ||
camelia | std 28329a7: OUTPUT«5===SORRY!5===Missing block at /tmp/3AcclRos5F line 1 (EOF):------> 3while say "foo"7⏏5<EOL>Parse failedFAILED 00:00 135m» | ||
smls | maybe Empty while foo() ? | ||
lizmat | why not just "while foo();" ??? | ||
dha | m: while say "foo" | 19:52 | |
camelia | rakudo-moar d2faa1: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1A99J_tyCEMissing blockat /tmp/1A99J_tyCE:1------> 3while say "foo"7⏏5<EOL> expecting any of: block or pointy block postfix» | ||
smls | For the same reasons we're not allowed to write "sub foo;" instaed of "sub foo {*}" I guess | 19:53 | |
lizmat | well, fwiw, I don't see why "while", "until" and "loop" couldn't take a blorst | 19:54 | |
moritz | because TTIAR | 19:55 | |
mst | www.flickr.com/photos/vmbrasseur/s...5127918530 | ||
bah | |||
19:55
atroxaper joined
|
|||
mst | wrong bloody paste buffer | 19:55 | |
blog.hackerrank.com/the-inevitable-...-of-cobol/ | |||
there. | |||
19:56
brrt joined
|
|||
mst | thought the fact that decimal arithmetic got a specific mention was interesting | 19:56 | |
ugexe | m: ".".IO.chdir("lib").say # this should actually try to chdir into $*SPEC.rel2abs("lib", '.') instead of "/lib" correct? | ||
camelia | rakudo-moar d2faa1: OUTPUT«"/lib".IO» | ||
vendethiel | .oO( good thing I learned cobol then ) |
||
fun fact: cobol has two constructs named "classes" | |||
19:58
espadrine left
|
|||
moritz | mst: fwiw I've been reading such articles for the last ten years | 19:58 | |
vendethiel | .oO( I swear, won't these cobol guys die already?! ) |
||
(sorry) | |||
moritz | mst: and these days I tend to shrug it off as Y2K-like hype | ||
timotimo | ugexe: oh damn, thank you for noticing, i'll revert it | ||
PerlJam | There's still a cobol course at the University where I work. | 19:59 | |
mst | moritz: more that "there's nothing that the logic can easily be directly ported to" | ||
seemed interesting | |||
I didn't see it as hype, just a note about language features | |||
moritz | mst: *nod* | ||
19:59
atroxaper left
20:00
nowan left
|
|||
moritz | fwiw my stance is that if there's a lot of money to be made with COBOL stuff, I still wouldn't like to program in it, but maybe write cross-compilers that do the work for me :-) | 20:00 | |
20:01
mohij left
|
|||
masak | that actually sounds like fun. no clue if it's viable, though. | 20:01 | |
dalek | kudo/nom: 2823563 | timotimo++ | src/core/Failure.pm: Revert "make Failure objects a tiny bit smaller" It makes the JVM build break, sadly This reverts commit d9c1e267f50513eaeb9717be01fea97585e4ca85. |
20:02 | |
moritz | masak: last I had that thought, I googled around a bit, and found Java <-> COBOL interop business products | ||
lizmat | timotimo: why not make it conditional for the JVM ? | ||
20:03
nowan joined
|
|||
brrt | masak: ehm, since you've studied macro's quite a bit | 20:04 | |
yoleaux | 06:37Z <FROGGS> brrt: Ummm, what? | ||
timotimo | hmm | ||
masak | brrt: yeees? | ||
brrt | can you advice me to pick a sigil for my macro's in my little tree template language | ||
masak | how about &, like subs? | ||
brrt | i'm thinking ^ for declaring (in the name) and ` for quoting | ||
masak | honestly, I can't advise on such a thing without more context. | 20:05 | |
brrt | i've already used & for c-level macro's (like offsetof/alignof/sizeof | ||
github.com/MoarVM/MoarVM/blob/even...t/exprlist is context :-) | |||
masak | but "tree template language" sounds different enough that much of what I've learned about Perl 6 macros doesn't apply :) | 20:06 | |
masak clicks, looks | |||
brrt | the s-exps represent tree templates | ||
masak | oh, cute. | ||
brrt | $1, $2 etc represent operand param 1 and 2, respectively | ||
(&offsetof MVMObject st) becomes offsetof(MVMObject, st) | |||
masak | ah. | 20:07 | |
could you also name a situation where you'd need those (non-c-level) macros? | |||
brrt | yes, can you see the getlex_no thingy? | 20:08 | |
masak | yes, last in the file. | ||
brrt | the let expression containing $str is actually a quite common pattern in the dynasm code; it acquires a string from the compunit string array] | 20:09 | |
it's.. unwieldy, and i've gotten it wrong several times | |||
if you do get it wrong, tree traversal will die in interesting ways | |||
20:09
darutoko left
|
|||
masak | but it's a fixed template, right? no unquotes? | 20:09 | |
brrt | whereby interesting means 'rather nonobviously wrong' | ||
masak | or is there something in there that you feel should be parameterized? | 20:10 | |
brrt | hmm... it should probably contain fill-ins for parameters (e.g. $1) | ||
yes, i'll need parameters | |||
vendethiel looks as well, as he enjoys macros himself | |||
masak | hmmmmm | ||
dha | PERLOP DONE. | ||
timotimo | oh yeah! | ||
masak | dha++ | ||
dha | woo. | 20:11 | |
PerlJam | brrt: Can you show that same example again, but with your hypothetical macro syntax? | ||
brrt | will do | ||
masak | brrt: how about something like `let (($str MACRO_load_str($1) ...` ? | ||
brrt | hmmm | 20:12 | |
masak | brrt: (that is, a macro is used (and defined) by it having a MACRO_ prefix) | ||
brrt | that's.. not necessarily a bad idea | ||
masak | could work. | ||
dha | ok, this is ridiculous. I'm trying to pull updates for perl6/doc, but it's telling me it's "Already up-to-date." despite changes from a couple of hours ago not being there. | ||
brrt | the only objection i have is that it breaks sexp syntax (i.e. requires another parser) | ||
but it's nice and obvious | 20:13 | ||
dha smacks github with a hammer | |||
tony-o | dha: correct branch? | ||
dha | should be. | ||
masak | brrt: it only requires a hook in the sexp parser that splices in the tree returned from the macro. | ||
dha checks to make sure | |||
masak | brrt: you have an easier task than I do in Perl 6, because your trees don't have an environment :) | ||
PerlJam | I was having a feeling about ^ not being "big enough" for a macro sigil, but MACRO_ wouldn't have that (possibly imagined) problem. | ||
20:14
[Sno] joined
|
|||
smls | dha: Works for me. Do you have the correct `git remote -v` ? | 20:14 | |
masak | I think what I like most about the MACRO_ idea is that the definition of macros basically falls out of what's already there. | ||
because otherwise the question becomes "how does the macro specify its parameters? some (...) syntax?" | 20:15 | ||
but here it's just $1, $2... like with the function definitions that are already there. | |||
dha | oh. the git remote -v is, in fact, wrong. Grr. It *wasn't* at some point... | ||
timotimo | brrt: but wouldn't it work just as well with (MACRO_load_str $1) instead of MACRO_load_str($1)? | ||
brrt | hmm yes, it would | 20:16 | |
masak | right. that was my next point. | ||
timotimo | :) | ||
masak | maybe for consistency you should write it as `(&MACRO_load_str $1)`... | ||
up to you whether you want that & up front | |||
another idea I had was `(&&load_str $1)` | |||
but that might be too confusable with &load_str | 20:17 | ||
PerlJam | maybe `(%load_str $1)` :) | 20:18 | |
brrt | gist.github.com/bdw/736b57fe772fc0269dbe | 20:19 | |
is what it'd be under my suggeted syntax | |||
so many sigils to choose from | 20:20 | ||
masak | the sigils are not the important choice :) | ||
finding some nice consistency is what matters | |||
brrt | hmm | ||
PerlJam | as long as it's not foolish consistency | 20:21 | |
20:21
dha left
|
|||
masak | right. I'm considering whether re-using $1 et al. for macros is foolish consistency. | 20:21 | |
brrt | i.. think it is | ||
hmm | |||
although | 20:22 | ||
masak | brrt: you should probably do ,a instead of `a for unquotes | ||
brrt | macro's probably shouldn't have $1 parameters in the first place | ||
masak | brrt: because ,a is unquote in Lisp, whereas `a means quasiquote | ||
20:22
dha joined
|
|||
brrt | fair enough | 20:22 | |
masak | swapping their meaning is too confuzzling | 20:23 | |
PerlJam | brrt: you mean, macros should have parameters, just not the same a $1, $2, etc ? | ||
RabidGravy | do you know what the most important thing | ||
PerlJam | RabidGravy: happiness. | ||
masak | and I don't think the ` is necessary in the parameter list | ||
RabidGravy: friends | |||
brrt | right. $1 and $2 should refer - i think - to parameters of the operand to which it applies | ||
PerlJam | brrt: right. | ||
masak | brrt: yeah, that makes sense | 20:24 | |
RabidGravy | changing '.' to '~' for string concatenation | ||
masak | RabidGravy: \o/ | ||
brrt | i think friendship can reasonably compete with that :-P | ||
masak | brrt: and you don't need the ^ before 'get_string' either, AFAIU | ||
brrt | no, you're right | ||
RabidGravy | how many times I mistype . instead of , and it wouldn't get caught until something breaks at runtime | 20:25 | |
PerlJam | unless you want macros to stand out all the time. | ||
masak | oh, now I see. you're being consistent between definition and use. | ||
hm. | |||
yeah, it works. keep it if you want. | |||
brrt | i'd add that i want the args to the macro spliced in directly | ||
as in, able to take a list rather than $1 | |||
PerlJam would still use a "fatter" character than ^ to signify macros | 20:26 | ||
masak | brrt: now for some tough questions. | ||
brrt | such as? the ^ signifies a 'higher level' for me | ||
ok, bring'm on :-) | |||
masak | brrt: can a parameter such as `a be used many times in the macro body? | ||
PerlJam looks up and sees no macros | |||
brrt | yes | ||
masak | brrt: what if it's something with a side effect? does it run several times? | 20:27 | |
brrt | ...yes, and if you want something else you use (let) | 20:28 | |
masak | good. | ||
brrt | no obvious way to prevent that, anyhow :-) | ||
masak | right. | ||
20:28
bin_005 joined
|
|||
PerlJam | brrt: I would use @ or % or ** or something. But only because I'd like to know at a glance where the macros are and for me, ^ kind of disappears in the mix | 20:29 | |
brrt | macro's are fun. i use 'm in C a lot now too | ||
masak | brrt: do you predict that you'll ever invoke a macro inside a macro body? | ||
brrt | could be, yes; i intend to use parser-level splicing | ||
masak | right. | ||
brrt | hmm | ||
maybe that is not a good idea | |||
PerlJam | brrt: the same macro? (i.e. "recursion") | ||
masak | seems to be so far. | 20:30 | |
just that recursion and mutual recursion are out. | |||
brrt | not the same same macro, no | ||
masak | heh, PerlJam++ beat me to it :) | ||
brrt | macro needs to be declared before it can be used | ||
masak | right. | ||
glad we agree. | |||
brrt | :-) | ||
masak | then I really like ^ as a character choice, I think :) | ||
the mnemonic is "look above for the thing to put here" :D | 20:31 | ||
which is a (weak) reason not to include it in the definition... | |||
brrt: do you ever envision passing a function (reference) to a macro? what about passing a macro to a macro? | 20:32 | ||
brrt | hmmm... i did include the $ for the name definitions in the let declaration | ||
masak | brrt: what about returning a macro (reference) from a macro? | ||
brrt | wait, let me think about that | 20:33 | |
masak thinks, too | |||
brrt | the last, no, i don't need that kind of power | ||
the first, to be clear there's not really such a thing as a function at this level | |||
just trees | |||
PerlJam | seems to me like there's a lot of power in being about to pass a macro to another macro. | 20:34 | |
brrt | they look like code, they represent code, but they're trees, and they're never evelauted | ||
masak | PerlJam: yes, I think so too. | ||
PerlJam: the use case I'm envisioning is something like sort-using-callback. | |||
brrt: right, understood. | 20:35 | ||
brrt | as in: (^foo ,a) (,a b) and you'd pass (^foo ^bar) which would result to (^bar b) which would evaluate to whatever (^bar b) would evaluate | ||
that is very powerful, i use it in C | |||
but the macro-evaluation semantics are more complex; you'd have to do a tree-walk after constructing the macro to fill it in | 20:36 | ||
masak | aye. | ||
brrt | not-sure-if-worth-it | ||
masak | maybe forbid it until you see that it would be worth it? | ||
brrt | yes, seems reasonable | 20:38 | |
masak | ok, I like where we ended up. good luck. :> | ||
PerlJam | brrt: are you going to use this for the jit? | 20:39 | |
brrt | :-) thanks | ||
yes | |||
this generates tree templates, which are then stitched together to form an expression tree | 20:40 | ||
20:41
espadrine_ joined
|
|||
brrt | 'tree' is a huge misnomer at this point, but so what | 20:41 | |
20:41
MueThoS76 joined,
MueThoS76 left
|
|||
brrt | the expression tree is then input to the (hypothetical so far) code generator | 20:41 | |
masak | one final thought: as you start using this... pay close attention to how it shapes your thoughts. after not-too-long you will get so used to thinking in terms of this model that it will be hard-ish to think outside of it. | ||
so take the chance while you're still not so used to it ;) | 20:42 | ||
20:43
diana_olhovik_ left
|
|||
PerlJam | masak++ I'd say those are some words of wisdom | 20:43 | |
masak | "the map is not the territory" -- EY | 20:44 | |
dha | Oof. Out of curiosity, is it a known thing that the search field in docs.perl6.org pages is kinda.... awful? | ||
brrt | yes, i'll do that :-) | ||
thanks | |||
masak | dha: I was thinking the same the other day. | 20:45 | |
dha: I don't think it's hopeless, it's just... been through fewer iterations than the rest of that page. | |||
dha | So, C<while> isn't actually documented in those documents, so, I'm not wholly surprised it can't be searched for (although I am wholly surprised that it's not documented...) | 20:46 | |
But C<given> *is* documented, but can't be searched for. | |||
masak | that's an outright bug. please submit. | ||
dha | ok. Submit an issue at github.com/perl6/doc ? | 20:47 | |
brrt | that cobol article makes some ... strange points | 20:48 | |
RabidGravy | cobol is strange | 20:49 | |
masak | dha: yes, please. | ||
dha | *nod* | ||
brrt | anyway, off for tonight :-) | 20:50 | |
20:51
brrt left
|
|||
skids | dha: Someone else started the control flow, and I added a lot of what's there, but I stopped short of doccing some loops because GLR will change their return value, so examples would have been premature. | 20:51 | |
RabidGravy | (and I'm saying that having not done any cobol since perhaps 1997) | ||
dha | GLR? | ||
skids | Great List Refactor. | ||
(That IS documented :-) | |||
dha | Ah. | ||
PerlJam | S99:GLR | 20:52 | |
dalek | kudo/nom: 6e425fd | lizmat++ | src/Perl6/World.nqp: Be more strict in accepting no args pragma's |
||
dha | Ah. | ||
20:52
synbot6 joined,
davido__ left
|
|||
PerlJam | S99:GLR | 20:52 | |
synbot6 | Link: design.perl6.org/S99.html#GLR | ||
PerlJam | much better | 20:53 | |
dha | Still, while and for loops can be *bascially* documented, surely? | ||
lizmat | while / until I see no problem with | ||
for... not so sure what would be the best at this stage of the game | 20:54 | ||
20:54
davido__ joined
|
|||
skids | They can be docced to some extent, but the return values are a big part of it. | 20:54 | |
dha | If you say so. But, for people coming from p5 at least, something about how C<< -> >> is used in such statements would probably be really helpful. | 20:56 | |
21:02
larion joined
|
|||
dalek | ast: b07221d | lizmat++ | S02-types/WHICH.t: Add X::Adverb::Slice |
21:02 | |
skids | I certainly don't mean to discourage you :-). I'd just keep it to a couple short quick examples knowing the section will be reworked later. | 21:03 | |
Also, BTW, this is one area where the synopsis reads very smoothly. | |||
21:04
muraiki left
|
|||
dha | ok. | 21:07 | |
21:09
skids left
21:12
Possum left
|
|||
RabidGravy | dha, the "pointy block" is the same whether it's used in a for, an if, or an "anonymous sub" so yeah that's fair | 21:12 | |
dha | right, but as a perl 5 programmer wouldn't even know to look for it... | 21:13 | |
Or *when* to look for it, for that matter. | |||
21:16
larion left
|
|||
RabidGravy | Almost all "control structures" it's a pointy block | 21:16 | |
or a block which can be pointy if it makes sense | |||
dha | Well, but you actually *know* that. | ||
masak | maybe it should be mentioned under "control flow"? | 21:17 | |
dha | Not a bad idea. | ||
lizmat goes to catch some sleep (again) | 21:18 | ||
dha | I mean, C<< -> >> is actually documented (and searchable!), but... that's sort of backwards from the perspective I'm coming from. It says "Whenever you see something like { $_ + 42 }, -> $a, $b { $a ** $b }..." | ||
masak | lizmat: 'night | ||
hoelzro | can you return a Str via a char ** in NativeCall? ex. void my_routine(char **return_pointer) { *return_pointer = "foobar" }; my sub my_routine(Str $return-str is rw) is native(...) { * } | 21:19 | |
dha | Whereas, from my perspective I'm thinking "but if I'm actually trying to write code, what am I supposed to do?" for which, looking for C<< -> >> isn't obvious. | ||
masak | also might be good to mention cases where this is actually useful. | 21:20 | |
I've always been fond of `if condition() -> $interesting-truthy-value { ... }` | |||
RabidGravy | yeah | ||
masak | as well as `given computation() -> $bound-result { ... }` | ||
I sometimes do `given open($path) -> $fh { ... }` | 21:21 | ||
dha | This seems, to me, a pretty important aspect of the language, and that it's not easy to find appears a bit problematic. | ||
(not easy to find for a beginner, anyway) | 21:22 | ||
RabidGravy | the for case is the clearest for someone coming to it from p5 though IMO | ||
masak | I don't know about "very important". it's just nicely consistent, and easy to learn to like :> | ||
21:23
AlexDaniel joined
|
|||
masak | in that vein -- but a different construct -- I hope the documentation will speak warmly of the `repeat while my $keep-going { ... }` pattern, which declares a variable before the loop, but evaluates it afterwards. | 21:24 | |
(we discussed it the other day) | |||
21:25
rurban left
|
|||
dha | Well, does C<for my $x qw[1 2 3 4]> still work? If not, and you need to do C<< for 1, 2, 3, 4 -> $x >>, C<< -> >> seems important. | 21:26 | |
dha would check, but is currently rebuilding p6 | 21:27 | ||
RabidGravy | yes the latter | ||
masak | m: for my $x <1 2 3 4> { } | 21:28 | |
camelia | rakudo-moar 6e425f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/C5bGTuW3L3Missing blockat /tmp/C5bGTuW3L3:1------> 3for my $x <17⏏5 2 3 4> { } expecting any of: block or pointy block infix infix stopper» | ||
RabidGravy | always "for @listy-thing -> $v { }" | ||
dha | Right, so IMO, that makes the pointy block pretty darned important... | ||
masak | m: my @list; for my $x (@list) { } | ||
camelia | rakudo-moar 6e425f: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ti2hjcdH4OThis appears to be Perl 5 codeat /tmp/ti2hjcdH4O:1------> 3my @list; for 7⏏5my $x (@list) { }» | ||
masak | 'night, #perl6 | 21:29 | |
RabidGravy | but it's cooler because it will take multiple args to the block | ||
so you can e.g. for %h.kv -> $key, $value { } | |||
21:29
kaare_ left
|
|||
RabidGravy | and so on and so forth | 21:30 | |
dha | Oh, I'm sure it's WAY handy, but that means it would be a lot more useful to have it documented. | 21:31 | |
[Coke] | I am sure everyone is on the same page there. | 21:32 | |
dha | Ok. :-) | 21:34 | |
But is anyone going to do anything about it? ;-) | |||
RabidGravy | yes you are ;-) | ||
dha | Nah, not me. I may wind up explaining it to p5 people, but I'm not taking responsibility for the official explanation. :-) | 21:35 | |
RabidGravy | It's probably only a little tweaking in the docs.perl6.org/language/5to6 | 21:36 | |
in the first instance | |||
dha | Hm. Good point. | ||
My problem with doing that, however, is that, without actual documentation, I'm not sure that I actually understand how it works. | 21:37 | ||
For instance, what happens with C<< for %h.kv -> $a, $b, $c>? | 21:38 | ||
ok, I didn't do the angle brackets right there, but you can see what I'm saying. | |||
RabidGravy | my dumb view of it is that nearly all the blocks of control structures are "anonymous subs" and that the -> introduces the arguments | 21:39 | |
El_Che | pretty much like || in ruby | 21:40 | |
RabidGravy | some of those control structures (such as 'for') may call that "anonymous sub" multiple times with different argumentas | ||
21:40
pullphinger left,
rindolf left
|
|||
dha | Also, it looks like C<< -> >> localizes the, in these examples, C<$a>, C<$b>, etc. variables. Is that actually the case? | 21:43 | |
(I'm not necessarily asking that, but it's an example of the things I don't know well enough to document) | |||
RabidGravy | yes, in the same way as " sub ($a, $b) { } " does | 21:44 | |
which is why, e.g., no "my" | |||
dha | I assume that should be "sub foo ($a, $b)..." ? | ||
21:45
rindolf joined,
kurahaupo left
|
|||
RabidGravy | no, no literally: | 21:46 | |
m: my $f = sub ($c) { say $c }; $f("gg") | |||
camelia | rakudo-moar 6e425f: OUTPUT«gg» | ||
dha | ah. so, essentially, an anonymous sub. | ||
RabidGravy | (you can declare a signature for an anonymous sub) | 21:47 | |
dha | *nod* | ||
RabidGravy | which is (almost) exactly the same as: | ||
m: my $f = -> $c { say $c }; $f("gg") | 21:48 | ||
camelia | rakudo-moar 6e425f: OUTPUT«gg» | ||
RabidGravy | which is a nice one for the obfu fans | ||
dha | huh. ok, see, I can see how that would work, but I wouldn't have thought of it, EVER, and have no idea how I would explain it. | 21:49 | |
This is why I would not feel comfortable writing the documentation for pointy blocks. | |||
RabidGravy | to be honest the docs.perl6.org/language/control#blocks could explain this a bit more clearly | 21:51 | |
dha | That looks like it has the backwards problem from the C<< -> >> documentation. | 21:52 | |
C<< -> >> starts talking about Blocks without pointiness, and this talks about Blocks, but leaves out pointiness entirely. | 21:53 | ||
RabidGravy | yep | ||
21:53
nys left
|
|||
RabidGravy | need more stupid people who have to explain things to normal people sometimes to work on the documentation ;-) | 21:54 | |
dha | Like me? :-) | 21:55 | |
21:55
rindolf left
22:01
rindolf joined
22:05
nys joined
|
|||
RabidGravy | dha, you worry too much so you can't be stupid enough ;-) | 22:06 | |
dha | Clearly. | 22:07 | |
virtualsue | o/ dha | 22:09 | |
dha waves | |||
virtualsue | and \o RabidGravy | ||
RabidGravy | :-* | ||
22:10
zoosha left
|
|||
RabidGravy | I may take a poke at that control document in the morning as some light relief from these modules I'm doing | 22:11 | |
22:11
zoosha joined
|
|||
RabidGravy | anyway I'm *not* going to watch Jaws 2 for the umpteenth time so I think I'll crash | 22:13 | |
toodlepip #perl6 | |||
22:19
RabidGravy left
22:21
dha left
22:22
dha joined,
bin_005 left
22:33
davido__ left
22:34
davido__ joined,
bjz left
22:35
spider-mario left
|
|||
labster | m: DateTime.new(year=> 2015, seconds => -86500).say | 22:36 | |
camelia | rakudo-moar 6e425f: OUTPUT«2015-01-01T00:00:00Z» | ||
TimToady | I used to write '0 while stuff()', but that bothered people somehow more than '1 while stuff()' | 22:37 | |
labster | m: DateTime.new(year=> 2015, seconds => 86500).say | ||
camelia | rakudo-moar 6e425f: OUTPUT«2015-01-01T00:00:00Z» | ||
TimToady | these days, I'd probably write 'Nil while stuff()' | ||
labster | m: DateTime.new(year=> 2015, second => -86500).say | ||
camelia | rakudo-moar 6e425f: OUTPUT«second out of range. Is: -86500, should be in 0..^62 in block <unit> at /tmp/CvFHToW68F:1» | ||
labster | 62 is kinda LTA there, but otherwise good. | 22:38 | |
TimToady | yeah, should really say 0..61 I suspect | 22:40 | |
labster | yeah, it looks good in the source code, with 0..^24 and 0..^60 above it... but 62 looks magical here. | ||
TimToady | arguably it's 0..^61 because of leap seconds, but maybe the idea is that the earth could take a major wobble at some point and need 2 leap seconds at once | 22:41 | |
geekosaur | yes | ||
2 leap seconds are allowed for in the spec | 22:42 | ||
TimToady I'd rather see them abolish leap soconds and do a major correction every century or so | |||
labster | And never do them at all in UTC. | ||
TimToady | well, you need them eventually, but only when the delay gets up around half a timezone | 22:43 | |
so they should probably solve it with leap hours someday | |||
scheduled well in advance | |||
labster | i.e. some future programmer's problem. | 22:45 | |
TimToady | ayup | ||
vendethiel | *g* | ||
.oO( but perl6 is supposed to still be around then! ) |
|||
dha | Never do today what you can put off until the next century. | ||
TimToady | when timezones have a slop of 15°, there's no reason to keep civil time so close to astronomical | ||
labster | Perl 6 will build up temporal debt | ||
[Coke] | by that point, we'll all be going off earth central time and won't care about matching midnight to a longitude. | ||
labster | I think they already have that in the central kingdom^W^W PRC. | 22:47 | |
22:48
espadrine_ left
22:50
AlexDaniel left
22:54
TEttinger joined
22:55
skids joined
22:56
cognominal left
22:59
cognominal joined
23:02
virtualsue left
23:05
leont joined
23:08
amurf joined
|
|||
dalek | kudo-star-daily: 7610cde | coke++ | log/ (9 files): today (automated commit) |
23:09 | |
rl6-roast-data: 7142afa | coke++ | / (9 files): today (automated commit) |
|||
23:18
telex left
23:20
telex joined
|
|||
dalek | c: c33d70b | (David H. Adler)++ | WANTED: Added C<srand> and C<state> to WANTED |
23:22 | |
c: eef0e62 | (David H. Adler)++ | lib/Language/regexes.pod: Added language to specify the default values for C<:c> |
|||
23:30
beastd left
23:32
atroxaper joined
23:40
atroxaper left
23:51
rindolf left
23:53
dha left
23:58
spollei joined
|