»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
lizmat advent post preview: perl6advent.wordpress.com/2014/12/1...ew_id=2695 00:08
brrt 404 file not found :-) 00:27
brrt afk
but will note in passing that freezing water is a ridiculously energy-intensive activity
the energy it takes to freeze water (or melt it) is equal to the energy it takes to heat water from-160C to 0C 00:28
TimToady lizmat: you might mention in your conclusion that we'll soon have quote macros so you can define your own quotes in place of the alphabet soup 00:43
they are, after all, just slangs
lizmat will do
TimToady: if you reload the preview, there should be a mention of it 00:48
using a quote from the Synopsis
TimToady I think you lost a <...> after quote: 00:50
lizmat ah, yes :-)
TimToady not that we'll necessarily end up with that macro syntax, but it's suggestive anyway 00:51
lizmat fixed
and published: perl6advent.wordpress.com/2014/12/...-steroids/ 00:54
will look at any further comments tomorrow 00:55
first I need some sleep
so good night, #perl6!
TimToady schlop schön 00:56
vendethiel nice :)! 01:33
lizmat++ 01:34
dalek ast: ac5776a | (Jimmy Zhuo)++ | S02-magicals/env.t:
Fixed a %*ENV test.

This test fails sometimes because .gist does .sort action, and it ignores some infos when $*ENV has 100+ keys. Change the key to upper-case to make sure which we want is not at the end.
02:26
ugexe m: use Test; plan 3; ok 1; module X { use Test; plan 1; ok 1; }; import X; ok 1; # should plan() fail/warn when getting called a second time? 04:59
camelia rakudo-moar d6d08d: OUTPUT«1..3␤ok 1 - ␤1..1␤ok 2 - ␤ok 3 - ␤# Looks like you planned 1 tests, but ran 3␤»
ugexe im trying to write a unit test for a role that does shell("prove t/passing_test.t"), which is how i ran into conflicting plan count 05:01
[Coke] I'm sure p5 has a perfectly good answer to that question we can steal. 05:39
ugexe Test::More aborts with the message "You tried to plan twice" 05:43
JimmyZ we have sub test 05:51
it's in Test.pm
ugexe i was pointing out how p5 currently handles it 05:52
ugexe i didnt know if its that way for tap::harness to parse, or if i could augment plan and try to get around it 06:05
ugexe ohhh you mean s/sub test/subtest/ 06:08
JimmyZ++
JimmyZ yeah 06:09
[Coke] you could easily add a state variable to plan that barfs if it's already set. 06:19
FWIW, I'm fine with that.
bartolin my automatic builds of parrot and jvm failed this night: gist.github.com/usev6/7dd0d087f0b780b2e756 06:28
(with Null PM access and NullPointerException, respectively)
TimToady yes, the FALLBACK patch seems to kill both the non-moar builds 07:27
brrt gjs must be the most crash-prone interpreter ever 08:01
moritz brrt: you don't know early-days rakudo or pugs :-) 08:05
brrt that is true :-) 08:06
on the other hand, gjs is supposedly production ready
moritz Null PMC Access -- 'nough said
nwc10 clean perl6-m build passes on "my" machine 08:14
rurban_ parrot-6.11.0 released, 15-25% faster. www.parrot.org/ 08:29
brrt darn, not having param_rp_i stings for the jit :-( 08:32
woolfy rurban++ 08:34
moritz rurban_: what makes it so much faster? 08:37
brrt rurban++ :-) 08:38
rurban_ the nqp/qrpa idea for resizablepmcarray. move an offset on shift 08:57
plus some additional rpa optimizations 08:58
github.com/parrot/parrot/issues/1152
mathw morning 09:01
moritz rurban_: rakudo setting compilation on parrot master fails with "Null PMC access in get_bool()" here 09:06
moritz and iiuc, rakudo won't benefit much from the performance improvement, because it already uses qrpa. Right? 09:13
rurban_ nope. it was much faster with rakudo also 09:14
moritz ok, cool 09:15
now if it'd only compile...
rurban_ I still have to rewrite nqp to get rid of qrpa, I'm not good with nqp.
Mostly to add threads support for nqp-p
But currently I'm too busy with a type inferencer for p2 09:16
arnsholt The .WHAT of a type object is just the type object itself, no? 09:37
moritz arnsholt: yes 09:41
m: say Int.WHAT === Int 09:42
camelia rakudo-moar d6d08d: OUTPUT«True␤»
brrt ok, there is clearly a large difference between for ^40 -> int $x { func($x) } and func($_) for ^40 10:05
in simpler terms, the latter form can't strength-reduce $_ to a native int even if that is it's only use 10:06
also, i find this somewhat confusing, could someone explain: 10:10
m: sub foo(int $n) { my int $i = 1; while $n-- { $i *= 2 }; }; say foo(4);
camelia rakudo-moar d6d08d: OUTPUT«Cannot assign to an immutable value␤ in sub postfix:<--> at src/gen/m-CORE.setting:4951␤ in sub foo at /tmp/b6xTqbOFKH:1␤ in block <unit> at /tmp/b6xTqbOFKH:1␤␤»
mathw you're trying to change an immutable value, so... 10:11
brrt well, why is a native int immutable
mathw because all subroutine parameters are immutable by default 10:12
IIRC
brrt hmmm
m: sub foo(int $n is copy) { my int $i = 1; while $n-- { $i *= 2; }; }; say foo(4);
camelia rakudo-moar d6d08d: OUTPUT«Cannot assign to an immutable value␤ in sub postfix:<--> at src/gen/m-CORE.setting:4951␤ in sub foo at /tmp/r5VaxGNOgL:1␤ in block <unit> at /tmp/r5VaxGNOgL:1␤␤»
brrt m: sub foo (int $n is rw) { my int $i; while $n-- > 0 { $i = $i * 2; }; $i; }; say foo(4); 10:14
camelia rakudo-moar d6d08d: OUTPUT«Cannot assign to an immutable value␤ in sub postfix:<--> at src/gen/m-CORE.setting:4951␤ in sub foo at /tmp/esJiHc3IKO:1␤ in block <unit> at /tmp/esJiHc3IKO:1␤␤»
mathw okay that I don't understand 10:15
Hopefully someone more knowledgeable can explain it
brrt neither do i :-)
mathw maybe it's a bug!
moritz brrt: -- and ++ on native types are NYI 10:17
brrt oh
moarvm has support for them
mathw moritz++ 10:19
brrt anyway, i'll work arround that then 10:21
masak good antenoon, #perl6 10:23
m: say 42.WHAT === Int
camelia rakudo-moar d6d08d: OUTPUT«True␤»
masak oh, arnsholt++'s question was about the .WHAT of a type object. my bad. 10:24
brrt say 42.WHAT.WHAT
m: say 42.WHAT.WHAT;
camelia rakudo-moar d6d08d: OUTPUT«(Int)␤»
masak yes, that falls out of the type object trying to blend in among the instance objects.
arnsholt Yeah, that was my intuition. Just wasn't quite ready to trust that intuition =) 10:29
mathw hi masak 10:37
masak mathw: happy flashlight season, mathw. 10:44
mathw :) 10:46
vendethiel o/, #perl 11:09
6.
nwc10 \o vendethiel
masak hi vendethiel, 6.
vendethiel "6 Erroneous Nickname" 11:10
jnthn "5 Typo'd greetings" 11:11
...
"And a Christmas on IRC"
masak .oO( FIIIIIVE TYPO'D GREETINGS! )
jnthn will look at the build bustage he induced after teaching
nwc10 4 frequent questions
jnthn & 11:12
masak 3 french puns
nwc10 3 embarssing mischans
2 asks to ask
aha, masak's is better
masak :)
dalek : ffdf2fc | lizmat++ | misc/perl6advent-2014/schedule:
Move 3rd advent post to 22nd

I just realised that I will be doing the release on the 18th, which would probably not coincide well with writing an advent post.
jnthn
.oO( I'm glad oui agree )
jnthn is tempted to stay for the pun fest, but really should go teach :)
masak go, you English... kniggit! 11:13
lizmat
.oO( is it time to start a CPUN site ? )
masak CPUN6, surely. 11:13
vendethiel okay, that's a lot of message for misstyping an "enter" instead of a "shift" :) 11:14
lizmat PSA: there is no one for tomorrow's advent post yet 11:14
This is Your Chance™ 11:15
lizmat
.oO( I wonder what a Miss Typing Contest would look like )
11:15
lizmat Another PSA: on Thursday I will be doing the 2014.12 release of Rakudo 11:19
Suggestions for release names are welcome
I'm playing with "Berlin" (next years QA hackathon) or "Dresden" (next years GPW) 11:20
but both seem a bit premature
masak CostaRica! \o/
Brisbane! 11:21
blackbolt hi, can some tell me how to do "default file path". i want to do : say "enter the path to the file"; [read] [if path == '' .........]
masak Kampala!
blackbolt: your question was not very specific. are you looking for `prompt`? 11:22
blackbolt: what is the condition on $path you want to test, exactly?
blackbolt i don;t know. i want to read path to file. when path to file will be empty, i want to rewrite to default path 11:23
masak ok. `my $path = prompt "Enter path: "; if $path eq "" { $path = $DEFAULT }; my $contents = slurp($path);` 11:24
lizmat $path // 'default_path' ??
masak lizmat: doesn't work if the input is an empty string.
lizmat $path || 'default_path' ?? 11:25
masak yeah.
lizmat yeah, I know, '0' :-)
masak m: say "0" || "default"
camelia rakudo-moar d6d08d: OUTPUT«default␤»
masak apparently.
that feels like a p5 holdover to me, tbh.
lizmat ah,.... a P5 trap that we don't have in P6 anymore 11:26
yup
thanks to typing
afk for a bit&
masak waitwait, don't have anymore? the above eval shows we have it.
blackbolt masak: your code help me, thanks 11:27
masak blackbolt: pleased to be of service.
lue masak: come to think of it, if someone wants to treat "0" as false-y, they're perfectly capable of typing +"0" to get it :) . (Also, if you want "0" to act False, you probably are already coercing to numeric somewhere) 11:35
vendethiel masak: and of course, the fun one is this one
m: say "0" || "0.0" || "default"
camelia rakudo-moar d6d08d: OUTPUT«0.0␤»
masak m: say "0" | "0e1" | "default" 11:36
camelia rakudo-moar d6d08d: OUTPUT«any(0, 0e1, default)␤»
masak m: say "0" || "0e1" || "default"
camelia rakudo-moar d6d08d: OUTPUT«0e1␤»
masak m: say "0" || "0i" || "default"
camelia rakudo-moar d6d08d: OUTPUT«0i␤»
masak m: say "0" || "0/1" || "default"
camelia rakudo-moar d6d08d: OUTPUT«0/1␤»
moritz only the strings '' and '0' are False in boolean context 11:38
masak yes, clearly.
moritz m: say .perl, ' ', .so for '', '0', ' ', '0e0', '0.0' 11:39
camelia rakudo-moar d6d08d: OUTPUT«"" False␤"0" False␤" " True␤"0e0" True␤"0.0" True␤»
moritz m: say so 'False'
camelia rakudo-moar d6d08d: OUTPUT«True␤»
masak the question is why "0" gets a free entry there, when we've successfully managed the string/number dichotomy in all other places.
it feels to me like the last place of deliberate confusion.
lue just went along with it when she first heard about "0" == False, though it's never seemed all that useful/helpful. 11:41
masak yeah, I'm wondering about the use case for it. 11:42
moritz mostly places where people (or the system[tm]) forgot to coerce to Numeric 11:42
masak nowadays my mental model for these things is "all monoidal types have one zero element". 11:43
lue moritz: shouldn't it work the same for "0e1" and such too, then?
moritz lue: integers are much more common in most type of programs
masak m: say ?"000"
camelia rakudo-moar d6d08d: OUTPUT«True␤»
masak moritz: I would say, if you forgot to coerce to numeric and rely on "0" boolifying to False, then you have a deeper problem that "0" boolifying to False only postpones. 11:44
now, of course, you might be lucky and it's postponed *forever*.
moritz masak: unless all the other coercions save you 11:45
masak but what if your records have a "000", like above?
I'd rather it "fail fast" for you, flushing out the problem early.
moritz then it's a rather atypical number representation
masak I know Perl is all about helpfully guessing your intent, but this one feels like it's shooting both theory and practice in the foot. 11:46
moritz fwiw I don't particularly care about '0' boolification right now, just trying to argue both ways
lue "000" isn't really atypical, though; haven't you ever zero-padded zero-indexed numbers in your file names? :P 11:46
moritz lue: yes, but then the file is called foobar-000.txt, not 000
lue: so you have an extra step where you extract something, which makes it easier to remember to coerce to Int, should you chose to do arithmetics with it 11:47
lue Which leaves the question of when you expect your strings to be pure numbers, but still need "0" == False in case you forget to coerce said strings to a numeric type. 11:48
lue afk 11:51
blackbolt Again need help, 'Commands out of sync; you can't run this command now 20:06in method execute at lib/DBDish/mysql.pm6:170' 12:45
moritz blackbolt: what did you do? 12:46
dev.mysql.com/doc/refman/5.0/en/com...-sync.html 12:47
masak sounds like you should post a gist of your program, so we can help you better.
FROGGS I had that too and decided to switch to postgres
moritz maybe you need to .finish before executing the next statements 12:47
FROGGS++ # good man!
FROGGS :o)
masak sounds plausible.
blackbolt moritz: trying to write simple application "phone book". when i do secend time "add new person", i see that problem
moritz blackbolt: show the code please 12:48
blackbolt just pls.... don;t cry when you see that 12:49
Commands out of sync; you can't run this command now 20:06in method execute at lib/DBDish/mysql.pm6:170
ohhh my foult
moritz blackbolt: and paste your code into a nopaste service (like gist.github.com), not into the channel 12:50
blackbolt gist.github.com/anonymous/32bde3081e96e6a0fbac 12:51
vm share clipboard didin;t worked 12:52
moritz blackbolt: this code calls .execute at most once 12:53
brrt \o 12:53
lizmat++ for todays perl6advent
by the way
lizmat yes?
moritz blackbolt: anyway, try $sth.finish() after $sth.fetchrow_arrayref
brrt is Q any relation to Q? www.startrek.com/legacy_media/image...20x240.jpg 12:53
:-P 12:54
after all, it is nearly omnipotent
moritz omnipotent quoting, right
FROGGS ohh, I've got a daja Q 12:54
deja*
lizmat My first association was more: en.wikipedia.org/wiki/Q_(James_Bond) 12:55
blackbolt moritz: it helped, thank you
lizmat Q: "Always have an escape plan"
FROGGS *g* 12:56
andreoss is there perl6ish way to rotate @x[N][N] in 90 degrees? 13:22
masak zip() 13:23
andreoss zip flattens 13:26
it could be done by for loop, by isn't there nicer way? 13:27
moritz m: my @a = [<a b c>], [<d e f>], [<g h i>]; say ([zip] @a).perl 13:28
camelia rakudo-moar d6d08d: OUTPUT«===SORRY!=== Error while compiling /tmp/k0Zs4DKvJx␤Two terms in a row␤at /tmp/k0Zs4DKvJx:1␤------> b c>], [<d e f>], [<g h i>]; say ([zip] ⏏@a).perl␤ expecting any of:␤ postfix␤ infix stop…»
moritz m: my @a = [<a b c>], [<d e f>], [<g h i>]; say ([Z] @a).perl 13:29
camelia rakudo-moar d6d08d: OUTPUT«((["a", "b", "c"],), (["d", "e", "f"],), (["g", "h", "i"],)).list␤»
moritz m: my @a = [<a b c>], [<d e f>], [<g h i>]; say zip(@a).perl
camelia rakudo-moar d6d08d: OUTPUT«((["a", "b", "c"],), (["d", "e", "f"],), (["g", "h", "i"],)).list␤»
moritz m: my @a = [<a b c>], [<d e f>], [<g h i>]; say zip(@a.map: *.list).perl
camelia rakudo-moar d6d08d: OUTPUT«(("a",), ("b",), ("c",), ("d",), ("e",), ("f",), ("g",), ("h",), ("i",)).list␤»
moritz huh. 13:30
m: my @a = [<a b c>], [<d e f>], [<g h i>]; say (@a.map: *.list).perl
camelia rakudo-moar d6d08d: OUTPUT«("a", "b", "c", "d", "e", "f", "g", "h", "i").list␤»
moritz yes, that's already too flat
lizmat jnthn: looked at parrot breakage, seems to break in: self.find_method($obj, 'FALLBACK', :no_fallback) 13:31
masak m: say zip(1,2,3;4,5,6;7,8,9).perl 13:33
camelia rakudo-moar d6d08d: OUTPUT«((1, 4, 7), (2, 5, 8), (3, 6, 9)).list␤»
masak the structure is in there; surely it's also possible to iterate it?
m: say zip(1,2,3;4,5,6;7,8,9).tree.perl
camelia rakudo-moar d6d08d: OUTPUT«(1, 4, 7; 2, 5, 8; 3, 6, 9).item␤»
masak m: say .perl for zip(1,2,3;4,5,6;7,8,9).tree.list 13:33
camelia rakudo-moar d6d08d: OUTPUT«(1; 4; 7).item␤(2; 5; 8).item␤(3; 6; 9).item␤»
masak \o/
but I must confess that these primitives don't feel natural to me at all. 13:34
moritz but why are they semicolon-separated now?
and how do I get from an array of arrays to the semicolon-separate form?
masak whether that's due to the primitives themselves, or to my inexperience with them, I don't know.
moritz both, I'd guess :-)
masak anyway, zip() definitely *should* be up to this task. that's what zip() *is*, a matrix transpose. 13:35
masak writes an advent blog post draft 13:35
lizmat ++masak 13:38
moritz masak: maybe claim a day (preferrably tomorrow :-) in the schedule? 13:50
masak sure, as soon as I have a goodenuf draft.
in the meanwhile, please continue as if we don't have a poster for tomorrow :)
moritz sadly for me that means continuing with $dayjob 13:52
dalek rakudo/newio: 5a06ace | TimToady++ | src/ (7 files): 13:54
rakudo/newio: allow $x ~~ s/// to return Match or list of Match
rakudo/newio:
rakudo/newio: s/// is now implemented in terms of .subst-mutate, which returns
rakudo/newio: the matches instead of the result, just as normal matching does.
andreoss how do i stop .grep or .map from flattening? 13:59
lizmat isn't that one of the areas that the GLR would fix? 14:01
grep() would flatten, .grep would not ?
lizmat .tell jnthn looks like github.com/rakudo/rakudo/commit/17...01ec881446 unbreaks parrot and jvm 14:04
yoleaux lizmat: I'll pass your message to jnthn.
masak anyone have a link to Pugs' planned version milestones? 14:17
lizmat is now trying parrot 6.11 14:21
lizmat I'm seeing several hangs in the spectest on parrot with 6.11.0, so definitely not an upgrade we can do out of the box :-( 14:47
rurban_ lizmat: regressions from 6.10.0? 14:57
I rather think it's the new nqp code which causes breakage 14:58
masak ok, I have my blog post draft. gist.github.com/masak/07e6d5ce3848d36161c4 15:06
not quite sure what to make of it.
comments welcome.
lizmat rurban_: before upgrading to 6.11.0, I ran a clean spectest with HEAD on parrot 15:10
PerlJam masak: "program elements" reads like "DOM for Perl" to me. 15:11
masak yep. 15:13
masak inserts that quote
lizmat gist.github.com/lizmat/dd0f88e6042e7c4ce011 15:15
PerlJam masak: btw, you say "Perl 6 has three strange loops", but one of them was "just discovered" ... maybe there are more strange loops yet to be discovered :)
lizmat ^^ test failures with parrot 6.11.0: gist.github.com/lizmat/dd0f88e6042e7c4ce011
masak PerlJam: in some sense, it's a matter of perspective.
PerlJam: the C compilers we use to compile the C code in Moar and Parrot have been bootstrapped. 15:16
(for example)
ugexe reminds me of the ken thompson hack 15:17
masak aye. that's strange loop + folding things in to hide them.
lizmat rurban: all the test failures checked so far end in: Can not get attribute '$!storage' declared in class 'Parcel' with this object 15:18
which is somewhere inside reification 15:19
lizmat commute to NR.pm meeting 15:20
dalek : b828ed3 | masak++ | misc/perl6advent-2014/schedule:
[advent-2014/schedule] claim tomorrow
15:28
masak my post is a little bit abstract. I'm not sure how to fix that. 15:29
when possible, I give examples of actual extensions.
PerlJam masak: IMHO, don't fiddle with it too much. Leave it abstract. 15:37
masak ok :)
then I will. hopefully it will appeal to lovers of the abstract like me :>
masak walk & 15:43
pyrimidine jnthn_++ # OS X work 15:44
masak: I recall seeing those on some of audreyt's slides at some point. Maybe SlideShare? 15:45
masak: that would be re: pugs
timotimo cool, parrot's ResizablePMCArray is now faster than nqp's QRPA? 17:08
can we steal something from there to put into moarvm as well?
dalek rl6-roast-data: 9aee273 | coke++ | / (5 files):
today (automated commit)
17:12
[Coke] this may be of interest: news.sciencemag.org/social-sciences...ages-speak 17:13
masak pyrimidine: I tried hunting it down by looking at the Pugs.hs repository on github. didn't find it. 17:14
oh! found it: www.athenalab.com/Perl_6_Users_FAQ....status_=== 17:15
just need to know what to search for ;)
ok, so v6.283185 seems to be what I was looking for.
I might add that to the post.
blackbolt timotimo ? 17:17
timotimo hey there
i'm very short on time these days, sorry 17:18
but gtk-simple is inside the perl6 namespace for a good reason: almost anyone in here can contribute
blackbolt can you look on problem with close "secend level" window?
timotimo i may have lost a bit of backscroll in our query 17:19
the deprecation warning should be gone in the current version
would you like to learn how to implement it yourself? :P 17:20
blackbolt no :D
timotimo i think all you need to do is implement a binding for gtk_widget_hide, which is almost exactly the same as gtk_widget_show, but the name is different
then copy the method "show" in GTK::Window to create a "hide" method
and use that gtk_widget_hide function
i gotta go now
blackbolt ok
thanks 17:21
timotimo developer.gnome.org/gtk3/stable/Gt...idget-hide - this is the documentation i always use to find new stuff to bind and expose
jnthn gimme my messages, slave! 17:23
yoleaux 14:04Z <lizmat> jnthn: looks like github.com/rakudo/rakudo/commit/17...01ec881446 unbreaks parrot and jvm
jnthn lizmat++
Looks good to me.
timotimo: MoarVM already has the QRPA goodness and then some, afaik. 17:24
else hey, anyone know what ":D" means in perl6? 17:26
tadzik defined argument
:U is undefined
else does that mean it's required, or...? 17:27
lizmat required for matching
tadzik it's still required
lizmat m: multi sub a(Int:U $a) { say "int" }; multi sub a(Int:D $a) { say $a }; a(Int); a(42) 17:28
camelia rakudo-moar 1785ea: OUTPUT«int␤42␤»
else Int is a value? 17:29
jnthn Int is a type, but types are values in Perl 6 also 17:30
:D means "only instance of the type", :U means "only the type" 17:31
else is that code the p6-idiomatic way of sub { say (defined($_[0]) and $_[0] or "int") }?
i see
jnthn It's used quite heavily in the internals. A bit less so in typical user code. 17:32
Or much less so, is perhaps fair.
else yeah, i'm looking at internals 17:33
is there a place in the synopses where it's documented?
jnthn It'll be in S12 somewhere
PerlJam else: S12:1630 or so 17:34
synopsebot Link: perlcabal.org/syn/S12.html#line_1630
else thanks guys
[Coke] .seen ingy 17:44
yoleaux I saw ingy 12 Nov 2014 18:28Z in #perl6: <ingy> there was a bit of dissent but I think I've worked through it with everyone.
andreoss say ([<a b>; <c d>]).map(*.reverse).reduce: * ~ *; # works 17:48
say ([<a b>; <c d>]).map(*.reverse).reduce: * Z *; # doesnt work
why?
m: say ([<a b>; <c d>]).map(*.reverse).reduce: * Z *;
camelia rakudo-moar 1785ea: OUTPUT«Type check failed in binding &with; expected 'Callable' but got 'List'␤ in method reduce at src/gen/m-CORE.setting:9262␤ in block <unit> at /tmp/hpnExaI3Fp:1␤␤»
jnthn .tell andreoss well, the immediate reason is that Z appears not to be one of the operators that whatever-curries. 19:06
yoleaux jnthn: I'll pass your message to andreoss.
jnthn dinner & 19:07
nige hi 19:14
masak++ enjoyed your strange loop draft 19:15
some interesting ideas there
nige it's been a while since I read Hofstadter's I'm a strange loop - but there is an interesting example of a strange loop - when you stand between two mirrors 19:18
then suddenly they go recursive and infinite
as the mirrors reflect each other 19:19
just wanted to throw that little meme on the fire ;-) 19:20
moritz \o 19:50
does anybody know a Chris Collins (in the context of Perl 6)? 19:51
masak nige: thanks. 20:00
nige np 20:01
was wondering it 'time' could be another category of strange loop that Perl6 is closing in on :-) 20:02
s/it/if/g
masak how do you mean? 20:07
unfortunately, Rakudo does not implement a time machine.
nige :-) 20:09
the PHASERS are a way of declaring what happens in time 20:10
masak oh, that is true.
nige and then there's promises as far as the FUTURE is concerned
masak but it's hard to make an argument that Perl 6 is built from phasers. 20:11
whereas it *is* built from grammars, OO, and program elements.
vendethiel
.oO( or is it )
they're just in a phase you can't see
itz_ grrr I broke pl6anet.org (freebsd-update went wrong) trying to fix
moritz itz_: want to run it on www.p6c.org? 20:12
nige is there a time-based aspect to macros? 20:15
masak well, I guess you can put phasers in a macro. 20:16
haven't really thought about it enough...
I can see CHECK or INIT phasers being quite attractive to have there.
itz_ moritz: I've just got a console password so I may be able to repair
masak and perhaps injecting PRE and POST phasers as well. 20:17
itz_ moritz: I probably should put a backup of the setup on p6c anyway 20:17
nige so a macro could manipulate time ...
moritz itz_: what do you need for that? 20:19
ninjazach This is the appropriate place for rakudo discussion correct? 20:23
masak correct.
masak .oO( or, channeling pm, "NO!" ) :P
ninjazach thank you :) 20:24
masak anything in particular on your mind?
itz_ ah a console reboot fixed it
moritz: it's just a cron job using perlanet (CPAN etc) writing flat files 20:25
I need to put the config on github really 20:26
moritz itz_: if you do that (and a small README telling me which modules to use), I'll set up a mirror 20:26
ninjazach I figure that I use perl quite often. It will be a good idea to track perl6 development. I just plan on idling and participate once in a while. 20:27
PerlJam ninjazach: oh, it's best to play quite a bit too :)
itz_ moritz: sure I'll do that in the next few mins and send details
moritz ++itz_ 20:28
and itz_++ for running it in the first place :-)
ingy [Coke]: what's up?
[Coke] ingy: needed IRC ops someplace, but we're covered now. Thanks. 20:28
masak ninjazach: writing small scripts for yourself is a great way to get involved.
ninjazach: and using the camelia bot is a great way to ask specific questions.
ingy [Coke]: ah yeah. saw in #parrot just now
PerlJam ingy: were you idling on #perl earlier? 20:29
ingy: There was a guy having trouble with some XS problem and he ended up using Inline::C to solve it. ... <hesperos> now just need to get myself a t-shirt: "Love Inline::C" 20:31
masak aww :) 20:32
ingy :) 20:33
Now he can use Inline::Module to put it on CPAN
TPF++
[Coke] ingy++ 20:45
keep up the good work!
itz_ moritz: github.com/stmuk/pl6anet.org 21:02
masak nige: here. :) 21:09
nige ok
masak m: macro foo { say "2"; quasi { say "4" } }; BEGIN { say "1" }; foo; BEGIN { say "3" } 21:10
camelia rakudo-moar 1785ea: OUTPUT«1␤2␤3␤4␤»
masak nige: look at the above; it should tell you a bit about the timing of macros :)
nige: feel free to ask follow-up questions.
nige ok sec 21:11
nige need another after dinner mint ;-) 21:11
nige not sure what the quasi does? - I assume it install say "4" wherever foo is called? 21:13
masak yes, exactly.
lizmat m: my $a = "aa"; say --$a # should say "z" I think, instead of fail 21:14
camelia rakudo-moar 1785ea: OUTPUT«Decrement out of range␤ in method gist at src/gen/m-CORE.setting:13843␤ in sub say at src/gen/m-CORE.setting:16601␤ in block <unit> at /tmp/l6bTpFDAJN:1␤␤»
masak each call to `foo;` eventually gets physically replaced by the quasi block.
nige ok - cool
masak so if you could pause and look at the program before it starts running, you'd see the inserted quasi block.
lizmat m: my $a = "z"; say ++$a # the other way works
camelia rakudo-moar 1785ea: OUTPUT«aa␤»
masak m: macro foo { say "2"; quasi { say "5" } }; BEGIN { say "1" }; say "4"; foo; BEGIN { say "3" }
camelia rakudo-moar 1785ea: OUTPUT«1␤2␤3␤4␤5␤»
masak actually, that's more illustrative still.
so, BEGIN (1, 3) runs at compile time. macros (2) too. the rest of the code (4, 5) runs at runtime. 21:15
vendethiel ponders
masak: hehehe. BEGIN time being part of the language is really cool. I impress lots of people by telling them this works:
nige needs 2 after dinner mints 21:16
vendethiel m: role Foo[Str $s] { method x { $s } }; sub do-uc($s) { $s.uc }; say Foo[do-uc("Hey")].x;
camelia rakudo-moar 1785ea: OUTPUT«HEY␤»
masak yeah, BEGIN time is pretty cool. 21:17
vendethiel masak: "lol, dependently-typed stuff is so 1990"
bartolin lizmat: I seem to remember some discussion about this behaviour. the conclusion was (IIRC) that decrements which reduce the number of characters would be ambiguous. I'll try to find a link ... 21:18
bartolin lizmat: probably this discussion: irclog.perlgeek.de/perl6/2013-05-30#i_7133188 21:21
nige thanks masak - interesting - I didn't expect BEGIN to fire before the macro
are there any other phasers that fire before macro?
vendethiel nige: no - macros *ARE* begin blocks. 21:22
masak both BEGIN and macro calls fire ASAP.
vendethiel: they're not actually BEGIN blocks, but they fire just as soon.
vendethiel nige: if BEGIN blocks were called *BEFORE* macros, the "3" in masak's example would get echo'd before 2
nige ah ok - so execution order is the point here
vendethiel masak: yeah, i'm oversimplifying
masak think of the execution time of BEGIN blocks and macro invocation as "when the parser passes over them".
because that is indeed when it happens. 21:23
masak for BEGIN blocks, the parser needs to see the '}', then it lets the runtime run the block. 21:23
for macro calls, the parser needs to read up until the last macro argument.
both BEGIN blocks and macro calls are a way to interleave user code in the middle of parsing.
but macro calls also (optionally) leave a quasi block in the actual code, replacing the macro call itself. 21:24
nige hmm - thanks for the example I just put the macro at the end and got: 1 3 4 2 21:27
which I take to mean the quasi didn't get installed
as the lexical scope passed in time
masak yeah; that's supposed to be illegal.
it can't call the macro at parse time if it hasn't seen it. 21:28
I filed an RT ticket about that the other week.
Post scheduled for: Dec 17, 2014 @ 0:01 -- loopy post scheduled for tomorrow
masak ah, here: rt.perl.org/Ticket/Display.html?id=123419 21:29
nige: right now, what happens is the parser goes "oh, `foo;`, that's probably an post-declared subroutine. well, that's fine."
nige thinks about the temporal aspects of macros ... and strange loops
ok 21:30
masak except it isn't fine. compiler's supposed to go bananas when it realized that was a *macro* and it missed calling it 'cus it was post-declared!
so we have to install a CHECK-time error for that.
nige ok
masak (so pretend you got an error when putting the macro last) :P 21:31
nige ok ;-)
although I wonder if the temporal aspects of macros should be PHASERED?
masak in a sense, they already are. 21:32
nige MACRO { }
masak as vendethiel pointed out, macros fire at BEGIN time.
nige missed that ... sec ... wonders why not before? 21:33
masak there is no before :)
BEGIN time is the earliest there is.
before that, the parser hasn't *seen* your code.
timotimo it'd be weird to have MACRO { ... } because it gets invoked when the parser sees the invocation of the macro, not its definition
masak yeah, I didn't get the idea of a MACRO phaser. 21:34
still sounds to me like it emanates from a misunderstanding of something. 21:35
nige yes probably
masak but that's fine :)
let me see if I can dig up a blog post where I explain all this.
timotimo misunderstandings lead to unexpected questions which lead to exploring stuff that you may have taken for granted so far
nige just trying to learn why BEGIN and macro are interleaved 21:36
timotimo macros and BEGIN blocks fire at the same time, but BEGIN blocks "turn into" the value you've calculated inside whereas macros "turn into" the code you've created as result of running the macro 21:37
masak nige: because both fire as soon as they're parsed. 21:38
nige: think of two "cursors" running across your code. first the parser, and then the runtime.
timotimo masak: a BEGIN block could be implemented using a macro, right?
masak nige: BEGIN blocks and macro invocations fire as soon as the first, parser, cursor finds them. 21:39
timotimo: yes, provided there was a mechanism to eval AST arguments.
timotimo like macro BEGIN($a_block) { my $result = $a_block(); quasi { {{{ $result }}} } } OSLT
i hope that example/idea helps rather than hinders 21:40
masak yes, modulo that call, because $a_block contains an AST, not a callable.
but yeah, that's a good approximation, except for that.
timotimo right, fair enough
japhb Just looked at the Rakudo git logs ... does anyone around know why 1785eaf676fca9159a79f33467ede801ec881446 was necessary? (What are r-p and r-j handling incorrectly?)
timotimo in that case it'd be more like my $result = qast_eval($a_block)()
japhb It looks like some kind of incorrect booleanization ...? 21:41
masak timotimo: yes. 21:42
timotimo is off
masak nige: dunno if it helps, but strangelyconsistent.org/blog/macros...hey-really was the closest I found.
nige cool thanks
hoelzro is there a difference between if my $foo = expr() { ... } and if expr() -> $foo { ... }?
hoelzro looked at the commit japhb mentioned
masak hoelzro: scoping.
bartolin japhb: I saw broken builds for r-p and r-j: irclog.perlgeek.de/perl6/2014-12-16#i_9812687 (there's a gist as well) 21:43
masak hoelzro: '-> $foo' lives in the if block. 'my $foo' lives in the containing block.
lizmat japhb: moar is more forgiving than parrot / jvm
hoelzro oh, so this is legal? if my $foo = expr() { ... } ; say($foo)
masak right.
timotimo wasn't moar often "more strict" with regards to 6model stuff?
as compared to parrot at least 21:44
lizmat well, this isn't strictly 6module stuff
hoelzro interesting
masak++ # explanation
lizmat this is a method returning nqp's Mu upon not finding anything
and nqp-p and nqp-j not being able to handle that
hoelzro that's an interesting difference between P5 and P6 I'd never noticed
oh, I guess that's *not* different 21:45
lizmat I basically looked for similar patterns in the nqp code, and found that find_method calls where guarded that way 21:45
hoelzro oh, no, it is
lizmat and the new one of jnthn wasn't
japhb: does that make sense to you ? 21:46
lizmat m: class A {}; role A {} 21:48
camelia rakudo-moar 1785ea: OUTPUT«===SORRY!=== Error while compiling /tmp/FTBOiotNUP␤Redeclaration of symbol A␤at /tmp/FTBOiotNUP:1␤------> class A {}; role A ⏏{}␤ expecting any of:␤ statement list␤ horizontal whitespace…»
lizmat seems legit, right?
m: role A {}; class A {} # huh? 21:49
camelia rakudo-moar 1785ea: OUTPUT«===SORRY!===␤Cannot find method 'is_composed'␤»
masak yeah, LTA error.
timotimo ah, roles are never composed 21:49
nige hypothetically speaking ... could macros fire before BEGIN blocks in some kind of pre-BEGIN phaser?
timotimo something is checking for is_composed to see if we're in a class A { class A { } } situation perhaps
lizmat m: role A {}; say A.new.WHAT
camelia rakudo-moar 1785ea: OUTPUT«(A)␤»
masak nige: macros can not fire any earlier than they do.
lizmat looks like roles are composed sometimes :-)
masak nige: because they already fire at the earliest possible time, just as the parser finds them. 21:50
nige: there is no sooner than that.
nige: so, no. not even hypothetically speaking :)
nige ok - but some other BEGIN may have fired before
masak yes, because they also fire as soon as they can. 21:51
nige so the macro does not first in that case
timotimo we only do a single pass over the code when compiling
er. a single parsing pass
masak nige: if you put a BEGIN block before a macro invocation, the BEGIN block will fire first because the parser sees it first.
timotimo a macro that appears later in the code file can not fire earlier than a begin block that ends earlier in the file
masak m: macro foo { say "macro"; Nil }; BEGIN { "BEGIN block" }; foo 21:52
camelia rakudo-moar 1785ea: OUTPUT«macro␤»
masak m: macro foo { say "macro"; Nil }; BEGIN { say "BEGIN block" }; foo
camelia rakudo-moar 1785ea: OUTPUT«BEGIN block␤macro␤»
masak m: macro foo { say "macro"; Nil }; foo; BEGIN { say "BEGIN block" }
camelia rakudo-moar 1785ea: OUTPUT«macro␤BEGIN block␤»
masak the only thing that's confusing about this is that the execution phase we're talking about here is while the parser is running. most people are not used to thinking about a runtime doing anything at all during that phase. 21:53
nige hmm - yes I was thinking just about this parsing phase
nige before execution happens 21:54
I imagined that in any given module there would be a parsing phase - followed by an execution phase 21:55
timotimo that's what phasers are about
BEGIN is during the parsing phase
because you can do things in there that change the way the future parsing behaves 21:56
INIT is ASAP during the execution phase
and with that, i'm off to bed
lizmat gnight timotimo
masak 'night, timo
nige night timotimo++ thanks for your help
timotimo i hope i could be of any help :) 21:57
lizmat NR.pm shutting down, decommute& 21:58
masak since `::` is not implemented in rules, what do people use instead? 22:01
masak oh, `{}`, it seems. 22:02
masak gah, another case where introducing Grammar::Tracer changes the outcome. :( 22:06
in this case it actually made the grammar pass instead of (unexpectedly) fail.
I'm starting to think I'll have to golf this one -- it's just not viable not to have a way to debug my grammar.
LLamaRider o/ #perl6 22:15
masak LLamaRider! \o/ 22:16
vendethiel o/ 22:16
LLamaRider My one and only working P6 module regressed, so I came to ask for sage advice 22:17
LLamaRider it's a rather mysterious (to me) regex error 22:17
github.com/dginev/perl6-Lingua-EN-...e.pm6#L161
No such method 'PAP' for invocant of type 'Cursor'
---
if that makes sense to anyone, advice is very welcome :)
colomon what is PAP? 22:18
LLamaRider it's a token
link holds the source
colomon oh, you defined it. 22:19
LLamaRider this module used to pass its tests happily until 4-5 months ago. Didn't look at it for a while, so I don't know when it regressed exactly 22:20
colomon LLamaRider: Lingua::EN::Sentence, yes?
LLamaRider yep 22:21
colomon LLamaRider: give me a minute here.... 22:23
LLamaRider no rush, it waited for a few months already >:D
colomon okay, worked in 05/06 22:26
failed today 22:27
LLamaRider a biannual bisect? :-)
colomon worked in 08/03
colomon 10/03 22:28
11/03
failed 12/03
pyrimidine bisect is awesome
colomon worked 11/15
masak wow, non-ISO dates are so confusing.
colomon failed 11/25
masak it took me a while to realize those even were dates.
colomon failed 11/20 22:29
pyrimidine the suspense is killing me
colomon worked 11/17
failed 11/18
there you have it.
masak waitwait, you haven't narrowed it down to a commit yet. 22:30
colomon don't smoke every commit, just every day 22:30
masak oh, ok.
colomon LLamaRider is now in good position to figure out which commit it was
masak yeah.
masak has a look and tries to guess 22:31
LLamaRider rakudo source, here i come
colomon just got an e-mail saying "Relive the year on Twitter!" and his first repsonse was "Noooooooo!" 22:31
masak heh, I bet you'll find it was f2ffb9a384b01a276e4187908e4f81f9878681f3 :)
colomon I dunno, 7bb36563ad10cb268b4715617b3a7f82085c907f seems like it might be relavant. 22:33
masak oh, yes. 22:34
I seem to recall some IRC log about that one.
masak looks
LLamaRider I like 7bb as well, seems most directly related to the error 22:35
masak yeah. 22:36
colomon wonders if we should start a betting pool.... 22:36
jnthn bah, irssi or screen wedged for some reason :/
masak no, I can't find any IRC discussion about the method/sub change. 22:37
time for me to hit the hay.
'night, #perl6
colomon o/
and \o jnthn
LLamaRider r: my token termpunct { <[.?!]> }; say "Hello!" ~~ s:g/(<.termpunct>)//; 22:38
camelia rakudo-moar 1785ea: OUTPUT«No such method 'termpunct' for invocant of type 'Cursor'␤ in method match at src/gen/m-CORE.setting:6703␤ in method subst-mutate at src/gen/m-CORE.setting:6784␤ in method subst-mutate at src/gen/m-CORE.setting:4083␤ in block <unit> at /tmp/tmpf…»
..rakudo-parrot 1785ea: OUTPUT«No such method 'termpunct' for invocant of type 'Cursor'␤ in regex at /tmp/tmpfile:1␤ in regex at /tmp/tmpfile:1␤ in method match at gen/parrot/CORE.setting:6710␤ in method subst-mutate at gen/parrot/CORE.setting:6790␤ in method subst-mu…»
colomon m: my token termpunct { <[.?!]> }; say "Hello!" ~~ s:g/(<termpunct>)//; 22:40
camelia rakudo-moar 1785ea: OUTPUT«Cannot assign to an immutable value␤ in method subst-mutate at /home/camelia/rakudo-inst-2/languages/perl6/runtime/CORE.setting.moarvm:1␤ in method subst-mutate at src/gen/m-CORE.setting:4083␤ in block <unit> at /tmp/QFWoAYjbNY:1␤␤»
LLamaRider even shorter:
colomon m: my token termpunct { <[.?!]> }; say "Hello!" ~~ /(<termpunct>)/;
camelia rakudo-moar 1785ea: OUTPUT«「!」␤ 0 => 「!」␤ termpunct => 「!」␤␤»
LLamaRider r: my token a {a}; say "Hello!" ~~ /<.a>/;
camelia rakudo-parrot 1785ea: OUTPUT«No such method 'a' for invocant of type 'Cursor'␤ in regex at /tmp/tmpfile:1␤ in method ACCEPTS at gen/parrot/CORE.setting:14236␤ in method ACCEPTS at gen/parrot/CORE.setting:867␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-moar 1785ea: OUTPUT«No such method 'a' for invocant of type 'Cursor'␤ in method ACCEPTS at src/gen/m-CORE.setting:14297␤ in block <unit> at /tmp/tmpfile:1␤␤»
colomon m: my token termpunct { <[.?!]> }; say "Hello!" ~~ /(<.termpunct>)/;
camelia rakudo-moar 1785ea: OUTPUT«No such method 'termpunct' for invocant of type 'Cursor'␤ in method ACCEPTS at src/gen/m-CORE.setting:14297␤ in block <unit> at /tmp/8FtrfW2ghl:1␤␤»
jnthn . should only find methods 22:41
jnthn Use & to find subs 22:41
LLamaRider <.space> and <.ws> are methods?
jnthn Yes.
m: say ?Cursor.can('ws') 22:42
camelia rakudo-moar 1785ea: OUTPUT«True␤»
jnthn m: say ?Cursor.can('space')
camelia rakudo-moar 1785ea: OUTPUT«True␤»
LLamaRider now I know what to refactor, thanks :)
ninjazach Rakudo :) sounds like a move Ryu from Street Fighter would do :) love it 22:43
LLamaRider btw, +1 for a more suggestive error message in this case 22:44
colomon: I pushed a fully operational Lingua::EN::Sentence, how do I tell panda to have it in mind? 22:45
or I just wait for a scheduled recheck? 22:46
jnthn++ thanks again for that pro tip :)
jnthn np :) 22:49
LLamaRider panda already uses the newest commit, sweet :) 22:51
colomon LLamaRider: you don't need to do anything, panda gets the latest version from your github repo. 22:53
just checked, and it worked for me.
LLamaRider \o/ 22:54
then I shall take my leave for now, if only all regressions were resolved so smoothly :-) 22:55
\o have fun
dalek ast: d692769 | jnthn++ | S12-methods/fallback.t:
Test invoke/postcircmfix:<( )> interaction.
23:12
dalek ecs: e15acbc | jnthn++ | S12-objects.pod:
Re-purpose the method ^foo(...) { ... } syntax.

The existing design of it was out of line with the way Perl 6 evolved since then, and also not especially useful. This takes the syntax and enables its use for per-type meta-behavior specialization. This, as a special case, allows attaching extra metadata to the meta-object, which captures some aspect of what the syntax was originally specified to do. However, it maintains the distinction between objects and their meta-objects more strongly, which also fits better with the overall Perl 6 design.
23:59