»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! | YAPC::NA talk submissions due end of Month. Have you submitted your talk?
Set by toddr_ on 18 March 2013.
pmichaud looking 00:00
Iterable.Numeric has a :D invocant 00:01
so Range.Numeric probably should also.
[Coke] adding. 00:02
pmichaud [Coke]++ # ticket wrangler extraordinaire 00:03
[Coke] eh. It's the easiest thing I can do. I tried several times this morning to pull at other threads, and it went nowhere.
thundergnat pmichaud: at your convenience, could you take a peek at gist.github.com/thundergnat/5265633 and comment? 00:04
[Coke] oh, right, I knew I was forgetting to ask him something!
pmichaud thundergnat: I don't quite see why the infinite version is preferable. 00:05
thundergnat ???
The version that returns in 5 vs 5000 seconds is preferable. 00:06
pmichaud I don't see why the Any version takes 5000 seconds.
it shouldn't.
thundergnat r: my @harshad := gather for 1 .. * { take $_ if $_ %% [+] .comb }; say @harshad.first: {$^_ > 1000}; # takes 5400 seconds locally to return an answer 00:08
p6eval rakudo 25a9d6: OUTPUT«(timeout)»
pmichaud right, so that tells me there's a bug somewhere in the list code.
and the way to fix that is by fixing the list code, not by patching around the bug.
thundergnat Should I file a bug report then? 00:09
pmichaud sure, that works. 00:10
thundergnat Ok, thanks for looking.
pmichaud the code in Any.first ought to be suitably lazy that it can find an element without racing too far afield in an infinite list.
dalek : b597d4f | (Tobias Leich)++ | Makefile:
set the deps right, so we just can type: make
00:11
: 8d53962 | (Tobias Leich)++ | lib/Perl6/P5Actions.pm:
add support for $^X
pmichaud if it's not doing that, then there's a bug or incorrect optimization somewhere in the ListIterator code
[Coke] r: say (6..6).list
p6eval rakudo 25a9d6: OUTPUT«6␤»
[Coke] r: say +(6..6) 00:12
p6eval rakudo 25a9d6: OUTPUT«1␤»
dalek Heuristic branch merge: pushed 23 commits to rakudo/extend-dump by japhb 00:13
FROGGS_ nr: say $*PROGRAM_NAME
p6eval niecza v24-35-g5c06e28: OUTPUT«/tmp/_Ocji7ySdS␤»
..rakudo 25a9d6: OUTPUT«/tmp/9DKvxVfGZJ␤»
pmichaud thundergnat: out of curiosity, is Any.first also slow for finite-but-large lists in your example?
FROGGS_ can this be right? I expect to get something with a leading 'perl6' for $*PROGRAM_NAME
it is -e though on command line
pmichaud i.e., is the slowness due to the infinite nature of the source list, or just because it's very large? 00:14
thundergnat pmichaud: no, not particularly. At least nowhere near the same
FROGGS_ ahh, hold on, I'm doing that wrong 00:15
thundergnat pmichaud: It only seems to occur in lists created using gather take. I wonder if it is some weird interaction between GatherIter and ListIter? 00:16
[Coke] drinks a double agent ipl from sam adams. 00:18
pmichaud oh, GatherIter is indeed suboptimal for a lot of stuff. 00:20
there definitely needs to be some improved communication between GatherIter and MapIter
I suspect that MapIter tries to go too far ahead when confronted with an infinite GatherIter 00:21
or, more likely...
the gather isn't able to signal that it's infinite, and that's causing MapIter to go too far ahead 00:22
thundergnat That seems likely
It seems like it tries to reify 10000 elements before it starts to do comparisons. 00:23
pmichaud yes 00:24
if we make that number smaller, however, than things like for 1..10000 { ... } will get significantly slower
thundergnat yep 00:25
pmichaud so there has to be some improved communication between the lists
which is something that I'm working on (and there are several other problems that need addressing)
unfortunately there's a lot of interrelated stuff in the waterbed of lists in Perl 6 that still needs to be worked out. :)
thundergnat I messed around with the .reify method to try to make it less excrucating but really just made other things worse. 00:26
pmichaud yeah
and we're going to have to adjust a lot of the list code soon anyway because the value/container model that Rakudo uses needs some other changes (to bring it up to spec and to be usable on JVM)
thundergnat Ah. 00:27
pmichaud so, while I encourage experimentation here, just know that any patches might get ripped out soon :)
I do agree that .first as it exists now on the example you gave is not ideal. I just don't think that having specialized version for infinite lists is the proper fix... the better fix is to make sure that for self.list { ... } in Any.first can be appropriately lazy. 00:28
anyway, I have to run for a while
thundergnat Well, i was a nice learning experience / experiment for me at least. :) Thanks again!
pmichaud thank you for the bug report
it's _extremely_ helpful as an example.
coming up with good benchmark examples is one of the toughest parts of this :) 00:29
dalek : 331adc7 | (Tobias Leich)++ | lib/Perl6/P5Actions.pm:
$^X should be $*EXECUTABLE_NAME
pmichaud note to channel: I do expect to be able to produce a candidate Star release tomorrow (Fri), but may be sidetracked for the day again.
Will definitely let the channel know so that someone else can pick up the 2013.03 release if needed. 00:30
[Coke] r: say +(1..10), +(1..^10), +(1^..10), +(1^..^10), +(10..10), +(10..9)
p6eval rakudo 25a9d6: OUTPUT«1099810␤»
[Coke] r: say (+(1..10), +(1..^10), +(1^..10), +(1^..^10), +(10..10), +(10..9)).join("|"); 00:31
p6eval rakudo 25a9d6: OUTPUT«10|9|9|8|1|0␤»
FROGGS_ does somebody know what this X< ... > is suppose to mean at there very end? doc.perl6.org/language/variables 00:40
chee perl6 to js compulller? 00:41
FROGGS_ chee: you are talking (weird) about Perlito6 ?
chee 1i am asking 00:44
is it?
[Coke] FROGGS_: there's a lot of ...'s in that document.
or are you referring to the X<> ?
FROGGS_ [Coke]: right, the X<> around the vars
[Coke] oh, I see what you mean. 00:45
probably some 5pod that didn't get updated.
r: say +(1.2..4) 00:48
p6eval rakudo 25a9d6: OUTPUT«3␤»
[Coke] r: say +(1..^3.3) 00:49
p6eval rakudo 25a9d6: OUTPUT«3␤»
[Coke] r: say (1..^3.3).list
p6eval rakudo 25a9d6: OUTPUT«1 2 3␤»
chee ??/ 00:56
coas hi 00:57
FROGGS_ hi coas
FROGGS_ well, bye then 00:57
FROGGS_ is there currently a way to get the output of a shell command? like: perl -e 'print 1 . `perl -e "print 2"` . 3' # 123 01:03
run() and shell() only return the error code
FROGGS_ ohh there is an IO::Capture::Simple module \o/ 01:07
err
flussence [Coke]: sounds like you might find this useful - gist.github.com/flussence/3007551 01:19
[Coke] maybe 40m ago, yes. ;) 01:21
spectesting now.
flussence I'm not sure it's optimal code anyway, it is half a year old... :) 01:22
adu_ hey 01:28
so I'm getting errors I don't understand
FROGGS_ adu_: describe the problem and use paste-services to dump the code+error messages 01:29
adu_ will gist.gh.com work?
FROGGS_ yes
adu_ gist.github.com/andydude/5268163 01:31
FROGGS_ cool A C89 grammar 01:32
adu_ there error is "Undeclared routine: 'text-line' used at line 582"
it's a C11 grammar
gtodd I've been trying to get bunches of perl5 scripts to run under perl6 ... 01:33
adu_ I named the file before I decided which dialect I was writting
dalek ast: 3e1d8bb | coke++ | S02-types/range.t:
add more range numification tests
FROGGS_ adu_: looks like you're missing a $ there
dalek kudo/nom: 192b28f | coke++ | src/core/Range.pm:
RT#82312 - optimize size of numeric range.

Inspired by a patch from Gilbert Röhrbein [email@hidden.address]
adu_ I
FROGGS_ <group(text-line)> is a function call to group with text-line as param 01:34
adu_ FROGGS_: I've never written perl5, so I don't know how routine's without args (i.e. routine refs) are supposed to work
I'm moving from Haskell to Perl6
FROGGS_ forget about perl5, this is totally different :o)
adu_ so <group($text-line)> 01:35
or <group(&text-line)>
FROGGS_ $text-line
ahh, hold on
adu_ ok, then when I want to use it <$text-line> or <($text-line)>?
FROGGS_ I have to read a bit more carefully 01:36
adu_ it's a regex parameter
FROGGS_ ya, but I'm not sure you can pass a reference to a sub (the token) just like that 01:37
adu_ hmm
FROGGS_ let me fork your gist
adu_ well, that was the beginning of my nonstandard extensions
I was hoping restrict the places that pp-includes could appear, surounding decls and surounding stmts, 01:38
which is why I wanted to parameterize group 01:39
<group(/<text-line>/)> maybe?
FROGGS_ gist.github.com/FROGGS/5268178/revisions 01:40
you have a proto group-part, and several rules/token attached to it 01:41
if you say, you want to match one of the tokens (any of them), you just match against the proto's name
like against <group-part>
you dont need an parameter there 01:42
gtodd FROGGS_: since they are scripts they often work just fine with very few changes
adu_ FROGGS_: do you understand what I'm trying to do? 01:45
FROGGS_ adu_: I think so, yes
adu_ the line where it says "rule group-part:sym<text-line> { <text-line> }"
I'm trying to replace it with <decl>+ in some places and <stmt>+ in other places 01:46
I guess I could just make stmt-group and decl-group
but that would be in a separate file that subclasses this
FROGGS_: anyways, thanks for the help 01:47
[Coke] f
colomon rn: say 2i.conj
p6eval rakudo 25a9d6, niecza v24-35-g5c06e28: OUTPUT«0-2i␤»
colomon rn: say 2.conj
p6eval rakudo 25a9d6, niecza v24-35-g5c06e28: OUTPUT«2␤»
FROGGS_ adu_: what will you get when you rename something to <decl>?
[Coke] ... was it already in there after all these years? 01:48
FROGGS_ adu_: you won't fix the grammar if there are errors
colomon rn: say conj 2+2i
p6eval niecza v24-35-g5c06e28: OUTPUT«2-2i␤»
..rakudo 25a9d6: OUTPUT«===SORRY!===␤Undeclared routine:␤ conj used at line 1␤␤»
colomon [Coke]: if you're talking to me, yes. 01:49
[Coke] aye.
FROGGS_ gtodd: but perl 5 has no grammars...
adu_ so step 1 is unparameterize them
[Coke] I just moved the ticket without checking.
rakudo: multi foo(:$a!, *%_) {}; multi foo(:$b, *%_) {}; foo(:a, :b) 01:50
p6eval rakudo 25a9d6: ( no output )
FROGGS_ adu_: well, you should at least not to try to pass tokens as params around
adu_ FROGGS_: but what if that's what I want to do?
FROGGS_ adu_: flags are okay, that happens in Perl6's grammar too
adu_ FROGGS_: but Haskell does it all the time
FROGGS_ then you have to explain what it should do with the given param
adu_ ok 01:51
FROGGS_ should it filter the list of dispatchers?
like only the one token of the group should match?
colomon [Coke]: it's in the spec as well, but it seems to be conjugate there.
adu_ as I said, I'm working on a nonstandard dialect of C in which CPP is not expanded, so I'd like to replace <text-line> with <declaration> in some places, and replace <text-line> with <statement> in other places, essentially to skip the preprocessing step 01:52
FROGGS_ I meant, what should 'passing a token around' do?
adu_ <group($text-line)> should pass it to <group-part> which would match { <declaration> } if $text-line = declaration 01:54
I suppose I could also make an enum 01:55
FROGGS_ then you have to use the given param $text in this case, and match it literally 01:55
but you are not using $text here: gist.github.com/FROGGS/5268178#fil...r-pm6-L584 01:56
dalek ecs: f348a0a | colomon++ | S32-setting-library/Numeric.pod:
Update Numeric.pod

Change conjugate to conj.  (Another location in the spec, the compilers, and roast all had it as conj.)
adu_ in haskell this would be ruleA p = between "(" ")" p; ruleB = …; ruleC = ruleA ruleB
pmichaud [Coke]: the patch fails the following:
> say +(2.3 .. 3.1) 01:57
2
rn: say +(2.3 .. 3.1)
dalek ast: a2664ea | coke++ | S06-multi/syntax.t:
Add test for RT #68528
p6eval rakudo 25a9d6, niecza v24-35-g5c06e28: OUTPUT«1␤»
adu_ I'm trying to understand why this isn't working the same way in perl6
FROGGS_ adu_: feels a bit like like: rule A( $p ) { '(' ~ ')' <$p> } 01:58
adu_ rule ruleA($p) { '(' ~ ')' <$p> }; rule ruleB { … }; rule ruleC { <ruleA(&ruleB)> }
[Coke] r: say (2.3..3.1).list
p6eval rakudo 25a9d6: OUTPUT«2.3␤»
adu_ is that right? 01:58
[Coke] r: say +(2.3..3.1)
p6eval rakudo 25a9d6: OUTPUT«1␤»
FROGGS_ adu_: looks sane to me
adu_ FROGGS_: is the & right? 01:59
[Coke] pmichaud: danke.
FROGGS_ adu_: think so, yes, since without it you would try to call that method
adu_ ok
FROGGS_ just try this one-liner
r: grammar G { rule TOP { <A>+ }; rule A { <B(&C)> }; rule B($what) { <$what> }; rule C( 'test' ) }; G.parse('testtest') 02:01
p6eval rakudo 25a9d6: OUTPUT«===SORRY!===␤Variable '$what' is not declared␤at /tmp/AgGnGKnN39:1␤------> A { <B(&C)> }; rule B($what) { <$what> }⏏; rule C( 'test' ) }; G.parse('testtest'␤ expecting any of:␤ postfix␤ infix stopper␤ hor…
adu_ per6: grammar G {rule rA($p) { '(' ~ ')' <$p> }; rule rB { '_' }; rule rC { <rA(&B)> }; }; G.parse("(_)") 02:02
r: grammar G {rule rA($p) { '(' ~ ')' <$p> }; rule rB { '_' }; rule rC { <rA(&B)> }; }; G.parse("(_)")
p6eval rakudo 25a9d6: OUTPUT«===SORRY!===␤Variable '$p' is not declared␤at /tmp/QnnZN1swdB:1␤------> rammar G {rule rA($p) { '(' ~ ')' <$p> }⏏; rule rB { '_' }; rule rC { <rA(&B)> };␤ expecting any of:␤ statement list␤ prefix or term␤ …
FROGGS_ r: grammar G { rule TOP { <A>+ }; rule A { <B(&C)> }; method B($what) { <$what> }; rule C { 'test' } }; G.parse('testtest')
p6eval rakudo 25a9d6: OUTPUT«===SORRY!===␤Undeclared name:␤ &C used at line 1␤␤»
adu_ r: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <$what> }; regex C { 'test' }; regex A { <B(&C)> }; }; G.parse('testtest') 02:05
p6eval rakudo 25a9d6: OUTPUT«===SORRY!===␤Variable '$what' is not declared␤at /tmp/uWUbOOVA_9:1␤------> P {^ <A>+ $}; regex B($what) { <$what> }⏏; regex C { 'test' }; regex A { <B(&C)> ␤ expecting any of:␤ statement list␤ prefix or term␤ …
adu_ r: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <::($what)> }; regex C { 'test' }; regex A { <B('C')> }; }; G.parse('testtest') 02:09
p6eval rakudo 25a9d6: OUTPUT«No such method 'QAST::Var<1988309812>' for invocant of type 'G'␤ in regex B at /tmp/RtzoutigI0:1␤ in regex A at /tmp/RtzoutigI0:1␤ in regex TOP at /tmp/RtzoutigI0:1␤ in method parse at src/gen/CORE.setting:10941␤ in block at /tmp/RtzoutigI0:1␤␤»
adu_ n: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <::($what)> }; regex C { 'test' }; regex A { <B('C')> }; }; G.parse('testtest')
p6eval niecza v24-35-g5c06e28: ( no output )
[Coke] r: say (2.3..4.1).list
p6eval rakudo 25a9d6: OUTPUT«2.3 3.3␤»
adu_ n: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <::($what)> }; regex C { 'test' }; regex A { <B('C')> }; }; say G.parse('testtest') 02:10
p6eval niecza v24-35-g5c06e28: OUTPUT«「testtest」␤ A => 「test」␤ B => 「test」␤ ::($what) => 「test」␤ A => 「test」␤ B => 「test」␤ ::($what) => 「test」␤␤»
adu_ YES! it worked in niecza
you can pass method names
FROGGS_ adu_: can you file a ticket for that please? -> [email@hidden.address] 02:11
adu_ don't tell me that I'm the first person to try symbolic indirect rules? 02:12
FROGGS_ well, you might the first one who opens a ticket :/
adu_ sent 02:17
FROGGS_ r: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <::C()> }; regex C { 'test' }; regex A { <B('C')> }; }; say G.parse('testtest') 02:19
p6eval rakudo 192b28: OUTPUT«「testtest」␤ A => 「test」␤ B => 「test」␤ C => 「test」␤ A => 「test」␤ B => 「test」␤ C => 「test」␤␤»
FROGGS_ r: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <::"$what"()> }; regex C { 'test' }; regex A { <B('C')> }; }; say G.parse('testtest')
p6eval rakudo 192b28: OUTPUT«===SORRY!===␤ResizablePMCArray: Can't pop from an empty array!␤»
FROGGS_ r: grammar G { rule TOP {^ <A>+ $}; regex B($what) { <::"C"()> }; regex C { 'test' }; regex A { <B('C')> }; }; say G.parse('testtest')
p6eval rakudo 192b28: OUTPUT«===SORRY!===␤ResizablePMCArray: Can't pop from an empty array!␤»
colomon rn: say -i 02:22
p6eval rakudo 192b28: OUTPUT«-0-1i␤»
..niecza v24-35-g5c06e28: OUTPUT«0-1i␤»
colomon -0-1i?
pmichaud rn: say (-i).re 02:23
p6eval rakudo 192b28: OUTPUT«-0␤»
..niecza v24-35-g5c06e28: OUTPUT«0␤»
pmichaud rn: say -0
p6eval rakudo 192b28, niecza v24-35-g5c06e28: OUTPUT«0␤»
pmichaud rn: say -0e
p6eval rakudo 192b28: OUTPUT«===SORRY!===␤Confused␤at /tmp/w60hxYhMdD:1␤------> say -0⏏e␤ expecting any of:␤ whitespace␤»
..niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Whitespace is required between alphanumeric tokens at /tmp/ojTwS_Ogbh line 1:␤------> say -0⏏e␤␤Two terms in a row at /tmp/ojTwS_Ogbh line 1:␤------> say -0⏏e␤␤Parse failed␤␤»…
pmichaud rn: say -0e0
p6eval rakudo 192b28: OUTPUT«-0␤»
..niecza v24-35-g5c06e28: OUTPUT«0␤»
pmichaud looks like it's the Parrot/IEEE negative zero popping up. 02:24
(Parrot floats on some platforms accept the possibility of a signed zero value.)
colomon makes sense 02:25
adu_ is that a problem? 02:32
skids except for stuff like "int" that specs platform dependence, I would think perl6 would want to behave the same irrespective of platform. 02:36
lue rn: say -0 == 0 02:37
p6eval rakudo 192b28, niecza v24-35-g5c06e28: OUTPUT«True␤»
sorear perl 6 *should* have negative zero on *all* platforms
IEEE 754 is not one of the "wheels that need reinventing"
sorear you're free to suppress the leading - in the printout if you want - I think niecza does that 02:38
skids Hrm, then I may have to amend my patches for fixing bigint bitops, ISTR neglecting that case. 02:39
Well, actually calling them "patches" is generous
sorear skids: we're only talking about the Num type here. whether rakudo's bigints have -0 is a different question entirely 02:40
skids Ah, OK. I'll try to keep tabs on whether bigint is used in that capacity.
sorear the Num type corresponds to IEEE 754(r) floating point numbers, typically 64 bits 02:41
bigints not involved at all
some bigint libraries use sign-magnitude representations and thus have an _internal_ -0, but AFAIK all bigint libraries do not expose -0 to the user 02:42
skids So, if there's a conversion from Num(-0) to Int, what happens?
sorear skids: Produces 0
skids OK, then nevermind.
lue ooc, is there a function in Perl 6 that gives you a character's unicode name (what you'd use with \c[] in a string)? 02:54
dalek ast: 13c6035 | coke++ | S02-types/range.t:
add more range numification tests

  pmichaud++
03:07
[Coke] pmichaud: fixed, thanks. 03:08
dalek kudo/nom: 9bf1806 | coke++ | src/core/Range.pm:
RT#82312 numeric value of numeric range

Fix another edge case. pmichaud++
adu_ FROGGS__ what does this mean? "System.NullReferenceException: Object reference not set to an instance of an object" 03:24
adu_ does niecza support protos? 03:49
because my drilling indicates that niecza doesn't support protos 03:50
adu_ I get that error for something as simple as <ident> 03:58
adu_ r: grammar G { token TOP {^ <id> $}; token ident { <.ident-first> <.ident-rest>* }; proto token ident-first {*}; token ident-first:sym<under> { '_' }; token ident-first:sym<alpha> { <.alpha> }; proto token ident-rest {*}; token ident-rest:sym<alpha> { <.ident-first> }; token ident-rest:sym<digit> { <.digit> }; }; G.parse('test') 04:04
p6eval rakudo 192b28: OUTPUT«No such method 'id' for invocant of type 'G'␤ in regex TOP at /tmp/AWs9ZcjuqN:1␤ in method parse at src/gen/CORE.setting:10951␤ in block at /tmp/AWs9ZcjuqN:1␤␤»
adu_ r: grammar G { token TOP {^ <ident> $}; token ident { <.ident-first> <.ident-rest>* }; proto token ident-first {*}; token ident-first:sym<under> { '_' }; token ident-first:sym<alpha> { <.alpha> }; proto token ident-rest {*}; token ident-rest:sym<alpha> { <.ident-first> }; token ident-rest:sym<digit> { <.digit> }; }; G.parse('test')
p6eval rakudo 192b28: ( no output )
adu_ r: grammar G { token TOP {^ <ident> $}; token ident { <.ident-first> <.ident-rest>* }; proto token ident-first {*}; token ident-first:sym<under> { '_' }; token ident-first:sym<alpha> { <.alpha> }; proto token ident-rest {*}; token ident-rest:sym<alpha> { <.ident-first> }; token ident-rest:sym<digit> { <.digit> }; }; say G.parse('test')
p6eval rakudo 192b28: OUTPUT«「test」␤ ident => 「test」␤␤»
adu_ n: grammar G { token TOP {^ <ident> $}; token ident { <.ident-first> <.ident-rest>* }; proto token ident-first {*}; token ident-first:sym<under> { '_' }; token ident-first:sym<alpha> { <.alpha> }; proto token ident-rest {*}; token ident-rest:sym<alpha> { <.ident-first> }; token ident-rest:sym<digit> { <.digit> }; }; say G.parse('test')
p6eval niecza v24-35-g5c06e28: OUTPUT«「test」␤ ident => 「test」␤␤»
adu_ ok 04:05
so that is working, but why is it not working for me?
dalek ast: 30ac27f | coke++ | S29-context/eval.t:
add test for RT#115774
04:25
[Coke] Where should a test for the ability to create a new twigil go? 04:31
rn: sub twigil:<∫>{}; say "alive"; #RT #73938 04:32
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Cannot add tokens of category 'twigil'␤at /tmp/_ey1Vc8j3A:1␤------> sub twigil:<∫>⏏{}; say "alive"; #RT #73938␤ expecting any of:␤ colon pair␤ quote words␤»
..niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Cannot extend category:twigil with subs at /tmp/8UEFBBEXox line 1:␤------> sub twigil:<∫>⏏{}; say "alive"; #RT #73938␤␤Potential difficulties:␤ &twigil:<∫> is declared but not used at /tmp/8UEFBBEXox line…
[Coke] rn: sub twigil:<∫> {}; say "alive"; #RT #73938
p6eval niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Cannot extend category:twigil with subs at /tmp/lfM_Rep6js line 1:␤------> sub twigil:<∫> ⏏{}; say "alive"; #RT #73938␤␤Potential difficulties:␤ &twigil:<∫> is declared but not used at /tmp/lfM_Rep6js lin…
..rakudo 9bf180: OUTPUT«===SORRY!===␤Cannot add tokens of category 'twigil'␤at /tmp/fMCnTCdtji:1␤------> sub twigil:<∫> ⏏{}; say "alive"; #RT #73938␤ expecting any of:␤ colon pair␤ quote words␤»
[Coke] rn: sub twigil:<@> {}; say "alive"; #RT #73938
sorear I...think rakudo is right?
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Cannot add tokens of category 'twigil'␤at /tmp/ahlR_BN_UA:1␤------> sub twigil:<@> ⏏{}; say "alive"; #RT #73938␤ expecting any of:␤ colon pair␤ quote words␤»
..niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Cannot extend category:twigil with subs at /tmp/V20tSCxbvM line 1:␤------> sub twigil:<@> ⏏{}; say "alive"; #RT #73938␤␤Potential difficulties:␤ &twigil:<@> is declared but not used at /tmp/V20tSCxbvM lin…
[Coke] ugh. it changed since 2011 when no one wrote any tests. :P 04:33
hoelzro ok, folks. I did it.
I found out how to invoke the underlying code object for Perl 6 subs
\o/
however, defining postcircumfix:<( )> for Code objects breaks Rakudo in quite a spectacular way =/ 04:34
so now I'm kinda stumped.
[Coke] rakudo: .say for map &sprintf.assuming("%x"), ^16; 04:35
p6eval rakudo 9bf180: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤a␤b␤c␤d␤e␤f␤»
dalek ast: 92f5587 | coke++ | S32-list/map.t:
add test for RT#112596
04:40
hoelzro what's the syntax for "capture anything and everything", again? 04:47
sub my-sub(|capture) { some-other-sub(|capture); } # ?
moritz yes 04:49
hoelzro hmm
does that not work in NQP?
moritz no
you might need to use |$capture in nqp
nqp: sub s(|$c) { say(|$c) }; s(1, 2, 3) 04:50
p6eval nqp: OUTPUT«Routine declaration requires a signature at line 2, near "(|$c) { sa"␤current instr.: 'panic' pc 14698 (src/stage2/gen/NQPHLL.pir:5230) (src/stage2/gen/NQPHLL.pm:278)␤»
dalek ast: 2dd229c | coke++ | S32-list/uniq.t:
add test for RT #83454
moritz or maybe you have to use *@pos, *%named
hoelzro |$capture didn't work =/
*@pos, *%named didn't either
well, it complains about "Positional expected, got Array" 04:51
oh well, I'll work on this more tomorrow 04:58
big steps made today =)
dalek kudo/extend-dump: 3b876e2 | (Geoffrey Broadwell)++ | src/core/Mu.pm:
Handle DUMP() of VM types that can't .DUMP() themselves
05:05
kudo/extend-dump: 19ad263 | (Geoffrey Broadwell)++ | src/core/ (2 files):
Improve .DUMP() of GatherIter and Parcel
kudo/extend-dump: 2d738ce | (Geoffrey Broadwell)++ | src/core/ (2 files):
Upgrade the .DUMP() method for ListIter and MapIter
kudo/extend-dump: cfbdeba | (Geoffrey Broadwell)++ | src/core/ (3 files):
Move infinite marker to front of .DUMP for GatherIter, ListIter, and List
Heather Hello! 05:15
how check if string contains /
r: say 'a/b' ~~ /\// 05:16
p6eval rakudo 9bf180: OUTPUT«「/」␤␤»
Heather r: say 'a/b' ~~ /\/\/ 05:17
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Regex not terminated␤at /tmp/Bx4e7u9liH:1␤------> say 'a/b' ~~ /\/\/⏏<EOL>␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤ prefix or term␤ prefix or meta-prefix…
Heather r: say 'a/b' ~~ /(\/)/
p6eval rakudo 9bf180: OUTPUT«「/」␤ 0 => 「/」␤␤»
Heather r: say 'a/b' ~~ /\/|/ 05:18
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Null regex not allowed␤at /tmp/3Ow3RTioBq:1␤------> say 'a/b' ~~ /\/|⏏/␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤ prefix or term␤ prefix or meta-prefix␤»…
dalek kudo/extend-dump: b176ca8 | (Rob Hoelz)++ | src/Perl6/Metamodel/BOOTSTRAP.pm:
More typo fixing
kudo/extend-dump: 25a9d6d | (Tobias Leich)++ | src/Perl6/Metamodel/BOOTSTRAP.pm:
Merge pull request #119 from hoelzro/nom

More typo fixing
kudo/extend-dump: 192b28f | coke++ | src/core/Range.pm:
RT#82312 - optimize size of numeric range.

Inspired by a patch from Gilbert Röhrbein [email@hidden.address]
kudo/extend-dump: 9bf1806 | coke++ | src/core/Range.pm:
RT#82312 numeric value of numeric range

Fix another edge case. pmichaud++
kudo/extend-dump: bce3d7d | (Geoffrey Broadwell)++ | src/ (2 files):
Merge branch 'nom' into extend-dump
Heather r: say 'a/b' ~~ /\/|\(|\)/ 05:21
p6eval rakudo 9bf180: OUTPUT«「/」␤␤»
Heather r: if 'a/b' ~~ /\/|\(|\)/ { say "A" } 05:22
p6eval rakudo 9bf180: OUTPUT«A␤»
Heather r: if 'a/b' ~~ /\// { say "A" }
p6eval rakudo 9bf180: OUTPUT«A␤»
Heather r: if 'ab' ~~ /\// { say "A" }
p6eval rakudo 9bf180: ( no output )
dalek kudo/extend-dump: 8d339e2 | (Geoffrey Broadwell)++ | src/core/Mu.pm:
Use hex for WHERE info in DUMP() and .DUMP-ID()
05:50
Heather r: if IO.e '.bashrc' { say 'e' } 06:15
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Missing block␤at /tmp/llfY_Kf3q0:1␤------> if IO.e ⏏'.bashrc' { say 'e' }␤ expecting any of:␤ method arguments␤ postfix␤ infix stopper␤ infix or meta-infix␤ parameterized block␤…
Heather r: if IO:e '.bashrc' { say 'e' } 06:16
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Missing block␤at /tmp/MLaP0LeeJ2:1␤------> if IO:e ⏏'.bashrc' { say 'e' }␤ expecting any of:␤ pair value␤ postfix␤ infix stopper␤ infix or meta-infix␤ parameterized block␤»…
Heather how to get home directory 06:31
sorear nr: say %*ENV<HOME> 06:35
p6eval rakudo 9bf180, niecza v24-35-g5c06e28: OUTPUT«/home/p6eval␤»
Heather sorear aha, thank you
sorear r: if '.bashrc'.IO.e { say 'e' } 06:36
p6eval rakudo 9bf180: OUTPUT«e␤»
sorear r: if '/etc/foo'.IO.e { say 'e' }
p6eval rakudo 9bf180: ( no output )
sorear r: if '/etc/passwd'.IO.e { say 'e' } 06:37
p6eval rakudo 9bf180: OUTPUT«e␤»
Heather ye ) solved it
Heather is reading How Perl 6 could kill us all from archive :) 06:38
cognominal r: $_=2 ; when 1|2|3 { .say; } 06:42
p6eval rakudo 9bf180: OUTPUT«2␤succeed without when clause␤ in block at src/gen/CORE.setting:452␤ in block at src/gen/CORE.setting:530␤ in block at /tmp/VCpsbtBTsM:1␤␤»
cognominal WTF
moritz a successful 'when' tries to exit its outer 'given'; might be related to this problem somehow 06:43
cognominal I thought one could use 'when' without a surrounding 'given' 06:45
r: given 2 { when 1|2|3 { .say; }}
p6eval rakudo 9bf180: OUTPUT«2␤»
cognominal r: $_=2 ; when 2 { .say; } 06:46
p6eval rakudo 9bf180: OUTPUT«2␤succeed without when clause␤ in block at src/gen/CORE.setting:452␤ in block at src/gen/CORE.setting:530␤ in block at /tmp/AF8wQJJ0va:1␤␤»
moritz where is it specced that 'for' is an alias for 'map', and thus lazy? 07:13
labster Heather: I read your Beauty and Freedom style guide. Looks okay, but seeing prefix:<!> do something other than "not" is too surprising. When you have all of unicode to work with, why not use ★, ☞, or ☺ as operators? 07:24
dalek kudo/extend-dump: faec85d | (Geoffrey Broadwell)++ | src/core/Mu.pm:
Handle even more low-level types in Mu.DUMP
07:25
moritz japhb: what does DUMP do? 08:17
FROGGS__ moritz: what do you say is the dba for perl 5's quote:sym<` `> ? 08:38
Heather labster huh, agreed :) 08:41
labster I like variant with stars :) gist.github.com/Heather/5269530 08:43
FROGGS std: use v5; say `abc` 08:46
p6eval std 86b102f: OUTPUT«===SORRY!===␤Confused at /tmp/J3N8j9ikSh line 1:␤------> use v5; say ⏏`abc`␤ expecting any of:␤ argument list␤ p5infix␤ prefix or term␤ statement modifier␤Parse failed␤FAILED 00:01 52m␤»
FROGGS \o/ 08:47
Heather ...?
dalek : dbb1c14 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
implement shell executes `...`
FROGGS Heather: see the commit, it just took 3 lines to implement that 08:48
lizmat FROGGS++ 08:49
labster way to go FROGGS++. Haven't seen rakudo beat std yet. 08:50
Heather but parrot is slow? :) 08:51
labster well yes, parrot is slow, but std is just a parser -- it doesn't actually run code
I meant rakudo v5 knows perl 5 better than STD does. 08:53
FROGGS labster: well, not quiet yet :o) 08:53
labster ... if we define knowing perl 5 as the tiny subset which FROGGS's code does better. 08:55
FROGGS hehe, ya >.<
kresike hello all you happy perl6 people 09:28
Heather krunen welcome to our anime world again 09:29
labster ^_^
labster kresike: I think Heather meant you (oh autocomplete). anyway, hello. 09:31
kresike Heather, labster o/ 09:32
census labster++
labster \o
kresike .oO(Anime world, now why didn't I think of that ? ☺) 09:33
Heather oh -_-' true
kresike it looks more like comic books, with weird superheroes 09:34
no fancy clothing or masks, just huge brains full of knowledge 09:35
Heather kresike well Perl is another kind of Manga, isn't it :P
kresike Ok, masak++ does have a towel as a hat, but I don't think that qualifies as a costume ☺ 09:36
Heather, Perl is another kind of everything ☺
Heather kresike everything is not that objective and could be boring 09:37
kresike and then Perl6 is another kind of Perl ...
Heather, yes, but you can decide whether it _is_ boring or not ! 09:39
labster is code obfuscation a form of ninjutsu?
Heather =) 09:40
grondilu is currently running cygwin on a temporary host 09:47
how do I get a vim syntax file for perl6?
FROGGS grondilu: why does someone still uses cygwin in the year 2013?
grondilu FROGGS: because it's not my machine and I can't install linux on it 09:48
FROGGS ahh, okay
moritz FROGGS: :dba for ` should be 'backticks' 09:53
Heather why cygwin then?
FROGGS moritz: thank you! 09:55
grondilu Heather: I used to use it long ago and it used to work fine for me. 09:58
Heather grondilu well but for what? what do you need from cygwin? 09:59
grondilu Heather: I want to do some perl6 stuff 09:59
Heather grondilu why not just on windows?
grondilu I have no idea how to do programming on windows
Heather )
grondilu and especially perl6
Heather is windows user 10:00
labster Cygwin is the least ancient of the archaic OSes I should probably port for File::Spec. Unless someone has a request for me to do VMS or Epoc or MacOS sooner.
tadzik it's great. We need you
Heather tadzik me?
dalek : 2178191 | (Tobias Leich)++ | lib/Perl6/P5Grammar.pm:
rename `...` to backticks
10:01
tadzik you, and all windows users :)
you never have too many of them
Heather tadzik why? :) 10:02
FROGGS perl6 -e 'use perl5; say "[ $^X ]"'
[ perl6]
ó.ò
Heather wow :D
FROGGS something eats up all the whitespace
FROGGS okay, not all ... 10:03
Heather perl6 -e "say hi" 10:03
tadzik Heather: because most of us program on unixes, with unix in mind, and things usually work a little bit differently on windows
and then suddenly a windows user comes by, says "it doesn't work", and there's no one to help him
Heather I'm unisex
e.g. use both in the same time XD 10:04
tadzik hehe
FROGGS tadzik: I am a windows user and dev too
(at least I have a windows box and did a lot with it in the past) 10:05
Heather well I do horrible ASP.NET WCF things in most of my workday ... 10:06
FROGGS but I have still no rakudo on it :/
ohh, poor Heather
Heather FROGGS want help? :P
FROGGS Heather: err, no, I dont like WCF much :o) 10:11
masak good forenoon, #perl6
census masak++ 10:13
Heather masak*=2 10:14
moritz good forenoon masak. Feel nagged about t2 reviews :-) 10:15
masak aye. today is a good day to dive back into them.
moritz is it a holiday in .se too? 10:18
grondilu rn: say [^3].bag
p6eval rakudo 9bf180, niecza v24-35-g5c06e28: OUTPUT«bag("0" => 1, "1" => 1, "2" => 1)␤»
masak moritz: yes. even though we are mostly godless individualists. 10:19
moritz masak: that's fine. If the christian god is really like most christians believe him to be, he'll love you for doing the right things, not for believing in him 10:20
tadzik blasphemy! :P 10:21
masak moritz: what I'm worried about is the bodily resurrection. what if I'm eaten by a cannibal, who finds Jesus and atones? who gets my molecules at the second coming? 10:22
tadzik: (how's that for blasphemy?) :P
moritz masak: science helps! atoms are indistinguishable. 10:23
masak .oO( but those were *my* atoms... )
moritz so it there's no "your atoms" or "your molecules"
masak I think I can recognize my own atoms, thank you very much!
*you* might not be able to... :P
moritz bakes kanelboller 10:24
masak .oO( I guess to you, all atoms look just alike, huh? huh? )
atomist! 10:25
:P
tadzik masak: better :>
Heather rn: say [^10].bag 10:26
p6eval rakudo 9bf180, niecza v24-35-g5c06e28: OUTPUT«bag("0" => 1, "1" => 1, "2" => 1, "3" => 1, "4" => 1, "5" => 1, "6" => 1, "7" => 1, "8" => 1, "9" => 1)␤»
Heather ...
moritz masak: even children are made of atoms!
Heather: !!!
Heather moritz what?
moritz Heather: just my standard response to bare '...' 10:27
masak Heather: ???
moritz or, "I could ask you the same" :-)
Heather moritz is it anyhow logical response?
moritz ask what?
masak Heather: the end point of this discussion is "please don't '...', it's annoying"
Heather: we'd like to know what you think, not what you don't say. 10:28
Heather masak so I was confused of .bag operation and don't understand what it makes
masak Heather: '...' is so wildly uninformative that it frustrates those of us in search of all truths.
moritz Heather: ask what the'...' is about
masak Heather: it makes a bag. :) 10:29
Heather a bag ...
masak Heather: a bag is a set which can contain members twice or more times.
tadzik argh
moritz a bag !!!
grondilu what's a difference between .bag and .Bag, btw?
masak a bag ???
grondilu: .bag needn't exist, if you ask me 10:30
moritz masak: have you ever seen "The Gamers"?
masak moritz: no.
Heather ...
moritz masak: you should. It's hilarious.
masak Heather: you're not really using it as a bag there, though.
r: say <h e a t h e r>.Bag
p6eval rakudo 9bf180: OUTPUT«No such method 'Bag' for invocant of type 'Parcel'␤ in block at /tmp/emQRlOmY4f:1␤␤»
masak r: say <h e a t h e r>.bag
p6eval rakudo 9bf180: OUTPUT«bag("h" => 2, "e" => 2, "a" => 1, "t" => 1, "r" => 1)␤»
masak Heather: does that explain it? 10:31
Heather so is it enum ut?
Heather *it 10:31
split somehow and map by numbering ... ?
moritz it's a data structure that counts for you how often an element is in it
like a hash with integer values, where setting the value to 0 deletes it 10:32
Heather moritz Now I get it !!!
moritz thank you :P
Heather feels myself not that sober but sleepy when there is no water to make tea or coffee :( 10:33
Heather r: ([^3],[^4]).bag 10:34
p6eval rakudo 9bf180: ( no output )
Heather r: say ([^3],[^4]).bag
p6eval rakudo 9bf180: OUTPUT«bag("0" => 2, "1" => 2, "2" => 2, "3" => 1)␤»
Heather how to filter sequence? 10:35
r: say ([^3],[^4]).bag.filter({ $_[2] > 1 }) 10:36
p6eval rakudo 9bf180: OUTPUT«No such method 'filter' for invocant of type 'Bag'␤ in block at /tmp/kOXOjkejsw:1␤␤»
moritz Heather: .grep, not .filter
Heather r: say ([^3],[^4]).bag.grep({ $_[2] > 1 }) 10:37
p6eval rakudo 9bf180: OUTPUT«Cannot call 'Real'; none of these signatures match:␤:(Mu:U \v: Mu *%_)␤ in method Real at src/gen/CORE.setting:873␤ in sub infix:<>> at src/gen/CORE.setting:2935␤ in sub infix:<>> at src/gen/CORE.setting:2933␤ in block at /tmp/i2aEDkcGue:1␤␤»
moritz r: say ([^3],[^4]).bag.list.perl
p6eval rakudo 9bf180: OUTPUT«("0", "1", "2", "3").list␤»
moritz that's what you're iterstaing over
r: say ([^3],[^4]).bag.pairs.perl
p6eval rakudo 9bf180: OUTPUT«("0" => 2, "1" => 2, "2" => 2, "3" => 1).list␤»
moritz r: say ([^3],[^4]).bag.pairs.grep(*.value > 1)>>.key 10:38
p6eval rakudo 9bf180: OUTPUT«0 1 2␤»
Heather r: say ([^3],[^4]).bag.pairs.
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Confused␤at /tmp/2OW2L7BLck:1␤------> say ([^3],[^4]).bag.pairs.⏏<EOL>␤ expecting any of:␤ dotty method or postfix␤»
Heather r: say ([^3],[^4]).bag.pairs
p6eval rakudo 9bf180: OUTPUT«0 2 1 2 2 2 3 1␤»
Heather r: say ([^3],[^4]).bag.pairs.grep(*.value > 1)>>.key
p6eval rakudo 9bf180: OUTPUT«0 1 2␤»
Heather moritz good. 10:53
sergot hi ! o/ 10:56
sergot [Coke]: it works. The only thing which has to be done is to set up cron jobs I think. 11:00
[Coke]: I mean feather.perl6.nl/~sergot/modules/ht...t/modules/ is all Perl 6
14:35 < tadzik> sergot: ping
14:35 < [Coke]> Is sergot's version going to become the main version at some
point? blocking on anything?
18:10 < masak> sergot++ got something up and running.
18:29 < [Coke]> arnsholt: I think the "selection of modules" testing is handled by sergot's emmentaler project.
11:56 < sergot> hi ! o/
End of Lastlog
Oh, Im sorry
masak sergocie! \o/ 11:01
sergot masaku ! \o/ :) 11:02
grondilu the cygwin version of rakudo is too old, I'm trying to install rakudo star on windows now
ok I'm told rakudo star has been installed, but how do I run it now? I try "perl6" on cmd.exe but it can't find it. 11:04
sergot r: use JSON::Tiny; 11:05
p6eval rakudo 9bf180: OUTPUT«===SORRY!===␤Could not find JSON::Tiny in any of: /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/site/lib, /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/vendor/lib, /home/p6eval/nom-inst/lib/parrot/4.10.0-devel/languages/perl6/lib, /h…
sergot It's why my modules.p6 doesn't work.
moritz star: use JSON::Tiny; 11:06
p6eval star 2013.02: ( no output )
moritz sergot: then install it. Or use star :-)
grondilu ok there is a shortcut in the start menu, but it's only the REPL 11:07
sergot Thanks, I'll. I just wanted to say why it didn't work. :)
not_gerd o/ 11:18
grondilu: you need to set your PATH variable manually
and for the record, there's nothing wrong with using cygwin
imo it's a convenient way to fill your needs on windows: git, make, cmake, vim, mingw64 toolchain,... 11:19
Heather hell no 11:20
cygwin is must die thing on windows
use mingw stuff instead
It's just few additional steps you need to setup all this things on windows 11:21
sometimes you even can get benefit
not_gerd Heather: for mingw to be useful, you need MSYS, which is just an outdated cygwin fork
there's nothing wrong with using cygwin as your development environment
it comes with both mingw and mingw64 cross toolchains
Heather not_gerd well, I'm not sure how MSYS is outdated but it works in-windows. Core difference and weird part of cygwin is some kind of environment separation. it's always better to use msisgit then cygwin git, it's better to use Strawberry perl then cygwin it's better to learn batch instead of using cygwin bash 11:24
not_gerd MSYS *is* cygwin 11:25
you can invoke the mingw toolchain from cygwin the same way you can invoke it from MSYS
Heather not_gerd well, it's part 11:26
not_gerd Heather: all you need to do to make cygwin into a proper windows dev environment superior to msys is to install the cross toolchain and set your PATH correctly 11:28
not_gerd (actually, PATH and LIBRARY_PATH) 11:29
Heather well 11:31
stackoverflow.com/questions/57627/msys-vs-cygwin
not_gerd "The main difference between mingw and cygwin is that mingw builds win32 binaries that are free from any extra dependencies."
which is not the case if you use the cross toolchain
Heather it's a case 11:32
not_gerd cygwin is always weird solution, at least for me because it's always trying to build unix environment and make all the relations with it 11:34
that is not what I want on windows, it's wrong way. 11:35
dalek : 9932d3e | (Tobias Leich)++ | lib/ (3 files):
nibble to the right quote-language
FROGGS Heather: well, that is the reason for using cygwin
to have the unix env under windows 11:36
not_gerd Heather: again, only if you use the cygwin toolchain instead of the mingw cross toolchain
you can do windows development on cygwin, the same way you can also do it on linux if you set up a cross compiler
Heather FROGGS no, I don't want to have separated unix env under windows, I want to add it's functional to windows env. 11:37
not_gerd cygwin makes that trivial and has the benefit that you're actually on the platform you're developing for
granted, not everything works out of the box(I'm looking at you, parrot), but that's not cygwin's fault
basically, you can't cross-compile parrot 11:38
FROGGS Heather: well, merging in the unix specific things is not possible IMO
Heather FROGGS it's possible.
FROGGS not for all but at least for all I need I've got windows version.
FROGGS well, since I dont know what you need I should believe you, ehh? 11:39
not_gerd Heather: but it's a huge PITA to keep everything up-to-date without a package manager
Heather FROGGS I use mingw ls, nano, emacs, msis git, whatever, NO CYGWIN mess, I used to use cygwin and I will Never use it again because it's separated
not_gerd I've done the MSYS game (and fixed parrot to work there), but imo it's just not worth thy hassle
if you use MSYS, you use cygwin - just a crippled version thereof 11:40
Heather not_gerd well it's windows way
not_gerd the problem with MSYS is that every application using it will com with it's own version of it
Heather not_gerd well it's not the same, at least they called different with the reason 11:41
Heather not_gerd what do you mean with "com with it's own version of it" ? 11:42
dalek pan style="color: #395be5">perl6-examples: 668fa6f | grondilu++ | rosalind/grondilu-mmch.pl:
Create grondilu-mmch.pl

  (rosalind) MMCH
11:45
not_gerd every application that depends on MSYS normally ships with it's own version of it
Heather not_gerd windows have no cygwin or msys by default - it's major True
not_gerd install MSYS git, Strawberry perl, $foo and you'll get multiple copies of the toolchain
Heather not_gerd that's how maintainers deploy it 11:46
FROGGS std: use v5; open(try, "/dev/null")
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
FROGGS std: use v5; öpen(try, "/dev/null") 11:47
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
FROGGS damn, std is cheating here :/
not_gerd my point is that you can do everything you can do with MinGW and MSYS with Cygwin as well
the latter comes with a usable package manager, the former does not
FROGGS I guess I have to ask in a perl 5 channel if I wanna know waht subs can take/declare sigilless variables? 11:53
moritz FROGGS: all of them
$ perl -wE 'sub foo { }; foo(BAR)' 11:54
FROGGS ya, if BAR is declared I can pass it to everything...
moritz my example didn't declare BAR
FROGGS but open() would declare BAR
moritz no
FROGGS hmmm 11:55
what is BAR then?
$ perl -wE 'sub foo { print $_ }; foo(BAR)'
Use of uninitialized value $_ in print at -e line 1.
moritz oh wait, I wasn't testing with "use strict"
FROGGS perl -wE 'sub foo { print shift }; foo(BAR)'
BAR
moritz it's a bareword
FROGGS perl -wE 'sub foo { print shift }; foo(BAR)'
BARfroggs@TL02L-R8RXTCW-linux:~/dev/v5$ perl -wE 'use strict; sub foo { print shift }; foo(BAR)'
Bareword "BAR" not allowed while "strict subs" in use at -e line 1.
Execution of -e aborted due to compilation errors.
hmmm
so I have to allow barewords when strict isnt in use... 11:56
sounds doable
moritz FROGGS: ah, all subs that have a * prototype accept barewords
FROGGS moritz: and a bareword is more like a sub than a variable? since I cant assign to a bareword... 12:00
moritz FROGGS: it's a glob 12:01
FROGGS will read some docs
moritz perldoc perldata, "Typeglobs and Filehandles"
FROGGS moritz: thanks again :o)
moritz kein problem :-) 12:02
FROGGS *g* 12:02
moritz my newest idea: write an email reminder in perl 6 12:08
it works like this: you send somebody an email, and include a BCC: [email@hidden.address]
and then it will send you an email two month later, saying "two month ago, you asked me to remind you about this email" 12:09
Heather moritz old idea... but I wonder if there are some implementations 12:13
moritz that could be just mail task for task manager but with easier interface to add 12:14
moritz I guess there are some ... www.google.ru/search?q=web+service...+reminders 12:16
moritz Heather: I never claimed it was a new idea :-) 12:19
masak moritz: I like the idea. I would use such a thing. 12:31
moritz: in fact, the module I'll be writing for Nomic and mishu could be used to implement that, too. 12:32
I'm currently looking for a good name for that module. maybe someone here can help?
should be something to do with observers.
'use Observer;' # hmm 12:33
moritz Look.pm
masak a bit too cute :)
moritz Object::Watcher; # not quite serious either
masak though I was toying with Observatory.pm myself
Object::Observer might actually be nice. 12:34
Heather O::O
masak :)
Heather++
moritz adding 'Object::' to a module name rarely makes it clearer though
masak Heather: that alone almost convinces me to go with that one.
Heather masak >_<
masak hm, is there any prior art on CPAN?
Object::ID
Object::KVC 12:35
but most on page one were <something>::Object
Reactive.pm could work too. more intentional, perhaps. 12:36
Heather Octo::Cat 12:37
masak silently points to the "too cute" bucket ;)
Heather Object::Inspector ? 12:40
masak sounds too much like debugging. 12:41
this is for a live, running application.
Heather hm...
masak maybe Reactionary.pm
Heather not clear for me
masak (because, you know, Perl 6 is disruptive)
and it's a pun on "reactive programming" 12:42
ok, #perl6, I'll be gone for a few hours. (socializing) see you this evening. :) 12:43
&
Heather &
...
what & means 12:44
my imagination fails on it and you say that '...' is not clear after it. 12:45
lizmat Heather: wrt to &, think shell and running programs in the background 12:47
hoelzro goede morgen, #perl6 12:48
PerlJam good morning #perl6
Heather lizmat yes I use it ususally for editors but how to get it here...
hoelzro PerlJam hey ! 12:49
PerlJam greetings Heather
Heather sometimes in the end of the week you really want to feel stupid... 12:50
Heather is planning to blog about my new Style Guide 12:53
hoelzro Heather: you have a Perl 6 style guide? 12:55
hoelzro really wants to see one, since his own style has evolved =)
Heather hoelzro yes ) 12:56
hoelzro github.com/Heather/Beauty-and-Freedom
PerlJam nice name
hoelzro \o/
Heather PerlJam thank you :P 12:57
name is very reasonable :D
star if you like :D 12:59
Heather see you 13:01
adu_ still getting the error 13:27
hoelzro how can I compare two objects by identity in NQP? 13:42
I'm still trying to figure out the best way to get callsame and Code objects working 13:43
because adding postcircumfix:<( )> to Code doesn't work =/
FROGGS hoelzro: you tried =:= ? 13:45
adu_ FROGGS: I'm so close to isolating the issue 13:49
FROGGS adu_++ 13:50
adu_ I've gotten it down to 3 rules. If I put them in a file, then use FileA; FileA.parse() then it fails. If I run it in the same file, it succeeds. like this:
FROGGS if I should have a look you might prepare a gist/repo including a file to parse and a test script to invoke etc 13:51
adu_ n: grammar G { token TOP {^ <ident> $}; token ident { <.ident-first> <.ident-rest>* }; proto token ident-first {*}; token ident-first:sym<under> { '_' }; token ident-first:sym<alpha> { <.alpha> }; proto token ident-rest {*}; token ident-rest:sym<alpha> { <.ident-first> }; token ident-rest:sym<digit> { <.digit> }; }; say G.parse('test')
p6eval niecza v24-35-g5c06e28: OUTPUT«「test」␤ ident => 「test」␤␤»
adu_ that works
but not if you "use" the grammar
FROGGS hmmm
adu_ and I can't figure out why
moritz how does it not work? 13:53
FROGGS adu_: it is working here
I made a G.pm, pasting the grammar there, then a test.pl, putting "use G; say G.parse('test')", and then executed: PERL6LIB=. perl6 test.pl 13:54
using rakudo that it
is*
adu_ ok 14:01
gist.github.com/andydude/5271051
adu_ I haven't tested rakudo 14:05
rakudo doesn't seem to like protos either
FROGGS PERL6LIB=. perl6 CTest.pl6 'test' 14:07
「test」
ident => 「test」
rakudo^^
adu_ FROGGS: the bug is with niecza 14:08
FROGGS adu_: my niecza gives the same bug you posted
adu_ actually, if I run the same grammar in rakudo, I get "regex assertion not terminated by angle bracket at line 6, near "-first> <.""
FROGGS adu_: I dont get an error with rakudo
adu_ but if I replace s/-/_/, and s/{*}/{ {*} }/, then it works in rakudo 14:10
FROGGS adu_: how old is your rakudo? 14:11
adu_ This is Rakudo Perl 6, version 2010.11-15-gfedc117 built on parrot 2.10.1 RELEASE_2_10_1-679-g9bec614
FROGGS perl6 --version
This is perl6 version 2013.02.1-164-gb972ca3 built on parrot 4.10.0 revision RELEASE_4_10_0
adu_ heh
colomon the - character used to be illegal in grammars in rakudo, but it works fine now.
adu_ maybe I should upgrade
FROGGS ohh yeah 14:12
adu_ well I'm using yesterday's niecza
but I don't intend on using rakudo, I was intending on using niecza
FROGGS well, there is not so much development going on on niecza, which is sad
adu_ oh
I thought it was visaversa 14:13
FROGGS no
colomon adu_: it was viceversa (sort of) about 18 months ago. 14:14
FROGGS rakudo is the one which gets all the attention these days
colomon Rakudo was in the middle of a major rewrite, and Niecza was under pretty active development.
but right now Rakudo gets more patches in a day than Niecza gets in a month.
rn: say +Range 14:15
p6eval rakudo 9bf180: OUTPUT«use of uninitialized value of type Range in numeric context in block at /tmp/fiTHCUvguI:1␤␤0␤»
..niecza v24-35-g5c06e28: OUTPUT«Unhandled exception: Attempted to access slot $!min of type object for Range␤ at /home/p6eval/niecza/lib/CORE.setting line 1737 (List.gist @ 5) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3060 (Range.Numeric @ …
colomon rn: say +Complex
p6eval niecza v24-35-g5c06e28: OUTPUT«(Complex)␤»
..rakudo 9bf180: OUTPUT«use of uninitialized value of type Complex in numeric context in block at /tmp/pId3RpRP55:1␤␤0␤»
colomon hurm
hoelzro FROGGS: ah, good point! 14:16
adu_ colomon: apparently I'm behind the times
dalek ast: 1006b9f | (Solomon Foster)++ | S02-types/range.t:
Fudge for niecza.
14:17
adu good to know 14:19
upgrading now
adu what is the story behind the name "CORE.setting" 14:22
becuase I would have use the name library, not setting 14:23
adu s/use/used/ 14:23
moritz it's a special library
one that acts as an outer scope to your program
and we call that kind of library a "setting"
dalek ast: 1afab0c | (Solomon Foster)++ | S06-multi/syntax.t:
Fudge for niecza.
14:24
japhb moritz, The best way to describe DUMP is by example. I'd say build a Rakudo in that branch, and then do something like: perl6 -e 'my $map := (1 ... *).map: 2 + *; say DUMP($map);' 14:26
adu moritz: its just that the word setting reminds me of boolean, and it seems silly to have an entire file devoted to a boolean 14:28
moritz well, many words have more than one possible meaning
think of the setting in a theater play instead 14:29
adu oh ok
or "dinner setting"
when I think of library, I think of Beauty and the Beast 14:30
but that's a different story ;)
adu how do I add something to the path? 14:46
for example, the current directory?
oh PERL6LIB, n/m
FROGGS right
adu YEY 14:47
rakudo works
now for something more complicated than ident
moritz or -I. on the command line 14:48
or use lib '.'
adu moritz: rakudo doesn't like that option on it's --help 14:49
s/like/list/
dalek kudo/nom: 8976369 | moritz++ | src/Perl6/Compiler.nqp:
report -I and -M options in --help output
14:51
japhb moritz, did you give the branch a try? 14:54
moritz japhb: no, distracted by other stuff
japhb moritz, Ah, OK. 14:55
dalek osystem: ff4c42b | tadzik++ | META.list:
Add File::HomeDir
14:56
tadzik gosh, I was tired of reinventing it all the time
moritz tadzik++ 14:57
moritz is patching Email-Simple
tadzik also, it just occured to me that panda could be nicely implemented in a git-like fashion 14:58
FROGGS cool, file::homedir!
tadzik so it's actually composed of tools like panda-fetch, panda-build, panda-test, panda-install
FROGGS tadzik++
tadzik then you could easily add to that, panda-create, to create a new module for example
adu what does "Method 'ast' not found for invocant of class 'NQPMu'" mean?
tadzik adu: that you're messing with internals, accidentally or not :)
where did that happen?
adu in my C lexer 14:59
tadzik is there a code to look at?
adu gist.github.com/andydude/5268163 15:00
adu tadzik: ok, the line that if I comment, it removed the error has ":radix(10)" in it 15:07
is that internals?
I don't understand why that would cause an error 15:08
tadzik hmm
me neither
adu but if i comment those lines (with :radix in it), then the error goes away
tadzik puzzling :( I don't know 15:09
r: sub say(*@a) { OUTER::say('Simon says: ', |@a) }; say "foo"
p6eval rakudo 9bf180: OUTPUT«No such method 'Any' for invocant of type 'Parcel'␤ in sub say at /tmp/yQoVQMkGXl:1␤ in block at /tmp/yQoVQMkGXl:1␤␤»
tadzik what am I doing wrong?
adu ooooo 15:10
if I change :radix(10) to :radix<10> then it works
colomon adu: was just going to suggest that.
:)
tadzik huh
colomon mind you, it was just asking "what's different about this bit?"
adu so it must parse the parens as function arguments instead of pair-value
I thought :radix(10) always meant pair 15:11
good to know
colomon adu: it might be a Rakudo bug, mind you. 15:13
adu oh
how do I tell?
moritz the difference is that :radix<10> creates a Str as value 15:15
dalek ast: 8f16996 | coke++ | S04-phasers/enter-leave.t:
add tests for RT #113548
15:40
tadzik > pandabrew panda install Acme::Meow 15:42
==> You seem to have updated Rakudo, and panda is still built for the old one.
Do you wish to rebootstrap panda now? [Y/n]
this may come in handy :)
so I only wrote File::HomeDir to realise that pandabrew needs to be dependency-free :/ 15:43
daxim bundle it
tadzik yeah
I'm now proceeding with App::FatPacker :) 15:44
tadzik ...for which the naive approach doesn't quite work :/ 15:49
mst tadzik: failing tests, bugfixes, whatever, very welcome 15:54
unless it's a port of fatpacker
in which case I disclaim all knowledge of your mission :)
grondilu rn: sub foo { "bar" }; say foo xx 3; 15:57
p6eval niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'xx' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) ␤ at /home/…
..rakudo 897636: OUTPUT«===SORRY!===␤Undeclared routine:␤ xx used at line 1␤␤»
grondilu this is annoying
rn: sub foo { "bar" }; say foo() xx 3;
p6eval rakudo 897636, niecza v24-35-g5c06e28: OUTPUT«bar bar bar␤»
grondilu I thought I wouldn't have to be explicit with a () 15:58
tadzik mst: naah, I meant App::FatPacker for Perl 6
so yeah, a port
mst right. no bloody idea then, 99% of fatpacker is VM specific magic I suspect 15:59
tadzik I was merely looking for trivial solutions to trivial cases 16:00
dalek osystem: 8f7b0a8 | tadzik++ | META.list:
Add pandabrew
16:01
tadzik testing welcome
kresike bye folks 16:21
adu r: grammar G { 16:29
token TOP {^ <integer-constant> $};
proto token integer-constant {*};
token integer-constant:radix<8> { <octal-constant> <integer-suffix>* };
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Unable to parse expression in block; couldn't find final '}'␤at /tmp/RrEboMbZum:1␤------> grammar G {⏏<EOL>␤ expecting any of:␤ statement list␤»
adu token integer-constant:radix<10> { <decimal-constant> <integer-suffix>* };
token integer-constant:radix<16> { <hexadecimal-constant> <integer-suffix>* };
token octal-constant { '0' <odigit>* };
token decimal-constant { <nzdigit> <digit>* };
token hexadecimal-constant { <.hexadecimal-prefix> <xdigit>* };
token hexadecimal-prefix { '0' <[xX]> };
token nzdigit { <[1..9]> };
token odigit { <[0..7]> };
clkao win 36
adu }; say G.parse('0');
oops sorry
r: grammar G { token TOP {^ <integer-constant> $}; proto token integer-constant {*}; token integer-constant:radix<8> { <octal-constant> <integer-suffix>* }; token integer-constant:radix<10> { <decimal-constant> <integer-suffix>* }; token integer-constant:radix<16> { <hexadecimal-constant> <integer-suffix>* }; token octal-constant { '0' <odigit>* }; token decimal-constant { <nzdigit> <digit>* }; token hexadecimal-constant { <.hexadecimal 16:30
p6eval rakudo 897636: OUTPUT«===SORRY!===␤regex assertion not terminated by angle bracket␤at /tmp/6WYpRHDXh4:1␤------> oken hexadecimal-constant { <.hexadecima⏏<EOL>␤ expecting any of:␤ pair value␤ quote words␤ infix stopper␤ …
adu that's wierd, when I run that I get #<failed match> 16:32
colomon adu: your paste got cut off 16:33
adu oh 16:33
r: grammar G { token TOP {^ <intc> $}; proto token intc {*}; token intc:radix<8> { <octalc> <integer-suffix>* }; token intc:radix<10> { <decimalc> <integer-suffix>* }; token intc:radix<16> { <hexc> <integer-suffix>* }; token octalc { '0' <odigit>* }; token decimalc { <nzdigit> <digit>* }; token hexc { <.hex-prefix> <xdigit>* }; token hex-prefix { '0' <[xX]> }; token nzdigit { <[1..9]> }; token odigit { <[0..7]> }; }; say G.parse('0'); 16:34
p6eval rakudo 897636: OUTPUT«#<failed match>␤»
colomon r: gist.github.com/colomon/5271962
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Bogus statement␤at /tmp/0S7Focy9bH:1␤------> <BOL>⏏gist.github.com/colomon/5271962␤ expecting any of:␤ statement list␤ prefix or term␤ prefix or meta-prefix␤»
colomon r: gist.github.com/colomon/5271962 16:35
p6eval rakudo 897636: OUTPUT«#<failed match>␤»
colomon there you go
it's a lot easier to read that way.
adu thats a neat trick
colomon also, do you know about Grammar::Debugger and Grammar::Tracer?
adu colomon: thanks 16:36
nope
colomon they are ESSENTIAL to this sort of work.
adu ok
colomon well, at least for the sake of your sanity.
adu I lost my sanity awhile ago
colomon adu: do you have panda working? 16:38
adu what's panda?
apparently i've been away since 2010
moritz a module installer
colomon tadzik++'s module installer
moritz one that actually works most of the time :-)
adu cool 16:39
I have ufo
colomon adu: github.com/tadzik/panda/ 16:40
moritz: panda's actually not installing for me on Linux. :( 16:41
moritz :(
colomon: it usually works for me when there's no old installation lying around, and i ran 'git clean -xdf' in panda's source dir 16:42
colomon gist.github.com/colomon/5272004 16:43
moritz that's really weird 16:44
colomon and (comment added to show) that path *is* in my $PATH
adu: while panda and the Grammar modules are very worthwhile, Grammar::Tracer is not particularly helpful in this case: gist.github.com/colomon/5272019 16:46
moritz I believe the tokens of a proto token must be of the form token integer-constant:sym<...> 16:51
not :radix<...>
colomon moritz: std.pm has examples like token statement_prefix:sink 16:52
but you're definitely right that that is the source of the problem here.
moritz well, std != rakudo
colomon moritz: true. 16:53
colomon and you're quite right, token integer-constant:sym<8> works in rakudo 16:53
radix<8> works in Niecza. ;) 16:54
japhb_ moritz, I gist'ed the DUMP() effects for you: gist.github.com/anonymous/a55a413400a33cf13c45
colomon r: gist.github.com/colomon/5271962 # adu, this works 16:55
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/sleQZast0p:1␤------> https⏏://gist.github.com/colomon/5271962 # adu␤ expecting any of:␤ argument list␤ postfix␤ infix stopper␤ infix or meta-infix␤ st…
colomon r: gist.github.com/colomon/5271962 16:56
p6eval rakudo 897636: OUTPUT«「0」␤ integer-constant => 「0」␤ octal-constant => 「0」␤␤»
colomon .... as long as I don't include the # adu, this works at the end!
moritz p6eval is pretty restrictive when parsing gist URLs
FROGGS colomon: in rakudo there is a pattern match for token <name>:sym<* for example, so it really requires :sym
colomon n: gist.github.com/colomon/5271962/59...f15f362ce0 16:57
p6eval niecza v24-35-g5c06e28: OUTPUT«===SORRY!===␤␤Confused at /tmp/4cZZzCSwjE line 1:␤------> https⏏://gist.github.com/colomon/5271962/59213␤␤Undeclared routine:␤ 'https' used at line 1␤␤Parse failed␤␤»
colomon ah, so p6eval can't handle a specific revision. pity. 16:58
moritz [Coke]++ # going through RT, adding tests 17:00
grondilu rn: say 2 X* map &sqrt, ^5; 17:04
p6eval niecza v24-35-g5c06e28: OUTPUT«0 2 2.8284271247461903 3.4641016151377544 4␤»
..rakudo 897636: OUTPUT«␤»
colomon moritz: which perl6 executable am I supposed to add to my path?
grondilu rakudobug?
grondilu rn: say 2 X* my @ = map &sqrt, ^5; 17:05
p6eval niecza v24-35-g5c06e28: OUTPUT«0 2 2.8284271247461903 3.4641016151377544 4␤»
..rakudo 897636: OUTPUT«0 2 2.82842712474619 3.46410161513775 4␤»
colomon grondilu: most likely yes
moritz colomon: the installed one 17:06
(which looks fine in your gist)
colomon rakudo/install/bin ?
okay, so that's not my problem with panda
moritz erm, what's the rakudobug?
r: say (map &sqrt, ^5) X** 2 17:07
p6eval rakudo 897636: OUTPUT«0 1 2 3 4␤»
grondilu r: say 2 X* map &sin, ^5;
p6eval rakudo 897636: OUTPUT«␤»
grondilu n: say 2 X* map &sin, ^5; 17:08
p6eval niecza v24-35-g5c06e28: OUTPUT«0 1.682941969615793 1.8185948536513634 0.28224001611973443 -1.5136049906158564␤»
grondilu see?
moritz r: say 2 X* map( &sin, ^5 )
p6eval rakudo 897636: OUTPUT«␤»
moritz r: say map(&sin, ^5).perl
p6eval rakudo 897636: OUTPUT«(0e0, 0.841470984807897e0, 0.909297426825682e0, 0.141120008059867e0, -0.756802495307928e0).list␤»
moritz r: say (2 X* map( &sin, ^5 ))
p6eval rakudo 897636: OUTPUT«␤»
colomon bizarre. 17:09
moritz maybe sink bug
grondilu r: say 2 X* my @ = map &sin, ^5;
p6eval rakudo 897636: OUTPUT«0 1.68294196961579 1.81859485365136 0.282240016119734 -1.51360499061586␤»
grondilu ^ that's a temporary fix
r: say 2 X* eager map &sin, ^5; 17:10
p6eval rakudo 897636: OUTPUT«0 1.68294196961579 1.81859485365136 0.282240016119734 -1.51360499061586␤»
grondilu ^ or this
moritz there's no mention of 'sink' in the generated PIR
so more likely some other list craziness
colomon what I don't understand is how it can go that wrong. 17:13
tadzik colomon: did you try rebootstraping panda?
colomon tadzik: I tried blowing it away entirely and grabbing it from github again. same issue 17:13
tadzik huh
blowing away site/?
the one it cannot load?
also: try pandabrew :)
colomon site/ ?
tadzik in file '/home/colomon/tools/rakudo/install/lib/parrot/4.10.0-devel/languages/perl6/site/lib/Shell/Command.pir' 17:14
colomon gotcha
tadzik rebootstrap probably does that
yeah, it should
colomon \o/ 17:15
blew it away, now apparently making progress again.
colomon success! tadzik++ 17:17
tadzik colomon: did you use pandabrew? :) 17:18
use pandabrew
I think it's awesome
colomon tadzik: no, trying to find the repo now
colomon got sidetracked looking at his own open source contributions graph for the last year.... 17:19
tadzik: needs a readme.
colomon trying now... 17:22
dalek ast: 7629622 | coke++ | S05-substitution/subst.t:
add a test for RT #83484
17:28
colomon tadzik: basics seem to work.
hoelzro ok, I updated the callsame ticket with my findings: rt.perl.org/rt3/Ticket/Display.html?id=117377 17:42
hopefully someone more familiar with Rakudo can help now =)
moritz retupmoca++ # Email::Simple, and being responsive to bug reports and pull requests 17:53
colomon remembers he meant to try Email::Simple, back before the whole thing where panda blew up for him. 17:57
japhb_ moritz, did the DUMP gist make sense to you? 18:09
moritz japhb_: kinda :-) 18:10
I think I now know its purpose 18:11
dalek ast: 8c7a191 | coke++ | S04-phasers/enter-leave.t:
add test for RT #115998
18:12
ast: b86ca3e | coke++ | S04-phasers/enter-leave.t:
fix typo
japhb_ moritz, more interesting for some folks will be what it does for user-defined objects, because key to its design is exposing hidden attributes, unlike say .perl. 18:13
I expect it will get much use in debugging.
[Coke] moritz: why did you mark 77338 as testneeded? 18:14
japhb_ I still need to explore more of the built-in types to see if there are any the current code can't dump properly, though getting the various *Iter classes and Junction correct both involved a lot of subtle-bug-hunting. 18:15
And Parcel v. RPA. >.<
The other big thing to do is teach it to automatically handle circular structures. (Right now ListIter is special cased to break the loop with its associated List.) 18:16
[Coke] r: say fail() ~~ Failure 18:17
p6eval rakudo 897636: OUTPUT«No exception handler and no message␤␤current instr.: 'throw' pc 350791 (src/gen/CORE.setting.pir:153082) (src/gen/CORE.setting:9365)␤called from Sub 'sink' pc 382444 (src/gen/CORE.setting.pir:165429) (src/gen/CORE.setting:10630)␤called from Sub 'MAIN' pc 381 (src/g…
[Coke] r: say (fail ~~ Failure)
p6eval rakudo 897636: OUTPUT«use of uninitialized value of type Failure in string context in block at /tmp/jUomBZfSIX:1␤␤No exception handler and no message␤␤current instr.: 'throw' pc 350791 (src/gen/CORE.setting.pir:153082) (src/gen/CORE.setting:9365)␤called from Sub 'sink' pc 382444 (src/…
japhb_ Which reminds me -- is there any NQP or Perl 6 code out there right now which handles arbitrary directed object graph traversal? (As opposed to C code in e.g. the serializer.)
[Coke] how does one verify that one obtained a failure result?
moritz [Coke]: ~~ Failure 18:18
[Coke]: it didn't work in your case because fail() tries to return from the outer routine
and returns a Failure in its place
so you have to do it like 18:19
r: say (sub { fail('foo') })() ~~ Failure
p6eval rakudo 897636: OUTPUT«True␤»
[Coke] r: sub Int foo { fail() }; say foo ~~ Failure 18:20
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Missing block␤at /tmp/_Xyz0d06Ka:1␤------> sub Int ⏏foo { fail() }; say foo ~~ Failure␤ expecting any of:␤ statement list␤ prefix or term␤ prefix or meta-prefix␤ new name to be defined…
[Coke] r: our Int sub foo { fail() }; say foo ~~ Failure
p6eval rakudo 897636: OUTPUT«use of uninitialized value of type Failure in string context in block at /tmp/YA9ZDI8cgM:1␤␤Too many positional parameters passed; got 1 but expected 0␤ in sub foo at /tmp/YA9ZDI8cgM:1␤ in block at /tmp/YA9ZDI8cgM:1␤␤»
[Coke] r: our Int sub foo { fail('a') }; say foo ~~ Failure
p6eval rakudo 897636: OUTPUT«use of uninitialized value of type Failure in string context in block at /tmp/Kr8Fxkhum2:1␤␤Too many positional parameters passed; got 1 but expected 0␤ in sub foo at /tmp/Kr8Fxkhum2:1␤ in block at /tmp/Kr8Fxkhum2:1␤␤»
moritz [Coke]: use foo() 18:21
otherwise it'll parse as foo(~(~Failure)) or so
[Coke] r: our Int sub foo { fail('a') }; say foo() ~~ Failure
p6eval rakudo 897636: OUTPUT«a␤ in method sink at src/gen/CORE.setting:10630␤ in method BUILDALL at src/gen/CORE.setting:801␤ in method bless at src/gen/CORE.setting:743␤ in method new at src/gen/CORE.setting:728␤ in method new at src/gen/CORE.setting:726␤ in sub foo at /tmp/Uu3wdrYiKc:1…
moritz sink bug
*sadface*
[Coke] RT 64990 if you want to add the sink info. 18:22
actually, I will.
moritz r: our Int sub foo() { fail 'a' }; my $x = foo() 18:23
p6eval rakudo 897636: OUTPUT«a␤ in method sink at src/gen/CORE.setting:10630␤ in method BUILDALL at src/gen/CORE.setting:801␤ in method bless at src/gen/CORE.setting:743␤ in method new at src/gen/CORE.setting:728␤ in method new at src/gen/CORE.setting:726␤ in sub foo at /tmp/XQ1xSK6xqb:1…
moritz r: our Int sub foo() { fail 'a' }; my $x = foo(); 1
p6eval rakudo 897636: OUTPUT«a␤ in method sink at src/gen/CORE.setting:10630␤ in method BUILDALL at src/gen/CORE.setting:801␤ in method bless at src/gen/CORE.setting:743␤ in method new at src/gen/CORE.setting:728␤ in method new at src/gen/CORE.setting:726␤ in sub foo at /tmp/crSle3hirL:1…
colomon moritz: wait, what does Email::Simple actually do? 18:29
dalek : f0ba6e0 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
add stubs for all special variables
moritz colomon: parse email headers, mostly 18:43
colomon moritz: ah. I was hoping for more.
dalek : f44e1e3 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
add special var $0 (program name)
18:46
adu_ is installing panda 19:17
adu does TAP::Harness come with rakudo? 19:19
adu which is more common extension? .pm or .pm6? 19:21
I wish it would ask before installing 19:23
diakopter star: use TAP::Harness; 19:24
p6eval star 2013.02: OUTPUT«===SORRY!===␤Could not find TAP::Harness in any of: /home/p6eval/star/lib/parrot/4.10.0/languages/perl6/site/lib, /home/p6eval/star/lib/parrot/4.10.0/languages/perl6/vendor/lib, /home/p6eval/star/lib/parrot/4.10.0/languages/perl6/lib, /home/p6eval/.perl6/2013.02.1/l…
adu hmm
lizmat loves looking at FROGGS P5 commits
adu the directory where panda installed to is 15 directories deep 19:25
ok what was I supposed to use panda for? 19:26
o right, the debugger 19:27
colomon panda install Grammar::Debugger # Grammar::Tracer comes along with it 19:29
adu Obsolete use of | or \ with sigil on param $args? 19:30
timotimo where does that happen? 19:32
nowadays you do |args instead of |$args
adu do I put use Grammar::Debugger; in the grammar or the test? 19:33
timotimo forgets
adu timotimo: gist.github.com/andydude/5273055 19:34
timotimo interesting. i guess i can try to fix that
colomon adu: in the grammar 19:34
adu colomon: oh that explains why it's not working :) 19:35
ok I did that and it says TOP 19:37
what does that mean
moritz Grammar::Tracer at east is lexically scoped
adu is that the rule it's currently running?
timotimo yeah, just replacing the |$args with |args twice seems to work (at least the tests pass. if it doesn't actually work, i blame the test cases)
colomon adu: it should look something like this: gist.github.com/colomon/5273087 # my tweaked version of your grammar from earlier today 19:38
adu colomon: o thank you
where did you put the grammar? 19:39
gist.github.com/colomon/5271962?
colomon adu: yes 19:40
I think that's the same version.
timotimo will take a bit for jnthn to apply the pullrequest, though, i think
adu I keep getting "Cannot modify an immutable value" 19:44
colomon adu: when you do what? 19:45
adu when I try CInteger.parse('0') 19:47
it just stops at TOP, then the next line whatever I enter it says that
gist.github.com/andydude/5273148 19:48
I tried modifying my grammar to look more like yours
adu so I do perl6 -I. \n use C::CInteger; \n say C::CInteger.parse('0') \n 19:50
then I see "TOP \n > " and a press enter, then get "Cannot modify an immutable value"
colomon sounds like you're using Grammar::Debugger? yes, I see that's what you've said above 19:52
I was showing you the output from Grammar::Tracer
adu oh 19:53
that's why its different
colomon type h for the list of commands from the >
I've never really used Grammar::Debugger, I always just work from the Tracer.
though Grammar::Debugger is much more powerful.
adu YEY now I get the tree with Tracer 19:54
thanks :)
colomon I'm getting the Cannot modify an immutable value error in the Debugger too, possibly a Grammar::Debugger bug? 19:56
adu I dunno how it's supposed to work, its the first time I've used it :P
FROGGS .oO( Grammar::Bugger? )
colomon looks to me like Grammar::Debugger may have been broken by recent changes to Rakudo. 19:57
colomon does not know which changes
lue
.oO(try running the Grammar::Debugger using script through perl6-debug)
20:00
FROGGS r: "abc" ~~ /\w+/; say $/ 20:02
p6eval rakudo 897636: OUTPUT«「abc」␤␤»
FROGGS r: "abc" ~~ /\w+/; say ~$/
p6eval rakudo 897636: OUTPUT«abc␤»
japhb_ What's the sanest way to keep a key-value hash within the dynamic scope of a single call to a mutually-recursive set of routines, if the hash should be unique for each top-level call (i.e. each time control flow moves from outside the mutually-recursive set to inside, from any of the entry points into that mutually-recursive set)?
FROGGS japhb: %*MY_HASH? 20:03
japhb_ FROGGS: Declared exactly how?
FROGGS japhb_: within a grammar: :my %*MY_HASH := ...
it will be available in token which are used by this token 20:04
should be the same with methods, just remove the : before 'my'
japhb_ FROGGS, I would think that only works when there's only one entry point into the mutually recursive set.
i.e. that you can define a "topmost" member of the MRS. 20:05
FROGGS hmmm, dunno how to handle that
dalek : 3fae0b2 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
add some describtion to special vars
20:06
: c30f586 | (Tobias Leich)++ | lib/Perl6/P5Actions.pm:
implement $& ($MATCH)
japhb_ is beginning to think he may have to force a single routine to be the sole entry point from the outside world (a sort of control flow choke point), and from there dispatch to the proper routine in the MRS. :-/ 20:07
Gah, that's going to have crappy affordance. 20:08
"There's a more obvious routine *right there*, why can't I just call it directly?"
lue Are you sure you can't have the hash be outside any of the routines? 20:10
japhb_ lue: In theory it can be *declared* outside, it's trashing the contents upon crossing the outside/inside barrier that causes me trouble with that solution. 20:11
(Without, that is, trashing the contents during mutual recursion as well.) 20:12
adu colomon: FROGGS: thanks so much
colomon sorry 'bout that, Colloquy went all funny on me. 20:13
japhb_ lue: The other problem (though of course farther out, given current implementations) is when you have multiple calls from the outside to the inside "live" at the same time, so they can't share the same copy of the hash. 20:14
Essentially, it's a private cache for the MRS that I'm looking for.
lue would %hash is copy help in any way if the hash were declared outside? 20:17
japhb_ Hmmm, that could possibly work actually. I'd think you'd create a lot of GC pressure that way, though. 20:18
lue I'd suggest %hash is rw to avoid all the copying, but you stated that destroying the outside hash is a Bad Idea.
japhb_ lue, if it's 'is rw', how does it get reset on first call to one of the routines? 20:19
lue
.oO(multi sub recurse1(%hash is copy) { ... }; multi sub recurse("internal", %hash is rw) { ... }; perhaps to avoid *all* the copying)
s/recurse\(/recurse1(/ 20:20
japhb_ Hmmmm
japhb_ begins to think evil thoughts about dispatcher overrides. 20:21
lue And then perhaps a macro to avoid typing the same code twice in different places?
japhb_ nodnod
lue (whether this solves the second, "can't share same copy of hash" problem I do not know) 20:23
adu YEY it can parse a primary-expression! 20:25
japhb_ r: sub r1 { my %*CACHE; %*CACHE{test} = "yay!"; r2(); }; sub r2() { r1() unless %*CACHE; say %*CACHE{test}; }; r2(); 20:26
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Undeclared routine:␤ test used at line 1␤␤»
japhb_ r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { r1() unless %*CACHE; say %*CACHE<test>; }; r2();
p6eval rakudo 897636: OUTPUT«yay!␤Dynamic variable %*CACHE not found␤ in method postcircumfix:<{ }> at src/gen/CORE.setting:10633␤ in sub r2 at /tmp/tm_nIAcFb9:1␤ in block at /tmp/tm_nIAcFb9:1␤␤»
japhb_ lue: I'm currently working through a combination of your idea and FROGGS's 20:27
r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { r1() unless try %*CACHE; say %*CACHE<test>; }; r2();
p6eval rakudo 897636: OUTPUT«yay!␤Dynamic variable %*CACHE not found␤ in method postcircumfix:<{ }> at src/gen/CORE.setting:10633␤ in sub r2 at /tmp/3amxXmNLQW:1␤ in block at /tmp/3amxXmNLQW:1␤␤»
colomon adu++
FROGGS japhb_: hehe, I dont know if it is the best advice to follow to directions at once *g* 20:28
japhb_ r: say %*FOO;
p6eval rakudo 897636: OUTPUT«Dynamic variable %*FOO not found␤ in method gist at src/gen/CORE.setting:10622␤ in method gist at src/gen/CORE.setting:902␤ in sub say at src/gen/CORE.setting:7646␤ in block at /tmp/oEyFo0fkpr:1␤␤»
japhb_ r: say try {%*FOO};
p6eval rakudo 897636: OUTPUT«Dynamic variable %*FOO not found␤ in method gist at src/gen/CORE.setting:10622␤ in method gist at src/gen/CORE.setting:902␤ in sub say at src/gen/CORE.setting:7646␤ in block at /tmp/5RILzHMYzD:1␤␤»
lue r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { r1() unless try %*CACHE; say %*CACHE<test>; CATCH { default { } }}; r2();
p6eval rakudo 897636: OUTPUT«yay!␤»
moritz r: say defined %*FOO
p6eval rakudo 897636: OUTPUT«False␤»
japhb_ r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { r1() unless defined %*CACHE; say %*CACHE<test>; }; r2(); 20:29
p6eval rakudo 897636: OUTPUT«yay!␤Dynamic variable %*CACHE not found␤ in method postcircumfix:<{ }> at src/gen/CORE.setting:10633␤ in sub r2 at /tmp/60Y557wry4:1␤ in block at /tmp/60Y557wry4:1␤␤»
lue ah, that's what it was (I tried %*FOO.exists earlier :P)
japhb_ moritz, why doesn't the one I just tried work?
r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { r1() unless %*CACHE; say %*CACHE<test>; CATCH { default { } }}; r2(); 20:30
p6eval rakudo 897636: OUTPUT«yay!␤»
moritz japhb_: because the 'my %*CACHE' in r1 goes away again once r1 terminates
so calling it from r2 doesn't define it in r2
dalek : cbff4ad | (Tobias Leich)++ | lib/Perl6/P5Actions.pm:
add more longnames to special vars
20:31
moritz r: sub r1(&c?) { my %*C; %*C<test> = 'yay!'; c() if &c }; sub r2 {if %*C { say %*C<test> } else { r1(&?ROUTINE) } }; r2() 20:32
p6eval rakudo 897636: OUTPUT«yay!␤»
japhb_ moritz, I'm being blind. The first call to r2() should get defined %*CACHE is False, as you showed, and the second call (from within r1()) should work, no?
skids r: perl6 -e 'sub a ($depth = 0) { CALLER::.say ; a($depth + 1) if $depth < 3 }; a()' # was thinking something fun with a where clause for japhb_'s problem but this...
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/NAJGlVHLyY:1␤------> perl6 -e ⏏'sub a ($depth = 0) { CALLER::.say ; a($␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤ statement end␤ …
skids erm 20:33
FROGGS r: sub a ($depth = 0) { CALLER::.say ; a($depth + 1) if $depth < 3 }; a()
p6eval rakudo 897636: OUTPUT«PseudoStash.new("!UNIT_MARKER", !UNIT_MARKER, "GLOBALish", GLOBAL, "EXPORT", EXPORT, "\$?PACKAGE", GLOBAL, "::?PACKAGE", GLOBAL, "\$_", Any, "\$/", Any, "\$!", Any, "\&a", sub a($depth = { ... }) { ... }, "\$=pod", Array.new(), )␤No such method 'perl' for invocant …
skids … of type 'CallContext' 20:34
yet CALLER.WHAT is always PseudoStash.
lue Apparently defining my %*DYNVAR; doesn't travel like you want it to? (it's the r2 call in r1 that prints "yay", by the way)
japhb_ lue, The part I'm confused about is how moritz got merely False with no error when he did: r: say defined %*FOO ... but when I did seemingly the same construct in r2(), it didn't work. 20:36
(Or rather, it did print yay!, but it also threw the error instead of being silently False.)
lue japhb_: I think it's the say %*CACHE from the initial r2 call that throws the error, *not* the definedness test 20:37
japhb_ *headdesk*
Duh. I wrote down a different control flow than I had in my head. 20:38
r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { return r1() unless %*CACHE; say %*CACHE<test>; CATCH { default { } }}; r2();
p6eval rakudo 897636: OUTPUT«yay!␤»
japhb_ THERE WE GO.
That's what I was *thinking*.
r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { return r1() unless %*CACHE; say %*CACHE<test>; }; r2();
p6eval rakudo 897636: OUTPUT«yay!␤»
japhb_ Oooh, now we're getting somewhere. 20:39
lue (fwiw, I'm not sure creating a * twigiled variable is strictly necessary here) 20:39
japhb_ lue: Without it, how do you meet the original problem requirements? 20:40
lue r: sub r1 { my %*CACHE; %*CACHE<test> = "yay!"; r2(); }; sub r2() { return r1() unless %*CACHE; say %*CACHE<test>; }; my %*CACHE = "test","woohoo!"; r2(); # this is what you mean? 20:41
p6eval rakudo 897636: OUTPUT«woohoo!␤»
japhb_ Yeah, it didn't get a fresh hash 20:42
But I think more I'm worried about something a bit different. Let me see if I can express it. 20:43
r: sub r1($s) { my %*CACHE; %*CACHE{$s} = $s; r2(); }; sub r2($s) { return r1($s) unless %*CACHE; say %*CACHE; }; r2("a"); r2("b"); 20:44
p6eval rakudo 897636: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'r2' will never work with no arguments (lines 1, 1)␤ Expected: :($s)␤»
japhb_ r: sub r1($s) { my %*CACHE; %*CACHE{$s} = $s; r2($s); }; sub r2($s) { return r1($s) unless %*CACHE; say %*CACHE; }; r2("a"); r2("b");
p6eval rakudo 897636: OUTPUT«("a" => "a").hash␤("b" => "b").hash␤»
japhb_ I want to preserve that behavior.
Meaning, I think that's why I need a 'my %*CACHE' declaration 20:45
lue I was saying you might get away with just my %CACHE instead of %*CACHE 20:46
r: sub r1($s) { my %CACHE; %CACHE{$s} = $s; r2($s); }; sub r2($s) { return r1($s) unless %CACHE; say %CACHE; }; r2("a"); r2("b");
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Variable '%CACHE' is not declared␤at /tmp/jz18OKNrFl:1␤------> sub r2($s) { return r1($s) unless %CACHE⏏; say %CACHE; }; r2("a"); r2("b");␤ expecting any of:␤ postfix␤»
lue ah. nevermind then.
japhb_ Yeah. I thought you meant as opposed to doing 'my %CACHE' all the way outside. 20:47
skids hmm... lift? but NYI.
japhb_
.oO( Features you don't understand the need for until one day you hit that *one problem* .... )
Thanks everyone for the brainstorming and good ideas. 20:48
lue you're welcome :)
masak rehi, #perl6 20:53
adu and now it parsed "typedef int my_int;" as <declaration> 20:54
masak I tweeted today that APIs should favor "do one thing well" and hookability. got back "composability trumps hookability". definitely an interesting point. I just wonder if composability is as universal as hookability. I'm not so sure. 20:56
adu wow it took 17 seconds to parse "typedef int my_int;" 20:57
geekosaur composability is great if you can define what composing something means in all cases
sometimes you can't 20:58
and sometimes you can but ordinary humans can't understand the result
adu masak: define both
masak adu: "hookability" := "API allows you to inject your own code at pre-set points of usage". think Git hooks. 20:59
adu I call that inversion of control 21:00
masak adu: "composability" := "there's at least one operation which takes things of type A and produces a new thing of type A", with the assumption that A is a pretty central thing to the API. think operators acting on smaller expressions to make larger expressions, or widgets composing to form bigger widgets. 21:01
adu: hookability is a form of inversion of control.
adu: event loops are another.
adu: reactive programming is yet another. 21:02
adu composability is nice in theory, but I've given up on it in practice
because no matter how nice a design is, there will always be assumptions, and where there are assumptions, there are violations 21:04
masak do you have a concrete example?
adu maybe I'm a pessimist
yes 21:05
masak I have a concrete example (beyond, you know, algebra and stuff) of where composability seems to work really well: jQuery. most jQuery methods take a selection object and emit a selection object. that's why you can chain them any which way you like. it's the "100 operations on 1 data structure beats 10 operations on 10 data structures" phenomenon at work. 21:06
adu HTTP, suppose a 12-year-old writes an HTTP server in ASM for example, and doesn't find out that the Date isn't ISO format, but funky Wed format until he tries to connect to it with a standard web browser and everything falls apart 21:06
_sri is a big fan of hookability, mojolicious is full of it 21:09
masak I agree with "composability > hookability" in theory, but I'm having trouble seeing how to apply the former in all cases where I would easily apply the latter. 21:11
adu: I don't understand. how is that an example of anything except mis-implementing a standard? 21:12
s/except/besides/
adu masak: I think of everything like that
moritz it shows that separation of concern is important, even if you are in charge of the whole system
adu almost every piece of software could be construed as a mis-implementation of common lisp
moritz one could also say that common lisp is a mis-implementation of almost every other software :-) 21:13
adu moritz: true 21:14
anyways, igtg 21:15
_sri combining composability and hookability is fun too, i think the node.js api is a good example for that 21:16
dalek : 2955581 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
move special-var-longnames into grammar tokens

This way we can use vars like $OSNAME directly, lizmat++.
21:17
_sri nodejs.org/api/util.html#util_util_...m_callback # i think this counts as both 21:18
masak adu: I don't get your example, or how it relates to composability.
_sri (behind the scenes both stream objects are connected with events) 21:19
_sri oh wait, this is a better example :S nodejs.org/api/stream.html#stream_r...on_options 21:21
_sri wonders how good pointy blocks will make evented stuff look in perl6 21:26
fat arrow functions in javascript win i guess ['caption', 'select', 'cite', 'article'].map(word => word.toUpperCase()); 21:28
masak _sri: did you mean "coffeescript"? :) 21:31
or is there some future addition to ECMAScript that I'm unaware of?
_sri nope, it's part of javascript now
masak oh, ok. which version?
_sri css.dzone.com/articles/javascript-fat-city 21:32
ES6
masak ah, yes.
_sri oh, i always wanted to ask, are gather/take composable? 21:37
dalek : f3f0ff5 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
more longnames
21:39
moritz _sri: what does that mean?
_sri (as in pythons "yield from <expr>" www.python.org/dev/peps/pep-0380/)
moritz "A Python generator is a form of coroutine, but has the limitation that it can only yield to its immediate caller. This means that a piece of code containing a yield cannot be factored out and put into a separate function in the same way as other code." 21:40
_sri i've been looking into that recently because it's the foundation of pythons new core event loop (Tulip)
moritz gather/take deosn't have that limitation
_sri ah 21:41
neat
moritz r: say gather { a(); b() }; sub a { take 42 }; sub b { take 23 };
p6eval rakudo 897636: OUTPUT«42 23␤»
_sri clear win for perl6 there i guess :) 21:43
javascript seems to follow python semantics too
moritz (mostly unrelated) I also love that you don't need the curlies if there's just one expression 21:44
r: say gather a(), b(); sub a { take 42 }; sub b { take 23 }
p6eval rakudo 897636: OUTPUT«42 23␤»
moritz also in
r: try f(); sub f() { die "OH NOEZ" }; say 'alive';
p6eval rakudo 897636: OUTPUT«alive␤»
_sri is there a way to have a closure without curlies? 21:48
masak _sri: that enters into macro land, I would say.
moritz r: say map * + 1, <1 2 3> 21:49
p6eval rakudo 897636: OUTPUT«2 3 4␤»
masak _sri: but a lot of built-in constructs do that. think of the rhs of &&, for example.
_sri ok, way over my head for now then :)
masak also, what moritz++ said. but I supposed that's not what you wanted.
moritz it doesn't work in the general case, but you can easily make closures of most infix operators, and of method calls
_sri i was thinking about the generic javascript example above ['foo', 'bar', 'baz'].something(<closure>) 21:50
moritz r: say map *.uc, <oh noez>;
p6eval rakudo 897636: OUTPUT«OH NOEZ␤»
dalek : 3922187 | (Tobias Leich)++ | lib/Perl6/P5 (2 files):
add more longnames and make $* "no longer supported"
21:51
masak I don't much mind the curlies there, though. they indicate to me the code isn't executed immediately. 21:53
moritz whoa, $*. I totally forgot what that did. 21:54
and then there's $[, of which I want to forget what it did :-)
FROGGS hehe 21:55
moritz: I never knew these vars...
some are handy of course, like $NR
I might use it now I know that it exists 21:56
moritz it's really scary how many special variables you have to set to make Perl 5 code do what you want, even if your caller messed with those vars
like, setting $\ if you need print()
and $" when interpolating arrays into strings
and $/ for <$filehandle> and chomp 21:57
lue I only saw the P5 special vars once. I'm glad they don't exist here :)
FROGGS lue: ohh, we have $/, $() and friends
moritz and $^I is big fun too 21:58
FROGGS: well, we have $_, $! and $/ (and $¢, but you never see that)
those are the only ones that are really special, and present everywhere
three special vars ain't too bad 21:59
lue at least we don't have annoyingly unbalanced-paren vars
lue kinda wishes ¢vars stayed, just because it makes P6 different 22:00
FROGGS well, we have thousands of operators in exchange 22:01
moritz oh, and I forgot $, when talking about print :-) 22:02
FROGGS at least there are no <sigil> <ws> -special vars... 22:03
_sri clearly perl needs a config file for all those special vars :)
_sri i hear the ini format is very popular 22:05
FROGGS std: use v5; my @DATA = <DATA>;␤__DATA__␤test␤123
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
masak moritz: hm, it seems that implicit in the term "composability" is "caller should not be able to mess with callee". but I fail to see why that is. 22:06
moritz masak: example: the callee is a test function, and must produce valid TAP as output. It should do that even if the caller sets $, = '42'; 22:08
but it won't, if it works along the lines of
sub ok { print $_[0] ? 'not ' : '', "ok\n"
masak right. which leads to a lot of defensive programming. 22:09
moritz or to a lot of bugs
masak setting $, with local everywhere.
moritz aye, and $/ and $\ and $@ and whatever
the problem isn't really that the caller can mess with the callee, but that the caller can *accidetally* mess with the callee 22:10
(as a side effect of doing something for a different purpose)
FROGGS std: use v5; my @DATA = <DATA>;␤__DATA__␤$x 22:11
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
moritz (there's a perlmonks discussion about this and other "defensive" stuff: www.perlmonks.org/?node_id=1026189 though not too much to see yet) 22:13
FROGGS std: use v5; use Config; say $Config{ptrsize} 22:14
p6eval std 86b102f: OUTPUT«ok 00:01 53m␤»
FROGGS std: use v5; use strict; my @DATA = <DATA>;␤__DATA__␤$x l $y 22:20
p6eval std 86b102f: OUTPUT«===SORRY!===␤Confused at /tmp/pPjZn3CtEj line 3:␤------> $x ⏏l $y␤ expecting any of:␤ p5infix␤ statement modifier␤Parse failed␤FAILED 00:01 53m␤»
FROGGS as I said earlier, std is cheating :o)
masak moritz: yes, that's what I meant. more like "caller should not accidentally pollute callee". 22:24
(which is starting to sound a whole lot like lambda calculus. I guess because lambda calculus is essentially a calculus of composability.)
masak dynamicals are a bit of a double-edged sword there. you gain the ability to pass information to your (transitive) callees through a convenient channel. but as composition goes to infinity, the chance that something, anything -- including re-entrancy -- will mess with that channel goes to 1. 22:31
FROGGS Unable to parse expression in pseudo filehandle; couldn't find final "\n\n" 22:55
------> <BOL>⏏<EOL>
moritz / masak: do you know how to match EOF ?
masak FROGGS: with a dollar sign? 22:56
FROGGS masak: no, have to pass a string to method nibble
masak then I don't know.
FROGGS hmmm
masak 'night, #perl6 23:04
FROGGS gnight masak
labster good night masak, hello #perl6 23:07
FROGGS hi labster
lue .u EOF 23:09
yoleaux No characters found
labster .u END OF FILE
yoleaux No characters found
FROGGS .u NEW LINE 23:10
yoleaux No characters found
FROGGS bah
japhb_ Is yoleaux a phenny replacement?
And what happened to phenny, anyway?
flussence .u U+0019 23:11
yoleaux U+0019 END OF MEDIUM [Cc] (␙)
flussence that's the closest to an actual "EOF" I know of... not many things use it these days, mostly DOS
labster .u NEWLINE
yoleaux U+2424 SYMBOL FOR NEWLINE [So] (␤)
FROGGS .u ENDOFFILE
yoleaux No characters found
japhb_ .u END OF 23:12
yoleaux U+06DD ARABIC END OF AYAH [Cf] (<control>)
U+0700 SYRIAC END OF PARAGRAPH [Po] (܀)
U+1A1F BUGINESE END OF SECTION [Po] (᨟)
tadzik isn't yoleaux pronounced "yolo"? :f
japhb_
.oO( Why those three? )
You Obviously Like Owls 23:13
FROGGS Unable to parse expression in pseudo filehandle; couldn't find final "␙"
at t/spec/bigmem/read.v5:26
------> <BOL>⏏<EOL>
maybe I fiddle width method nibble, like an option that it should nibble to the end 23:14
labster .u TRANSMISSION
yoleaux U+2404 SYMBOL FOR END OF TRANSMISSION [So] (␄)
U+2417 SYMBOL FOR END OF TRANSMISSION BLOCK [So] (␗)
labster I used to live in Yolo County. 23:15
lue tadzik: that's one of my first thoughts on discovering yoleaux was the new phenny 23:16
lizmat FROGGS: shouldn't a source file be "split" on the first \n__DATA__ or \n__END__ ?
japhb_ .chars END OF 23:17
yoleaux <control> ܀ ᨟ ∎ ⋳ ⋴ ⋻ ⋼ ␃ ␄ ␗ ␙ 𝆨
FROGGS lizmat: well, I'd like to use methods that are already there, and there is currently no "split"
lizmat FROGGS: and anything after that be ignored?
ack 23:18
in any case, anything after __DATA__ or __END__ can be anything at all, so shouldn't be parsed 23:19
lizmat will sleep on it
FROGGS that's why I try to nibble it like a single-quoted string 23:20
lizmat but there may not be a ' at the end 23:21
isn't that a problem?
FROGGS no, you can give it different starters and stoppers 23:22
lizmat ok, so you want EOF to be the stopper
FROGGS but I think I just look at how it works, and do a simpler nibbler for these sections
because it dont has to look for a stopper, and it dont has to care about an escaped stopper 23:23
lizmat indeed
FROGGS maybe I just can move the cursor, but I'm not sure atm
lizmat still, this doesn't feel right
also: the DATA handle needs to be at the first line after __DATA__ at start of execution 23:24
FROGGS right
lizmat so you will need to remember a position somewhere
FROGGS of course, one must be able to seek too
lizmat okidoki… wasn't sure how well you were versed in these Perl 5 peculiarites
FWIW, I think Perl 5 on Rakudo can live with opening another handle for DATA 23:25
FROGGS I know quiet a bit :o) ... but as everyone, I can't know everything (and I surely does not), so, any help/input is welcome
lizmat I'm off to bed now, but I definitely want to give input and help 23:26
seeing your commits has made me feel I can actually contribute here :-) 23:27
but not tonight
:-)
FROGGS you can, it is quiet simple after the first days
ya :o)
lizmat :-) cool
night #perl6!
FROGGS night lizmat 23:28
adu_ how do I do a heredoc? 23:49
q:to'EOS' isn't working
flussence std: q:to'EOS'␤a␤EOS 23:50
p6eval std 86b102f: OUTPUT«===SORRY!===␤Unrecognized quote modifier: to'EOS at /tmp/0bu4XInmdG line 1:␤------> q⏏:to'EOS'␤(Possible runaway string from line 1)␤Couldn't find terminator ' at /tmp/0bu4XInmdG line 3 (EOF):␤------> EOS⏏<EOL>␤…
flussence std: q:to('EOS')␤a␤EOS 23:51
p6eval std 86b102f: OUTPUT«===SORRY!===␤Alphanumeric character is not allowed as delimiter at /tmp/6PsrgKK3M5 line 2:␤------> <BOL>⏏a␤ expecting any of:␤ escape␤ statement modifier loop␤Parse failed␤FAILED 00:00 42m␤»
flussence std: q:to('EOS');␤a␤EOS
p6eval std 86b102f: OUTPUT«===SORRY!===␤(Possible runaway string from line 1)␤Couldn't find terminator ; at /tmp/bHQg8OOE6K line 3 (EOF):␤------> EOS⏏<EOL>␤Parse failed␤FAILED 00:00 42m␤»
flussence r: say q:to('EOS');␤a␤EOS
p6eval rakudo 897636: OUTPUT«␀␀␀[␀␀␀3␀␀␀1␀␀␀m␀␀␀=␀␀␀=␀␀␀=␀␀␀␀␀␀[␀␀␀0␀␀␀m␀␀␀S␀␀␀O␀␀␀R␀␀␀R␀␀␀Y␀␀␀!␀␀␀␀␀␀[␀␀␀3␀␀␀1␀␀␀m␀␀␀=␀␀␀=␀␀␀=␀␀␀␀␀␀[␀␀␀0␀␀␀m␀␀␀␤␀␀␀C␀␀␀o␀␀␀u␀␀␀l␀␀␀d␀␀␀n␀␀␀'␀␀␀t␀␀␀ ␀␀␀f􏿽xE2􏿽x90
flussence whoops 23:51
r: say q:to<EOS>;␤a␤EOS 23:52
p6eval rakudo 897636: OUTPUT«a␤␤»
adu_ ooh
ok
thanks
flussence I don't know why the ('') version didn't work but there you go 23:53
diakopter haha; you killed ilbot6
diakopter r: say q:to('');␤boo 23:56
p6eval rakudo 897636: OUTPUT«===SORRY!===␤Cannot look up attributes in a type object␤»
flussence
.oO( I wonder if that ilbot crash is reproducible... )
23:57
r: say Buf.new('␀'.encode()[0,1]).decode('latin-1')
p6eval rakudo 897636: OUTPUT«â␤»