Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-05-18

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:06 BrowserUk joined #perl6
00:06 BrowserUk left #perl6
00:43 ashleydev joined #perl6
00:44 BrowserUk joined #perl6
00:44 BrowserUk left #perl6
00:45 yinyin joined #perl6
00:46 snarkyboojum rakudo seems to work nicely for me on parrot r46753
00:46 snarkyboojum fwiw
00:47 diakopter "At one point, there were 1200 developers on the CLR team. That's over a year of man-hours per 8-hour day!"
00:51 BinGOs joined #perl6
00:59 ashleydev joined #perl6
01:21 molaf__ joined #perl6
01:24 hercynium joined #perl6
01:30 sorear Why don't I get my own pugs-commits mails?
01:31 sorear I get mailed when lwall edits the spec, but not when I edit viv
01:31 TimToady only spec changes go to p6l
01:34 plobsing joined #perl6
01:35 jhuni joined #perl6
01:58 agentzh joined #perl6
02:04 bluescreen joined #perl6
02:18 BillN1VUX joined #perl6
02:18 BillN1VUX left #perl6
02:19 JimmyZ joined #perl6
02:27 [mark] joined #perl6
02:39 finanalyst joined #perl6
02:43 sorear re. Su-Shee: I hereby petition for the removal of base classes.  We can simplify the metamodel a lot of all inheritance is done through roles
02:43 _jaldhar joined #perl6
02:43 gbacon_ joined #perl6
02:46 gpw joined #perl6
02:51 sorear diakopter: Why am I reminded of Fred Brooks ...
02:59 jassics joined #perl6
03:00 jassics hi all
03:00 sorear Hello.
03:00 sorear Welcome.
03:00 jassics Thanks.
03:00 masonkramer joined #perl6
03:00 jassics i am working on perl 5.10
03:00 jassics what abt u all?
03:00 sorear We're working on Perl 6
03:01 TimToady some of us are playing
03:01 sorear If you want help hacking perl 5.10, ask #p5p or #corehackers on irc.perl.org
03:01 sorear what's the difference?
03:01 jassics oh cool... don't u think variable declaration and  its use will be a mess b/w perl 5 and perl 6
03:02 sorear I don't follow.
03:02 TimToady the perl 6 way is really easy to get used to
03:02 TimToady and perl 6 at least will tell you if you screw it up :)
03:02 sorear Isn't it essentially the same as the Perl 5 way?
03:02 sorear Nobody uses no strict anymore
03:02 TimToady std: my @abc; say $abc[1]
03:02 p6eval std 30678: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $abc is not predeclared (did you mean @abc?) at /tmp/irZ4JzHGem line 1:␤------> [32mmy @abc; say $abc[33m⏏[31m[1][0m␤Check failed␤FAILED 00:01 114m␤»
03:02 jassics ppl will find tought to switch from perl 5 to perl6
03:02 sorear Oh, that
03:03 sorear jassics: you can't fix people.  you have to win over their children & wait for them to die
03:03 sorear it's like this with all paradigm shifts :(
03:03 jassics and those who are working on perl 5  may not try to adapt wihperl 6
03:03 TimToady unless your name is Joshua or Caleb, of course...
03:03 jassics u mean perl 5 will vanish if everyone wish to use perl 6
03:04 jassics it should be like next version as damian told in 2003
03:04 TimToady jassics: you don't have to make it an either/or thing like that
03:04 TimToady there's more than one way to do it, including p5 and p6
03:07 jassics hmmmm but both r diff lang.
03:07 sorear CPAN is the language
03:07 jassics even name is somewhow same. it would be really nice if perl 6 fully support perl 5 and tries to fix bugs or erors that perl 5 is having
03:07 TimToady diff syntax, but designed with the same fundamental principles
03:08 TimToady well, sure, but we need to finish the p6 part of it first
03:08 sorear the problem with perl 5 is backwards compatibility.  perl 6 fixes that, by abandoning the replacement paradigm
03:08 TimToady we will be able to parse the sane subset of P5; already have the grammar half written, in fact
03:08 sorear perl 6 is going to coexist with perl 5, in much the same way that Python coexists with BASIC
03:09 TimToady now be nice :)
03:09 jassics wow thats sounds good.
03:09 sorear in time, we hope that we will win over the sane programmers, and Perl 5 will fade into the mists of history
03:09 jassics well then one day perl 6 will also go when perl 7 will come?
03:10 TimToady feel free to design Perl 7, but we have to finish 6 first :)
03:10 TimToady and if we do Perl 6 good enough, it can just evolve into Perl 7
03:11 TimToady we couldn't do that with 5 to 6 because 5 wasn't sufficiently well design to evolve that way
03:11 TimToady *designed
03:13 quietfanatic joined #perl6
03:27 jassics lets see how long it will take to come into existence
03:27 jassics i m waiting to see its power
03:28 sorear what?
03:28 sorear it exists now
03:28 sorear languages don't magically become good, they need to be used
03:28 sorear so... use it if you want it to be good
03:30 sorear TimToady: I'm trying to reverse engineer the gimme5 regex compiler.  What regexes should I avoid testing because they are miscompiled?
03:30 TimToady well, it doesn't do anything with embedded /foo/ style regexes, only token/rule/regex
03:31 TimToady it doesn't do & or &&
03:31 TimToady it sometimes requires {{...}} around blocks if there are {} inside
03:32 TimToady I there are some marginal things around the edges that work sometimes depending on the phase of the moon, but if nothing depends on them in testing STD.pm6 or *.t, they don't get tested
03:32 TimToady lookbehinds tend to fall into that category
03:32 sorear There are tests?
03:33 sorear Or are you talking about the bit where STD.pmc is run over t/spec/*/*?\
03:33 TimToady yes, that
03:33 TimToady but it's always running the same code, so it doesn't do complete coverage by any stretch
03:34 slavik joined #perl6
03:34 * sorear has this mad notion of hooking up 'viv' + eval + 'tloop'
03:34 TimToady the :i sorts of things are probably marginal at best
03:35 TimToady well, viv does pretty well on the un6 parts of the translation
03:35 TimToady at least it can completely translate EXPR, if it hasn't bitrotted
03:35 sorear un6 is basically just everything except regex, right?
03:35 TimToady well, mainline code
03:36 TimToady doesn't do well inside quotes or regexen
03:36 sorear it shouldn't be doing anything at all inside quotes
03:36 TimToady so you see a lot of gluing things together with ~ in STD where it could be using interpolation
03:36 sorear because we, uh, use a real parser now
03:36 TimToady viv will do better on those than gimme5, sure
03:37 TimToady except when it doesn't...
03:37 TimToady and, of course, gimme5 is really not translating to an exact equivalent
03:38 TimToady turning dynamic vars into locals, and suc h
03:39 TimToady one of the reasons the old v6 was so slow was because it was aiming for exact semantics, so used Pad::Walker and such to play with lexicals
03:39 TimToady that seemed like overkill for a bootstrap
03:40 TimToady but even if viv only does a half-baked translation, using it to get BEGIN semantics would be cool
03:41 TimToady and the subset of P6 that maps to P5 is already pretty cool
03:42 TimToady are you going to continue hacking on viv?  I can always find other stuff to work on (alas).
03:42 sorear so can I
03:42 sorear and you're in a better position
03:42 sorear if there can only be one, you have it
03:43 sorear what is "the old v6"?
03:43 TimToady I think we could timeshare, if we just keep checking in periodically
03:44 sorear svn is pretty good at conflict resolution as long as we don't branch...
03:44 TimToady the first non-pugs perl 6 implementation in the pugs repo
03:44 TimToady by fglock++
03:44 sorear was it based on any of the STD/gimme5 technology?
03:44 TimToady no
03:44 TimToady had its own hand-rolled parser
03:45 TimToady and besides being slow is probably rather bitrotted by now
03:46 TimToady well, I need to wander off for an hour or two, so you can have viv at least that long :)
03:46 TimToady bbl &
03:50 * sorear doesn't think fast and correct have to be mutually exclusive
04:09 occamshatchet joined #perl6
04:25 pnate joined #perl6
04:28 ashleydev joined #perl6
04:40 {shade} joined #perl6
04:52 kolibrie joined #perl6
04:52 kst` joined #perl6
04:54 lue joined #perl6
04:54 Rugxulo joined #perl6
04:56 sorear hello
05:05 kst`` joined #perl6
05:14 kaare joined #perl6
05:16 JimmyZ hi
05:18 kolibrie joined #perl6
05:46 uniejo joined #perl6
05:52 XaeroOne joined #perl6
05:55 isBEKaml joined #perl6
06:19 isBEKaml hi, folks!
06:22 moritz_ moin
06:23 sorear hello
06:23 sorear isBEKaml: =~ is ~~ now
06:23 JimmyZ JimmyZ got many faild tests on rakudo perl 6 on Windows XP" (47 lines) at http://nopaste.snit.ch/20586
06:26 isBEKaml sorear: nice. =~ is ~~ is smartmatching. :)
06:27 isBEKaml oh, yeah. That reminds me. Tests passed last night with a couple of TODOs passed too.
06:28 isBEKaml on parrot r46740
06:32 isBEKaml moritz_: I was looking at u4x docs this morning. the state of the docs rattles against the u4x manifesto. :(
06:34 gfx joined #perl6
06:35 isBEKaml moritz_: I'm thinking of adding more to it, from the TODO list.
06:37 isBEKaml sorear: You're working on viv?
06:39 eternaleye joined #perl6
06:42 Su-Shee joined #perl6
06:44 sorear isBEKaml: working may be too strong a word...
06:45 isBEKaml sorear: Could you just change the shebang on the top to the more generic /usr/bin/env perl ?
06:46 isBEKaml sorear: I find the pugs repo full of interesting things, though a tad old... :)
06:49 sorear right now, Larry is doing more work on viv than I am
06:49 sorear well not *right* *now*
06:49 sorear but in the last month
06:49 eternaleye joined #perl6
06:49 isBEKaml oh, ok. no issues. :)
06:49 sorear it probably could be changed, but neither is exactly portable
06:50 isBEKaml is this right? 1 while $var ~~ /$pattern/ ?
06:50 isBEKaml rakudo cops out on this line saying "unable to parse blockoid..."
06:50 sorear that's because /$pattern/ syntax is NYI
06:50 sorear but it's fine
06:51 sorear stdically
06:51 moritz_ isBEKaml: more docs would always be welcome
06:51 sorear yes, documentation is what the STD ecosystem needs more than anything else
06:51 isBEKaml no, I'm actually trying to get Rakudo to play hangman that available in the pugs/examples/games folder. :)
06:51 sorear my ability to comprehend it is predicated on TimToady's IRC availability
06:52 sorear does $pattern potentially contain metacharacters?
06:52 isBEKaml The actual line is this: 1 while $dict.lines ~~ rx:P5/\S/;
06:52 sorear oh
06:52 moritz_ rx:P5 is NYI in master
06:52 sorear pugs implemented regexes using PCRE
06:53 sorear which meant that rx:P5 was the only kind it could handle
06:53 sorear Rakudo has (indeed, is based on) an implementation of most of p6regex
06:53 moritz_ s/PCRE/Perl 5/
06:53 sorear but lacks any p5regex handling
06:53 isBEKaml oh, I see...
06:53 sorear moritz_: Oh?  Which implementation am I confusing it with that used PCRE?
06:54 circuitbreaker joined #perl6
06:54 moritz_ alpha: say 'a,,' ~~ rx:P5/a,*/
06:54 p6eval alpha 30e0ed: OUTPUT«a,,␤»
06:54 moritz_ sorear: no idea
06:54 sorear rakudo: say 'a,,' ~~ /\S/
06:54 p6eval rakudo 2d0fc2: OUTPUT«a␤»
06:54 sorear so just /\S/ is fine
06:55 sorear moritz_: did alpha parse rx:P5 itself or delegate to PCRE/perl6?
06:55 sorear perl5
06:55 isBEKaml sorear: yes, that's what I did. but there are too many, even with things like s:P5//
06:57 isBEKaml and, I will have to modify the p5 regex patterns to those of p6. erm, I will be asking quite a lot of noob regex questions. Please bear with me. :(
06:59 iblechbot joined #perl6
07:07 moritz_ sorear: PGE implemented parts of the perl 5 regex syntax
07:09 isBEKaml rakudo: my $name="fname lastname"; my $realname=""; if($name ~~ /^(.+?)(?:\s+|$)/) { $realname ~~ s/\s*".*"\s*/ /; } say $name; say $realname;
07:09 p6eval rakudo 2d0fc2: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
07:10 moritz_ first of all if(...) is a sub call
07:10 moritz_ use if ... # no parens required
07:11 gpw joined #perl6
07:12 isBEKaml rakudo: my $name="fname lastname"; my $realname=""; if $name ~~ /^(.+?)(?:\s+|$)/  { $realname ~~ s/\s*".*"\s*/ /; } say $name; say $realname;
07:12 p6eval rakudo 2d0fc2: OUTPUT«Confused at line 11, near "if $name ~"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
07:12 isBEKaml regex wrong?
07:14 moritz_ regex wrong
07:14 isBEKaml rakudo: my $name="fname lastname"; my $realname=""; if $name ~~ /<alpha>+\b\s*/  { $realname ~~ s/\s*".*"\s*/ /; } say $name; say $realname;
07:14 p6eval rakudo 2d0fc2: OUTPUT«Confused at line 11, near "if $name ~"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
07:14 moritz_ " needs to be escaped
07:14 kst``` joined #perl6
07:14 moritz_ and \b is now »
07:15 moritz_ for right word boundary
07:16 isBEKaml oh...
07:16 isBEKaml escaping the "" worked, but no output. So I will have to work on the regex. Will read up S05 a bit and come back.
07:20 isBEKaml d'oh! logic error... :/
07:21 isBEKaml rakudo: my $name="fname \"realName\" lastname"; my $realname=$name; if $name ~~ /<alpha>+>>\s*/  { $name ~~ s/\s*\".*\"\s*/ /; } say $name; say $realname;
07:21 p6eval rakudo 2d0fc2: OUTPUT«Confused at line 11, near "if $name ~"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
07:23 isBEKaml rakudo: my $name="fname \"realName\" lastname"; my $realname=$name; if $name ~~ /<alpha>+»\s*/  { $name ~~ s/\s*\".*\"\s*/ /; } say $name; say $realname;
07:23 p6eval rakudo 2d0fc2: OUTPUT«Confused at line 11, near "if $name ~"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
07:23 isBEKaml odd, that worked on my local REPL... :(
07:29 isBEKaml (0..+@array - 1 ) is now @^array, right?
07:32 isBEKaml nm, I see now..
07:33 isBEKaml indexing through loops is probably a bad solution, will have to look for a workaround..
07:43 isBEKaml what does ~= mean? $variable ~= $some_other_variable
07:52 isBEKaml \o/. Finally got it to compile!
07:53 isBEKaml one last question, though. what's the equivalent of @INC here with Rakudo? any environment variables that I can use? I got a rakudo set up in a custom location.
07:54 isBEKaml "Unable to find module 'lib' in the @*INC directories."
07:54 isBEKaml this is what I got when trying to run it... any ideas about locating the module?
08:00 meppl joined #perl6
08:04 viklund joined #perl6
08:04 sorear isBEKaml: ~= is just an inplace modification derived operator
08:05 sorear isBEKaml, use lib is a pragma
08:05 sorear it's not something you can just install
08:07 isBEKaml sorear: yeah, I figured as much. there were lines like use lib '<list of relative pathnames, should one fail take the next>' followed by use <module here>;
08:08 isBEKaml sorear: what bugs me is, the relative pathnames are all correctly pointing to the lib folder of File::Spec (the module that's required here)
08:08 Juerd isBEKaml: If you know what += does, and you know what ~ does (concatenate strings), then you can figure out what ~= does.
08:08 sorear use lib isn't mentioned in the synopses anywhere
08:08 * sorear blows the TimToady whistle
08:08 sorear let's do better than perl 5 and make it lexically scoped
08:09 isBEKaml Juerd: Thanks. :)
08:09 isBEKaml sorear: oh, no! what do we do? :(
08:10 sorear isBEKaml: You?  Set PERL6LIB
08:10 sorear Us?  Wait for TimToady's resolution
08:11 isBEKaml sorear: I did perl6 -e '@*INC>>.join(",").perl.say'. It outputted the ., ~/.perl6/lib and the parrot lib location
08:13 isBEKaml sorear: what do I set PERL6LIB to ?
08:13 sorear That's wrong.  Don't trust it.
08:13 sorear Just the absolute path of where you want modules found
08:16 isBEKaml ok, so I set it and that's not very generic it seems. I have to unset and reset it everytime I want to use another module. I could move all modules to another location and set up dir structure, though...
08:16 isBEKaml now, I remove all use lib lines?
08:18 sorear yes, I agree it's bad
08:22 isBEKaml sorear: PERL6LIB failed too. I tried using use File::Spec:from '<relative path to lib folder here>', it gave me this, "Method 'value' not found for invocant of class 'PAST;Var'
08:22 isBEKaml "
08:23 sorear joined #perl6
08:23 isBEKaml echo $PERL6LIB; ~/Downloads/tools/rakudo/pu​gs/pugs/ext/File-Spec/lib/
08:24 sorear gah
08:26 isBEKaml gack... Malformed package declaration at line 3, near "-0.0.1;\n\nm" WTF were version numbers included in module declarations??
08:28 dakkar joined #perl6
08:29 clintongormley joined #perl6
08:29 isBEKaml sorear: I copied over the lib contents to ~/.perl6/lib and I got this. Corrected it and I get another error. Something like "Indirect name lookups not yet implemented..."
08:31 isBEKaml is this correct? return &::$(worker_pkg)::curdir();
08:31 isBEKaml File-Spec/lib/File/Spec.pm
08:32 arnsholt joined #perl6
08:33 sorear yes it's correct
08:34 sorear "not yet implemented" isn't clear?
08:34 isBEKaml sorear: I was looking at File::Spec::Unix, that defines curdir() or I think it does...
08:34 mdxi joined #perl6
08:35 isBEKaml there was eval require File::Spec::Unix before this line, so, surely this must have been implemented...
08:35 sorear isBEKaml: I don't understand you
08:35 hejki joined #perl6
08:36 sorear There'
08:36 sorear s no reason why features have to be implemented before people can prototype code using them
08:36 isBEKaml sorear: File/Spec.pm defines $worker_pkg based on the underlying os $^OS. Next it calls eval "require $worker_pkg"; and then this error msg..
08:36 sorear furthermore, there are a dozen independant perl6 implementations
08:36 Helios joined #perl6
08:36 sorear $^OS is wrong
08:37 sorear needs to be $*OS
08:37 sorear File::Spec has never been run
08:37 BrowserUk joined #perl6
08:39 sorear oh, run in pugs
08:39 moritz_ wow, this morning all went wrong
08:39 sorear same thing, basically
08:39 sorear worse than mine?
08:39 moritz_ first my girlfriend cut her finger
08:39 moritz_ needed to take her to the doctor
08:39 moritz_ then was late for $work
08:40 moritz_ and the bus driver took the wrong turn
08:40 sorear isBEKaml: It would, indeed, be nice if you could take code written against pugs and run it against ng with no problems.
08:40 moritz_ (could all have been worse, but it feels bad nonetheless)
08:41 TiMBuS joined #perl6
08:41 sorear isBEKaml: you're going to want to mostly rewrite this thing; ng's support surface is quite different
08:41 sorear in particular, ng supports objects
08:42 isBEKaml sorear: yay, another challenge! I'll take it, but you'll have to tell me what I need to know before I go tackling this... :)
08:43 isBEKaml moritz_: feel sorry for ya. I hope everything's sorted out and okay now?
08:43 moritz_ isBEKaml: no idea, left her at the doctor's
08:44 sorear isBEKaml: sorry, I need to sleep now
08:45 isBEKaml sorear: no problem. thanks and good night. :)
08:45 sorear isBEKaml: if you feel *really* ambitious, improving ng is always good
08:45 Grrrr joined #perl6
08:45 sorear ng is current (>Feb2010) "rakudo"; I say ng when I want to avoid confusion with alpha
08:46 sorear *gone*
08:46 isBEKaml sorear: nah, I'm not all that confident I could turn out something good. I'm just tired of sitting with the Specs and want to do something..
08:46 jnthn o/
08:46 isBEKaml \o
08:47 isBEKaml moritz_: you're making it sound funny(I don't know if I'm serious ;) )
08:49 finanalyst joined #perl6
08:57 isBEKaml sure looks like I have to rewrite these modules....
09:01 cognominal o/
09:06 moritz_ isBEKaml: I'm quite sure by now everything is sorted out - I just don't know yet
09:07 isBEKaml moritz_: ok, nice.
09:07 rgrau joined #perl6
09:12 isBEKaml Straight from S05:  "$target ~~ s:g[pattern] op= expr." What does this mean? What can I do in the expr part of this statement?
09:12 isBEKaml the equivalent form isn't clear to me either..
09:12 moritz_ are you familiar with perl5's s///e?
09:13 isBEKaml yes.. evaluate on right side substitute...
09:13 moritz_ in the case of s:g[pattern] = expr;, the expr take the role of the right side
09:13 moritz_ *takes
09:14 moritz_ so it's evaluated for each substitution
09:14 moritz_ $a op= $b is the same as $a = $a op $b
09:14 isBEKaml oh, I see... this looks to be a bit more verbose than s///e, what's the net gain?
09:14 moritz_ that it's clear that it's code
09:15 moritz_ so s[pattern] *= 3; is short for s[pattern] = $/ * 3;
09:15 moritz_ which means 'in-place multiply all matches of pattern with 3'
09:16 moritz_ rakudo: my $x = 'a23bc34'; $x ~~ s[\d+] *= 2; # I'd be surprised if it worked
09:16 p6eval rakudo 2d0fc2: OUTPUT«Missing assignment operator at line 11, near "*= 2; # I'"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
09:16 moritz_ ah, NYI
09:16 moritz_ colomon: I wonder how hard that would be...
09:18 jnthn moritz_: Not that bad.
09:19 * jnthn was a little tempted to try it when he added the = form in the first place
09:19 isBEKaml rakudo: my $str="momonut"; $str ~~ s:g/m/c/; say $str; '
09:20 p6eval rakudo 2d0fc2: OUTPUT«Confused at line 11, near "'"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
09:20 isBEKaml rakudo: my $str="momonut"; $str ~~ s:g/m/c/; say $str;
09:20 p6eval rakudo 2d0fc2: OUTPUT«Could not find sub &s:g␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
09:20 jnthn moritz_: Plus there's various examples of munging operators in the meta-ops.
09:21 isBEKaml how do I use the global switch?
09:22 eternaleye What happens for ~~ Nil? The most useful effects i can think of are either (Nil ~~ Nil == True, $other ~~ Nil == False) or ($undefined ~~ Nil == True, $defined ~~ Nil == False), but if ~~ counts as item context, Nil would likely be coerced to a Mu type object, and always match. (This occurred to me while reading the S05 section on quantified captures and how it is Nil if $number == 0; I then thought "What's the most intuitive way to check if a
09:22 eternaleye value is Nil?")
09:23 moritz_ eternaleye: $val eqv Niv
09:23 moritz_ jnthn: sounds like fun :-)
09:24 eternaleye moritz_: Is that an answer to 'most intuitive' or 'what happens'?
09:24 moritz_ "most intuitive"
09:24 eternaleye Ah
09:24 moritz_ eternaleye: Nil is just a special (=empty) Parcel, so look in the smartmatching table what happens in this case
09:24 moritz_ rakudo: say Any ~~ Nil # rakudo might be wrong, just looking what it says
09:24 p6eval rakudo 2d0fc2: OUTPUT«1␤»
09:25 moritz_ rakudo: sah () ~~ Nil
09:25 p6eval rakudo 2d0fc2: OUTPUT«Could not find sub &sah␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
09:25 moritz_ rakudo: say () ~~ Nil
09:25 p6eval rakudo 2d0fc2: OUTPUT«1␤»
09:25 moritz_ rakudo: say (2) ~~ Nil
09:25 p6eval rakudo 2d0fc2: OUTPUT«0␤»
09:25 moritz_ rakudo: say 2 ~~ Nil
09:25 p6eval rakudo 2d0fc2: OUTPUT«0␤»
09:26 eternaleye rakudo: say Mu ~~ Nil
09:26 p6eval rakudo 2d0fc2: OUTPUT«Nominal type check failed for parameter '$topic'; expected Any but got Mu instead␤current instr.: 'perl6;Any;ACCEPTS' pc 388891 (src/gen/core.pir:33432)␤»
09:26 eternaleye Kaboom
09:27 eternaleye rakudo: say Any ~~ Nil
09:27 p6eval rakudo 2d0fc2: OUTPUT«1␤»
09:27 eternaleye Huh, so it's the latter of the 'useful' options I listed, which is what I would have preferred. It's also considerably prettier than ~~ *.notdef
09:27 isBEKaml Mu is untreatable?
09:28 eternaleye Any isa Mu, and most things are defined in terms of Any (in fact, it's the default). One can easily define things for Mu explicitly.
09:29 eternaleye rakudo: sub foo( Mu $a ) { say "alive"; say $a.defined; say $a; }; foo(1); foo(Mu); foo(1|2);
09:29 p6eval rakudo 2d0fc2: OUTPUT«alive␤1␤1␤alive␤0␤Mu()␤alive␤1␤any(1, 2)␤»
09:30 snarkyboojum joined #perl6
09:31 eternaleye rakudo: say Hash ~~ Nil; say Int ~~ Nil;
09:31 p6eval rakudo 2d0fc2: OUTPUT«1␤1␤»
09:31 isBEKaml but Mu is never defined?
09:31 isBEKaml rakudo: say $.defined(Mu);
09:31 p6eval rakudo 2d0fc2: OUTPUT«Lexical 'self' not found␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
09:31 moritz_ rakudo: say Mu.new().defined
09:31 eternaleye Mu is the most undefined value possible
09:31 p6eval rakudo 2d0fc2: OUTPUT«1␤»
09:31 moritz_ :-)
09:31 isBEKaml :)
09:32 eternaleye Type objects are considered undefined, and Mu is the most general type object
09:32 moritz_ that is certainly correct
09:34 isBEKaml yes, verified correct. :-)
09:34 eternaleye Anyway, ~~ Nil is my new favorite way to check for undefinedness. It just rolls off the tongue^Wfingers :)
09:34 moritz_ eternaleye: please check with the spec first if it's supposed to work like that
09:35 moritz_ I remember some of rakudo's Nil handling being out of date
09:36 eternaleye moritz_: AFAICT, it's unspecced. The smartmatch table doesn't list Parcel, and Capture is defined in terms of 'could bind to' which feels somewhat silly for Nil
09:36 moritz_ eternaleye: then it'll probably fall back to some of the Positional types
09:36 eternaleye Erm, ignore after 'and'
09:37 eternaleye I was misreading Capture ~~ Signature
09:37 eternaleye Neither ~~ Capture nor ~~ Parcel seem to be listed in the smartmatch table
09:38 moritz_ TimToady: any objections to s/Array/Positional/ in the smartmatch table in S03? currently it leaves many gaps
09:38 moritz_ TimToady: otoh I'm not sure what things like Match on the RHS of a smart match should do, since it's both Associative and Positional
09:39 eternaleye TimToady: Also, is Rakudo's current handling of ~~ Nil sane? Because it's rather pretty and makes me feel like I've been given a pony :D
09:41 isBEKaml I'm going to need to rewrite a bunch of regexes in File::Spec. Currently trying them out one by one on the REPL, consulting the spec and trying out some more. Hell, this is a lot fun than bland spec reading... :)
09:42 moritz_ -Ofun++
09:47 isBEKaml -O is for optimized? I like it..! :)
09:47 moritz_ aye
09:47 moritz_ I think audreyt came up with that term
09:48 isBEKaml -Ofun++
10:04 [particle]1 joined #perl6
10:05 Exodist_ joined #perl6
10:06 jjore joined #perl6
10:07 aindilis` joined #perl6
10:08 moritz_ ok, my girlfriend's finger didn't need any stitches after all
10:08 moritz_ her email just lacked the characters a, q and y :-)
10:09 simcop2387 joined #perl6
10:11 * mathw translates to UK keyboard layout
10:11 mathw so her left little finger, and she's a touch typist? :)
10:11 moritz_ yes
10:11 mathw I remember finding it very hard to type on German keyboard with Y and Z the wrong way round
10:11 mathw let alone the punctuation...
10:12 moritz_ actually she learned German, French and UK keyboards in her training
10:12 mathw Wow
10:12 mathw That must've been a bit mind-bending
10:12 masonkramer joined #perl6
10:13 moritz_ aye
10:24 * mathw tries to resist the temptation to hum along with Wise Guys, since that sort of thing is rarely appreciated in the office
10:31 Psyche^ joined #perl6
10:41 cognominal anonymous grammar/classes are so cool to test on the perl 6 command line
10:43 mathw :)
10:46 eternaleye How would one compose an anonymous parametric role? I mean, there's does Positional[Int] and does $role, but is there a (just guessing here) does $role[Int] ?
10:47 eternaleye Or are anonymous roles only an option via mixins, i.e. 'but'?
10:47 eternaleye Even if so, how would a parametric anon role work?
11:01 isBEKaml rakudo: my $fruit="bamama"; $fruit ~= s:g/m/n/; say $fruit;
11:01 p6eval rakudo 2d0fc2: OUTPUT«Could not find sub &s:g␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
11:01 isBEKaml s:g is NYI?
11:01 k23z__ joined #perl6
11:01 isBEKaml or am I using it wrong?
11:03 colomon isBEKaml: first, it's ~~ instead of ~=
11:04 colomon second, we don't have s:g yet, I don't think
11:04 isBEKaml colomon: I tried ~~, I think it got confused..
11:04 colomon rakudo: my $fruit="bamama"; say $fruit.subst(/m/, "n", :g);
11:04 p6eval rakudo 2d0fc2: OUTPUT«banana␤»
11:05 isBEKaml rakudo: my $fruit="bamama"; $fruit ~~ s:g/m/n/; say $fruit;
11:05 p6eval rakudo 2d0fc2: OUTPUT«Could not find sub &s:g␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
11:05 colomon rakudo: my $fruit="bamama"; $fruit .= subst(/m/, "n", :g); say $fruit;
11:05 p6eval rakudo 2d0fc2: OUTPUT«banana␤»
11:05 isBEKaml colomon: yes, okay.. I might have mistook for something else.. I found out about subst, but I wanted to try out s/// instead.
11:06 colomon btw, $fruit .= subst(blah) is equivalent to $fruit = $fruit.subst(blah)
11:06 colomon rakudo: my $fruit="bamama"; $fruit ~~ s/m/n/; say $fruit;
11:06 p6eval rakudo 2d0fc2: OUTPUT«banama␤»
11:08 isBEKaml colomon: s/// without switches is in, nice.. :)
11:09 isBEKaml and I'm going over S05 as I try these out..
11:09 colomon adding the switches is a relatively high priority at the moment.
11:10 colomon moritz_ and I got several working in the match method yesterday.  but neither of us knows how to add them to the grammar for the m// and s/// forms.
11:10 XaeroOne joined #perl6
11:13 isBEKaml rakudo: my $fruit = "bamama"; ($fruit ~~ s/m/n/) ~~ s/m/n/; say $fruit;
11:13 p6eval rakudo 2d0fc2: OUTPUT«banana␤»
11:14 isBEKaml colomon: Oh, I see. How long before we see some switches?
11:15 colomon I don't know.  As I said, this is an area under active development at the moment.  (Literally, I'm trying to figure out how to add the :nth switch to .match in another window.)
11:16 colomon hmmm... you can't return from inside a gather?
11:22 eternaleye colomon: I was under the impression that take(Nil) terminated the list
11:22 eternaleye And that one was returning the gather
11:23 colomon eternaleye: I was trying to subvert the gather altogether, returning a single value rather than a list.
11:23 eternaleye Ah
11:23 colomon didn't work, and I think I've worked out that it's not the appropriate approach.
11:23 eternaleye if $foo { take($val); take(Nil) }
11:23 isBEKaml colomon: what's the nature of a Regex::Match() ?
11:24 isBEKaml I believe matches return this object. If there were multiple matches, we would be seeing a list of them, right?
11:24 eternaleye isBEKaml: What do you mean 'multiple matches'?
11:24 colomon isBEKaml: if there are multiple matches from the .match method (and you selected :g), you get a list of them.
11:25 isBEKaml rakudo: my $str="hello"; my $fft = $str.match(/l/, :g); say $fft.WHAT;
11:25 p6eval rakudo 2d0fc2: OUTPUT«GatherIterator()␤»
11:25 colomon if you are using m:g// (not possible yet) $/ will contain all the matches.
11:26 isBEKaml colomon: yes, $/  <- I just saw this in S05, was pretty confused over IFS in p5.. :(
11:27 colomon IFS?
11:27 isBEKaml Input Field Separator
11:27 colomon Oh, it's not the Input Field Separator any more, as you may have guessed.
11:28 * colomon is not very good at remembering the magic variables in Perl 5...
11:28 isBEKaml in p5, $/ is IFS, in p6, this is match object container.
11:28 moritz_ Perl 6 has only 3 special punctuation variables (ok, that's a lie, but it's pretty close)
11:28 moritz_ $_, $! and $/
11:28 colomon moritz_: I think match(:nth($N)) has to return a list.
11:29 moritz_ why?
11:29 * isBEKaml doesn't remember much of P5, either. But had to look over a lot of formatting scripts at work, repetition got him in. ;)
11:30 colomon moritz_: $N doesn't have to be an Int.  It can be a junction or a list as well.
11:30 colomon probably a range too.
11:30 colomon so I'm thinking it's something we smartmatch against to return.
11:30 moritz_ wfm
11:30 colomon but but but, I don't know how to generically detect if $N is going to return one element or more.
11:31 moritz_ that's fine; we return a capture anyway
11:31 colomon moritz_: I have no idea what that means.
11:31 moritz_ and the capture magic will make it DWIM for the case of a scalar
11:32 colomon does gather return a capture?!
11:33 moritz_ good question
11:35 eternaleye colomon: Range and list would fall out naturally if you just say Positional and iterate it
11:35 colomon eternaleye: it also has to handle a closure.
11:36 moritz_ $matcher = any $matcher if $matcher ~~ Positional
11:36 buubot joined #perl6
11:36 moritz_ and then smart-match against $matcher
11:36 moritz_ where $matcher represents the argument to :nth
11:36 eternaleye rakudo: my $foo = gather { take 5; take Nil; }; say $foo; say $foo.perl; say $foo.WHAT
11:36 p6eval rakudo 2d0fc2: OUTPUT«5 ␤()␤GatherIterator()␤»
11:36 eternaleye rakudo: my $foo = gather { take 5; }; say $foo; say $foo.perl; say $foo.WHAT
11:37 p6eval rakudo 2d0fc2: OUTPUT«5␤()␤GatherIterator()␤»
11:37 eternaleye Apparently, gather does not return a capture.
11:37 colomon eternaleye: foo.perl doesn't work because say $foo has already consumed the iterator.
11:37 colomon rakudo: my $foo = gather { take 5; }; say $foo.perl; say $foo.WHAT
11:37 isBEKaml moritz_: I assume $! is same as was in p5, dump error text ?
11:37 p6eval rakudo 2d0fc2: OUTPUT«(5)␤GatherIterator()␤»
11:38 moritz_ isBEKaml: clever Exception object, if all goes right :-)
11:39 isBEKaml moritz_: It's more clever than p5's ? ;)
11:39 eternaleye colomon: re closure, you're already checking if it's an Int, probably via smartmatching, so you may as well smartmatch against Postional (and iterate) or Code (and call, then redispatch the smartmatching on that)
11:39 moritz_ isBEKaml: yes; it should have line number and file name of the error location accessible via methods, backtraces etc.
11:39 colomon eternaleye: I'm not checking against Int, I'm just smartmatching.
11:39 buubot joined #perl6
11:40 eternaleye Or even make it considered a named argument and use multi dispatch
11:40 moritz_ colomon: you can just smartmatch against any($nth)
11:40 moritz_ colomon: if $nth is a scalar, the any() doesn't have an effect
11:40 isBEKaml moritz_: line number? I thought that was awkward against how text editors handle unicode?
11:40 colomon what if $nth is junction?
11:40 moritz_ then it's a one-item any-junction of a junction
11:41 eternaleye multi over Int :$nth, Positional :$nth, and Code :$nth
11:41 moritz_ which behaves the same as the original junction
11:41 buubot joined #perl6
11:41 moritz_ eternaleye: we're not trying to write as much code as possible, but rather as little as possible :-)
11:41 moritz_ colomon: and any($list) does what you mean
11:41 colomon what moritz_ said
11:41 pmurias joined #perl6
11:44 colomon > "hello world".match(/.<[aeiou]>/, :nth(1|3))>>.Str.perl.say
11:44 colomon ("he", "wo")
11:45 moritz_ \o/
11:45 colomon > "hello world".match(/.<[aeiou]>/, :nth({$_ !% 2}))>>.Str.perl.say
11:45 colomon ("lo", )
11:45 colomon not sure why I get the empty second element of the list there.
11:45 moritz_ what does .[1].WHAT say?
11:45 colomon > "hello world".match(/.<[aeiou]>/, :nth({$_ !% 2})).elems.say
11:45 colomon 1
11:46 moritz_ then it's a .perl artifact
11:47 hirschnase joined #perl6
11:50 * isBEKaml really goes back to S05, IRC's distracting. :P
11:51 colomon moritz_: any() doesn't seem to make any difference....  :(
11:51 moritz_ rakudo: say 1 ~~ (1, 2)
11:51 p6eval rakudo 2d0fc2: OUTPUT«0␤»
11:51 moritz_ rakudo: say 1 ~~ any(1, 2)
11:51 p6eval rakudo 2d0fc2: OUTPUT«1␤»
11:52 colomon rakudo: my @a = 1, 2; say 1 ~~ any(@a)
11:52 p6eval rakudo 2d0fc2: OUTPUT«1␤»
11:52 moritz_ rakudo: my $x = (1, 2); say ~~ any($x)
11:52 p6eval rakudo 2d0fc2: OUTPUT«any((1, 2))␤»
11:52 colomon rakudo: my $a = 1, 2; say 1 ~~ any($a)
11:52 p6eval rakudo 2d0fc2: OUTPUT«1␤»
11:52 moritz_ rakudo: my $x = (1, 2); say 1 ~~ any($x)
11:52 p6eval rakudo 2d0fc2: OUTPUT«0␤»
11:52 eternaleye rakudo: my $x = (1, 2); say 1 ~~ any(|$x)
11:53 p6eval rakudo 2d0fc2: OUTPUT«1␤»
11:53 moritz_ colomon: my $x = 1, 2 parses as (my $x = 1), 2
11:53 moritz_ because item assignment has tighter precedence than ,
11:55 bluescreen joined #perl6
11:56 takadonet joined #perl6
11:57 takadonet morning all
11:57 colomon o/
11:57 moritz_ \o
11:57 colomon moritz_: any idea if that any is supposed to do what you thought?
11:58 colomon or will any(|$x) work for everything we might need?
11:58 moritz_ rakudo: say any(|1)
11:58 p6eval rakudo 2d0fc2: OUTPUT«any(1)␤»
11:58 moritz_ seems like it might
11:59 finanalyst left #perl6
12:00 JimmyZ joined #perl6
12:03 moritz_ colomon: and now let's it extend it so that negative :nth values count from the back... no, just kidding :-)
12:05 colomon moritz_: no no no no no no no
12:05 colomon TimToady would kill us
12:06 * eternaleye prepares popcorn
12:06 * colomon wishes QuickBooks were smart enough to know not to ask me if I want to backup when exiting when my previous action was to manually backup....
12:07 buubot joined #perl6
12:07 colomon it is funny how much nth looks like running grep on the output of match.
12:08 colomon any(|$nth) does it!
12:08 am0c joined #perl6
12:08 eternaleye \o/
12:08 moritz_ \o/
12:09 am0c \\o/
12:10 * moritz_ wonders where am0c's second arm is coming from
12:10 colomon that's the good news.
12:10 colomon the bad news is I think none of the :nth tests I've written so far will handle having a list returned.
12:10 buubot joined #perl6
12:10 am0c it's my leg!
12:11 colomon the idea that we return a capture which does the right thing is nice, but I have no idea how to make it work in practice.
12:11 moritz_ am0c: wow, you're much more flexible than me :-)
12:14 OuLouFu joined #perl6
12:17 am0c tehe..
12:18 bpalmer joined #perl6
12:20 buubot joined #perl6
12:21 buubot joined #perl6
12:24 Guest63592 joined #perl6
12:25 pugssvn r30679 | colomon++ | [t/spec] First tests for .match using :nth.
12:26 buubot joined #perl6
12:33 buubot joined #perl6
12:36 iblechbot joined #perl6
12:37 wknight8111 joined #perl6
12:38 wknight8111 good morning, #parrot
12:39 moritz_ good localtime() wknight8111
12:39 wknight8111 ah damnit, wrong channel
12:39 wknight8111 not a good start to the day
12:39 wknight8111 hello moritz
12:39 colomon o/
12:40 moritz_ wknight8111: my day started with taking my girlfriend to the doctor's
12:40 wknight8111 moritz_: I hope everything is alright?
12:40 [Coke] moritz wins. (loses?)
12:40 orafu joined #perl6
12:40 moritz_ yes; was just a rather deep cut in her finger - no nerves harmed though
12:41 * colomon sighs in relief.
12:41 moritz_ a bit of blood lost, some initial confusion, and now a bandage for a few weeks
12:41 moritz_ and emails without the letters 'a', 'q', and 'y' (on a qwertz keyboard) :-)
12:45 isBEKaml rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; $path.match(/ \s* \(.*\/ \) \s* \( <-[ / ]> \) \s* /); say $path; my $dirname=$0; say $dirname; my $filename= $1; say $filename;
12:45 p6eval rakudo 2d0fc2: OUTPUT«/home/user/name/something/so​methingmore/mroethansomething/fieln​ame/gacknofielname/filename␤Method 'postcircumfix:<[ ]>' not found for invocant of class ''␤current instr.: '!postcircumfix:<[ ]>' pc 11329 (src/builtins/Role.pir:26)␤»
12:45 isBEKaml match is rather painful here. I almost wish for m/// op! :(
12:46 eternaleye isBEKaml: rx{ foo }
12:46 eternaleye or m,foo,
12:46 isBEKaml eternaleye: thanks, I'll try that out..
12:46 moritz_ isBEKaml: m// exists in rakudo, it just can't take adverbs yet
12:49 eternaleye rakudo:  my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; $path.match( rx{ \s* (.*/ ) \s* ( <-[ / ]> ) \s* });  say $path; my $dirname=$0; say $dirname; my $filename= $1; say $filename;
12:49 p6eval rakudo 2d0fc2: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
12:49 colomon isBEKaml: also, .match does not change $path, it just returns a Match object (which you are throwing away).
12:49 bpalmer left #perl6
12:49 colomon and $0 and $1 don't exist anymore (I think), and their p6 equivalents are not set when you call .match.
12:50 * moritz_ wishes for a matlab parser with STD.pm6-like magic at explaining errors
12:50 eternaleye rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; $path ~~ m,\s* (.*/ ) \s* ( <-[ / ]> ) \s*,; say $path; my $dirname=$0; say $dirname; my $filename= $1; say $filename;
12:50 p6eval rakudo 2d0fc2: OUTPUT«Confused at line 11, near "$path ~~ m"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
12:50 moritz_ colomon: $0 is an alias to $/[0]
12:50 moritz_ it does exist
12:50 colomon ah, okay.
12:50 colomon but it definitely is not set by .match.
12:50 * BrowserUk hates mailing list!
12:50 isBEKaml rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; $path ~~ rx{ \s*  (.*\/) \s* ( <- [ / ]>* ) \s* }; say $path; my $dirname=$0; say $dirname; my $filename= $1; say $filename;
12:50 p6eval rakudo 2d0fc2: OUTPUT«/home/user/name/something/somethingmore/m​roethansomething/fielname/gacknofielname/filenam​e␤/home/user/name/something/somethingmore/mroeth​ansomething/fielname/gacknofielname/␤filename␤»
12:50 isBEKaml \o/
12:51 eternaleye rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; $path ~~ rx{ :s  (.*\/) ( <- [ / ]>* ) }; say $path; my $dirname=$0; say $dirname; my $filename= $1; say $filename;
12:51 p6eval rakudo 2d0fc2: OUTPUT«/home/user/name/something/somethingmore/m​roethansomething/fielname/gacknofielname/filenam​e␤/home/user/name/something/somethingmore/mroeth​ansomething/fielname/gacknofielname/␤filename␤»
12:52 eternaleye Mmmm, delicious :sigspace
12:52 isBEKaml eternaleye++ #cleaner regex!
12:53 isBEKaml colomon: uhh, match does throw the Match object and $0, $1 do exist, I guess (from my cursory reading of S05)
12:54 eternaleye isBEKaml: It doesn't automagically put the match it returns in $/ though
12:54 colomon "throw the Match object"?
12:54 isBEKaml eternaleye: uh, isn't $/ implicit match object?
12:54 pencilk joined #perl6
12:54 eternaleye So $0 doesn't get aliased for .match, when it does for ~~
12:54 eternaleye $/ is for smartmatched regexes IIUC
12:55 eternaleye Grammar.parse doesn't set it either AFAIU
12:55 moritz_ Grammar.parse also sets $/, by #perl6 community decree
12:55 eternaleye Oh, okay
12:55 moritz_ we need to put that into the spec, though
12:55 colomon rakudo: "hello world".match(/.o/); say ~$/
12:55 p6eval rakudo 2d0fc2: OUTPUT«Any()␤»
12:55 isBEKaml colomon: *throw* match object ? like in, out the window?
12:55 colomon moritz_: and the implementations?
12:56 * isBEKaml is really confused...
12:56 envi^home joined #perl6
12:56 colomon Grammar.parse setting $/ seems like a really really really bad idea?
12:56 colomon unless that's not the same as Regex::Cursor.parse?
12:57 * colomon is confused too.
12:57 colomon ah, wait.
12:57 eternaleye rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; rule dirname { / <-[/\0]> ** / / }; rule filename { <-[/\0]> }; $path ~~ rx{ <dirname> <filename> }; say $path; say $<dirname>; say $<filename>;
12:57 p6eval rakudo 2d0fc2: OUTPUT«Malformed regex at line 11, near "dirname { "␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
12:57 colomon Grammar.parse sets $/, but .match doesn't.  yes?
12:58 eternaleye rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; rule dirname { / <-[/]> ** / / }; rule filename { <-[/]> }; $path ~~ rx{ <dirname> <filename> }; say $path; say $<dirname>; say $<filename>;
12:58 p6eval rakudo 2d0fc2: OUTPUT«Malformed regex at line 11, near "dirname { "␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
12:58 eternaleye rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; rule dirname { '/' <-[/\0]> ** '/' '/' }; rule filename { <-[/\0]> }; $path ~~ rx{ <dirname> <filename> }; say $path; say $<dirname>; say $<filename>;
12:58 p6eval rakudo 2d0fc2: OUTPUT«Useless declaration of has-scoped rule in a module; add our or my to install it in the lexpad or namespace␤Useless declaration of has-scoped rule in a module; add our or my to install it in the lexpad or namespace␤Method 'dirname' not found for invocant of class
12:58 p6eval ..'Regex;Cursor'␤curr…
12:59 eternaleye rakudo: my $path="/home/user/name/something/somethingmore/mro​ethansomething/fielname/gacknofielname/filename"; my rule dirname { '/' <-[/\0]> ** '/' '/' }; my rule filename { <-[/\0]> }; $path ~~ rx{ <dirname> <filename> }; say $path; say $<dirname>; say $<filename>;
12:59 p6eval rakudo 2d0fc2: OUTPUT«Method 'dirname' not found for invocant of class 'Regex;Cursor'␤current instr.: '_block93' pc 1261 (EVAL_1:410)␤»
12:59 ive joined #perl6
12:59 eternaleye Is fallback to <&lexical> not implemented?
12:59 moritz_ no :(
13:00 eternaleye Also, error message for unquoted 'potential metasyntax' is very LTA
13:02 moritz_ \o/ my $work simulations finally start to make sense
13:03 moritz_ or not :(
13:03 moritz_ plotted the wrong quantity
13:04 * mathw is busy fighting with SSL
13:05 * colomon is trying to put off the nasty bit with integrating a new version of the libraries we use for some $work projects.
13:11 dalek rakudo: 31598e9 | (Solomon Foster)++ | src/core/Cool-str.pm:
13:11 dalek rakudo: Add beginnings of support for :nth argument to .match.
13:11 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/3​1598e90f3035b1154925d7329bd98a17b84a3f1
13:11 dalek rakudo: da6b23e | (Solomon Foster)++ | t/spectest.data:
13:11 dalek rakudo: Turn on  new counted-match.t.
13:11 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/d​a6b23ed2c9ab637fb3a4fcb48fe3df137a30fb0
13:15 colomon moritz_: your turn to do :x  ?  ;)
13:16 moritz_ colomon: don't know if I'll get around to it today
13:16 moritz_ colomon: I still plan to write up a challenge tonight
13:16 colomon moritz_++
13:16 moritz_ even if it will be a boring one
13:16 colomon I may take a stab at :x too, just trying for that back and forth work with you again -- it's -Ofun and productive.
13:17 moritz_ it is
13:17 colomon ooooo, I think I just figured out how to implement :ex
13:17 moritz_ and tonight (ie in about 3 or 4 hours) I should have time for that kinda fun again
13:17 moritz_ colomon: it's just $match.next or so
13:17 colomon no, :ov, actually.
13:17 colomon $match.next ?
13:17 moritz_ and :ov is quite easy
13:18 moritz_ that's how it was with PGE
13:18 moritz_ for :ov, just set :c to $/.from + 1
13:18 colomon moritz_: yeah, that's what I figured out.  ;)
13:18 colomon $match.next is the next possible match?
13:18 moritz_ it was, with PGE
13:19 moritz_ and iterating while .next returned a true value was the way to implement :exhaustive
13:19 colomon that would be pretty sweet.
13:19 moritz_ not sure if the ordering was right, though
13:20 isBEKaml what does (?!\n) mean in p5 regexes?
13:20 orafu joined #perl6
13:20 isBEKaml I understand \n, ?! --- ?
13:20 moritz_ negative look-ahead
13:20 moritz_ (?!...)
13:20 moritz_ perldoc perlre
13:20 moritz_ search for 'ahead'
13:20 colomon "The order within each starting position is not guaranteed and may depend on the nature of both the pattern and the matching engine."  (for :ex)
13:20 moritz_ ah, great
13:21 * moritz_ should stop trying to remember random details from S0d
13:21 * colomon hopes :ex is allowed to be lazy....
13:21 isBEKaml moritz_++
13:24 colomon "return all matches in list context, or a disjunction of matches in item context."  I thought we didn't have list / item context any more?  I'm certainly hard pressed to see how to implement this....
13:25 moritz_ right, that's a fossile
13:33 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s (/\.)+ (/||\Z\(?!\n)) }, "/", :g); $newpath.perl.say;
13:33 p6eval rakudo 2d0fc2: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
13:33 isBEKaml uhh, I thought rx {} blocks were lexically scoped... :(
13:34 moritz_ std: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s (/\.)+ (/||\Z\(?!\n)) }, "/", :g); $newpath.perl.say;
13:34 p6eval std 30679: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unrecognized regex metacharacter (must be quoted to match literally) at /tmp/Ty42dI2Nb2 line 1:␤------> [32m; my $newpath = $somepath.subst(rx{:s (/[33m⏏[31m\.)+ (/||\Z\(?!\n)) }, "/", :g); $newpat[0m␤Can't call method "_REDUCE" on unblessed
13:34 p6eval ..refer…
13:40 isBEKaml <alpha> covers numerics too? if not, what would be an alphanumeric class? <alnum> ?
13:40 isBEKaml (guessing here)
13:40 moritz_ rakudo: say 3 ~~ /<alpha>/
13:41 p6eval rakudo 2d0fc2: OUTPUT«␤»
13:41 moritz_ rakudo: say 3 ~~ /\w/
13:41 p6eval rakudo 2d0fc2: OUTPUT«3␤»
13:41 moritz_ rakudo: say 3 ~~ /<alnum>/
13:41 p6eval rakudo 2d0fc2: OUTPUT«3␤»
13:41 isBEKaml right.. :)
13:42 orafu joined #perl6
13:46 ruoso joined #perl6
13:49 perlygatekeeper joined #perl6
13:53 szabgab joined #perl6
13:57 kaare joined #perl6
13:58 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s ( \/\.)+ (\/||\Z\(?!\n)) }, "/", :g); $newpath.perl.say;
13:58 p6eval rakudo 2d0fc2: OUTPUT«Obsolete use of \Z as end-of-string matcher;in Perl 6 please use \n?$ instead at line 11, near "\\(?!\\n)) }"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
13:59 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s ( \/\.)+ (\/|| (?!\n)) }, "/", :g); $newpath.perl.say;
13:59 p6eval rakudo 2d0fc2: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
13:59 moritz_ what is this (?! thing you're trying to use? :-_)
14:00 moritz_ rakudo: say 'ab' ~~ / . <!before 'b'> /
14:00 isBEKaml nothing much, i have replaced it with <-[<alnum>]*$>
14:00 p6eval rakudo 2d0fc2: OUTPUT«b␤»
14:00 moritz_ rakudo: say 'ab' ~~ / . <!before '3'> /
14:00 p6eval rakudo 2d0fc2: OUTPUT«a␤»
14:00 moritz_ isBEKaml: it's still in your regex
14:01 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s ( \/\.)+ (\/|| <-[<alnum>]*$>) }, "/", :g); $newpath.perl.say;
14:01 p6eval rakudo 2d0fc2: OUTPUT«regex assertion not terminated by angle bracket at line 11, near "*$>) }, \"/"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
14:01 isBEKaml :D
14:02 gbacon_ joined #perl6
14:02 moritz_ <-[<alnum>]*$> looks very wrong
14:02 isBEKaml no, not that, check this...
14:02 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s ( /\.)+ (/|| <-[<alnum>]*$>) }, "/", :g); $newpath.perl.say;
14:02 p6eval rakudo 2d0fc2: OUTPUT«Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
14:03 eternaleye joined #perl6
14:03 isBEKaml I replace / with \/, it doesn't seem to make sense to me. :(
14:03 moritz_ <-[<alnum>]*$> still looks very wrong
14:03 isBEKaml how do I check before end of string?
14:03 cognominal rakudo:   grammar C {  token a { a } } ; say 'a' ~~ / <C::a> /
14:03 p6eval rakudo 2d0fc2: OUTPUT«regex assertion not terminated by angle bracket at line 11, near "::a> /"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
14:04 moritz_ isBEKaml: $ is end of string, and zero-width
14:05 dalek joined #perl6
14:05 isBEKaml moritz_: hmm, I'll double check again if I really need this...
14:11 plobsing joined #perl6
14:15 isBEKaml aah, I got it working...
14:15 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:s ( \/\.)+ \/}, "/", :g); $newpath.perl.say;
14:15 p6eval rakudo 2d0fc2: OUTPUT«"/home/user/somenrefil/moreso/"␤»
14:15 isBEKaml \o/
14:16 isBEKaml why does "/" need escaping? It isn't a special regex character, right?
14:16 moritz_ evertyhing that doesn't match \w needs escaping
14:16 isBEKaml dannit, that's tough! :D
14:17 moritz_ otherwise when you read a control character, you have to remember if it has a special meaning or not
14:17 moritz_ to understand what it means
14:17 moritz_ we try to minimize the cases of random lists you have to learn
14:17 moritz_ but you can now also escape with '/' in regexes
14:18 isBEKaml but that would turn into an unreadable mess!
14:19 moritz_ for one character, maybe
14:19 moritz_ for longer literals it's great
14:19 isBEKaml are spaces important in regexes? are there switches that can ignore whitespaces inbetween regex clusters?
14:19 isBEKaml :s in rx, anything else?
14:19 isBEKaml subst?
14:19 moritz_ spaces are only singificant when :s/:sigspace is in effect
14:19 SmokeMachine joined #perl6
14:19 moritz_ or for 'rule's (vs. 'token')
14:20 isBEKaml giving a switch to ignore whitespace might offer a way out of an unreadable dump of a long regex pattern
14:21 sbp "otherwise when you read a control character, you have to remember if it has a special meaning or not" - what's wrong with doing that?
14:21 isBEKaml like we had in p5, the m swtich for multi line regexes..
14:21 moritz_ isBEKaml: it's default already
14:21 moritz_ sbp: mental load
14:21 sbp oh, rather than programming load you mean
14:22 isBEKaml moritz_: Oh, that's great!
14:22 moritz_ isBEKaml: it's only significant in your case because of that :s
14:22 moritz_ sbp: it's just an additional thing you have to remember; and the more you have to remember, the longer it takes to learn something
14:22 isBEKaml moritz_: I thought you meant insignificant..
14:22 moritz_ isBEKaml: that would be :!s
14:23 isBEKaml rakudo: my $somepath="/home/user/././somenrefil/./moreso/"; my $newpath = $somepath.subst(rx{:!s ( \/\.)+ \/}, "/", :g); $newpath.perl.say;
14:23 p6eval rakudo 2d0fc2: OUTPUT«"/home/user/somenrefil/moreso/"␤»
14:23 isBEKaml no difference..
14:23 moritz_ isBEKaml: read about the default <.ws> rule in S05
14:24 isBEKaml moritz_: yes, I will get to that, sooner or later.
14:24 sbp yep, fair enough
14:24 sbp I just thought you were saying it's a computational issue
14:24 sbp and I couldn't understand why it would be so
14:25 sbp the fact that it isn't one clears that up rather well :-)
14:25 moritz_ another point is that if you reserve meta characters, you can easily extend the syntax later on
14:25 ashleydev joined #perl6
14:26 moritz_ without resorting to wild character sequences like (?<! ... ) in Perl 5 regexes
14:26 moritz_ which now reads <!after ... >
14:26 sbp is there any adverbial mode to turn that off, to only require the escaping of the currently known metachars, for people who don't care that it may take a while to learn?
14:27 moritz_ sbp: nope.. but once macros are in place, that should be easy to do in a module :-)
14:27 sbp :-)
14:27 moritz_ use Perl5::Insane::Meta::Characters::In::Regexes; # :-)
14:28 moritz_ yes, the new regexes do need some time to get used to
14:29 isBEKaml heh! I was pretty sure I saw this module... # :D
14:30 * moritz_ expects a wave of Acme modules once macros are in place
14:30 moritz_ it's just too tempting
14:31 * moritz_ points to Inline::PERL
14:33 Su-Shee *haha* that is a cool blog name "just raku do it" ;)
14:34 colomon ;)
14:37 isBEKaml /me afk (out for a walk. Regexes always leave him in a daze.... )
14:37 isBEKaml fail!
14:37 moritz_ we all know what's meant :-)
14:38 * isBEKaml really out now (as you can see ;) )
14:48 patspam joined #perl6
14:49 * colomon no longer remembers who it was on #perl6 that came up with "just rakudo it"
14:50 Su-Shee colomon: it's a great slogan.
14:51 moritz_ colomon: I think it was TimToady++
14:51 colomon TimToady++
14:51 gbacon_ joined #perl6
14:54 colomon > "hello world".match(/<[aeiou]>.*/, :overlap)>>.Str.perl.say
14:54 colomon ("ello world", "o world", "orld")
14:55 szabgab joined #perl6
14:56 moritz_ shiny
14:56 TimToady I thought I just came up with the subtitile
14:57 moritz_ TimToady: you'll get the karma, no matter what :-)
14:57 colomon TimToady++ # definitely came up with the subtitle
14:57 TimToady s:3rd/i//
14:58 * colomon dreams of the day when :3rd actually works...
14:59 pugssvn r30680 | colomon++ | [t/spec] Fudged for Rakudo, then tests for the match method version are added.
15:00 TimToady yes, well, like Yogi Berra, I said a great many things I never said.
15:01 Su-Shee You also worked for the NSA I read yesterday in a CS handbook. There you developed Perl.
15:02 TimToady well, not directly for the NSA
15:02 TimToady but they were "The Customer"
15:02 Su-Shee they managed to phrase it very strangely. :)
15:03 TimToady Anything that does not kill me makes me stranger.  :)
15:04 mathw I suspect you have what is not an uncommon problem among the famous people of computer science, TimToady
15:05 Su-Shee of course it is :)
15:05 TimToady CS didn't invent that problem :)
15:06 orafu joined #perl6
15:06 Su-Shee who's writing the OO chapter in "the book"?
15:07 moritz_ mostly jnthn so far, iirc
15:08 moritz_ git log will tell you
15:08 Su-Shee just opened it. ;)
15:08 snarkyboojum joined #perl6
15:13 jnthn o/
15:13 jnthn ooh, timing :-)
15:13 colomon \o
15:13 * jnthn just back from meeting :-)
15:15 jnthn Yes, I did quite a bit of the OO chapter...plan on doing more soon too.
15:15 szabgab joined #perl6
15:15 jnthn After some more bits on subs n sigs :-)
15:15 hercynium joined #perl6
15:15 colomon ooo, just realized I'm going to miss #rs today.
15:16 colomon we're going out to meet a rescue dog and see if she is a good match for our family
15:16 Su-Shee jnthn: can I wish for a good explaination how roles and traits shape the way of OO programming?
15:16 PerlJam colomon: your family needs rescuing?
15:16 PerlJam :)
15:16 jnthn .oO( $family ~~ /rescue dog/ )
15:17 colomon PerlJam: rescuing from the state of doglessness, yes.
15:17 jnthn Su-Shee: You can wish. I'll try and make said wish come true. :-)
15:17 jnthn colomon: OK, no worries; feel free to pre-paste a report and people can find it in the infrared clog.
15:17 * moritz_ chuckles
15:17 Su-Shee jnthn: that would be nice. while moosing and rakudoing I realized that the only stuff there really is are those smalltalk traits papers and a little ruby mixins...
15:18 colomon jnthn: I didn't know we did clogging here!
15:18 PerlJam Su-Shee: The Moose people have some real-world experience with that.  Perhaps there are some explanatory resources there
15:18 Su-Shee PerlJam: already read everything.
15:18 PerlJam Su-Shee: did you ask on #moose?
15:19 Su-Shee PerlJam: yes.
15:19 PerlJam Su-Shee++ due diligence :)
15:19 Su-Shee PerlJam: and I read the smalltalk stuff.
15:19 Su-Shee all of it doesn't really teach you where the future of OO might be going with roles and traits and little pieces of behavior which suddenly can be combined with powerful functional stuff.
15:20 PerlJam Su-Shee: probably because we haven't gotten there yet :)
15:21 Su-Shee exactly my point. that's something a book should reflect by explaining what you can do and maybe even suggesting what you COULD do with it.
15:22 _buno_ joined #perl6
15:23 szabgab joined #perl6
15:25 PerlJam Su-Shee: the way I look at it is .... it took the CS community decades to get to the point where we had this thing called OOP and then decades more to get to roles/traits, so in 10 years or so we'll start to have an understanding of how roles impact software and have some concept of their true power.  Then, maybe 10 years after that we'll finally "understand" them.
15:33 pnu joined #perl6
15:33 broquaint joined #perl6
15:33 silug joined #perl6
15:34 diakopter joined #perl6
15:34 huf joined #perl6
15:34 xinming joined #perl6
15:37 TimToady_ joined #perl6
15:37 silug_ joined #perl6
15:38 baest joined #perl6
15:39 Maddingue joined #perl6
15:39 dalek rakudo: c515f5f | (Solomon Foster)++ | src/core/Cool-str.pm:
15:39 dalek rakudo: Implement :overlap for Any.match.
15:39 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c​515f5f6dbeaa81a08759415ce8c346d885894a6
15:39 dalek rakudo: 6894296 | (Solomon Foster)++ | t/spectest.data:
15:39 dalek rakudo: Turn on overlapping.t.
15:39 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6​894296970adb80ff0e564336db5d19785f206f4
15:40 IllvilJa joined #perl6
15:41 Guest63592 joined #perl6
15:42 IllvilJa o/
15:45 Jedai joined #perl6
15:47 colomon \o
15:47 isBEKaml joined #perl6
15:47 isBEKaml I keep getting this error even as @letters is declared at the top of file ... "Symbol '@letters' not predeclared in draw_board "
15:48 moritz_ isBEKaml: example?
15:48 ive joined #perl6
15:48 isBEKaml moritz_: It's available in pugs/examples/games/hangman.pl
15:50 isBEKaml moritz_: I worked around this by "my @letters if !defined(@letters); " -- having to do this for every variable is .... LTA
15:50 moritz_ looking now, have to recompile first though
15:51 isBEKaml moritz_: it won't. That's what I'm up against. :)
15:51 moritz_ recompile my rakudo, that is
15:51 isBEKaml oh..
15:51 PerlJam isBEKaml: What revision of rakudo are you using?
15:51 isBEKaml PerlJam: I built it last night.
15:52 moritz_ rakudo: 1 orelse 2
15:52 p6eval rakudo da6b23: OUTPUT«Confused at line 11, near "1 orelse 2"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
15:52 moritz_ so it won't work without modifications anyway
15:52 moritz_ perl6 examples/games/hangman.pl
15:52 moritz_ Unable to parse blockoid, couldn't find final '}' at line 20
15:53 isBEKaml moritz_: I was able to modify File::Spec::Unix so that I can work with hangman.pl. Isolated the problem to hangman.pl now.
15:53 moritz_ isBEKaml: then please commit your changes
15:53 moritz_ otherwise we'll have a hard time reproducing your problem
15:54 [Coke] moritz_: that's the orelse.
15:54 isBEKaml moritz_: Alright. I haven't fully solved it though. Just touched on File::Spec::Unix and hangman.pl
15:54 [Coke] and yah, better than having all of us chasing your WIP. =-)
15:54 isBEKaml WIP?
15:54 isBEKaml :P
15:54 moritz_ work in progress
15:55 TimToady Void is not a valid typename at line 14
15:56 pugssvn r30681 | moritz++ | [examples] start to correct and simplify hangman.pl
15:56 moritz_ we'd call that Nothing, just so that we can write 'returns Nothing'
15:57 TimToady std: subset Nothing of Sink;
15:57 p6eval std 30680: OUTPUT«ok 00:01 113m␤»
15:57 PerlJam I'd like a Sink so that I can derive a KitchenSink  :)
15:57 TimToady std: KitchenSink
15:57 p6eval std 30680: OUTPUT«ok 00:01 110m␤»
15:57 TimToady KitchenSink is already there
15:57 moritz_ 1 while $dict.lines ~~ rx:P5/\S/; # WTF?
15:58 isBEKaml moritz_: yes.. there were quite lot of problems and I had made an helluva lot of changes over it..
15:58 moritz_ loop endlessly if there's a non-blank in the file?
15:58 moritz_ isBEKaml: then commit it. Now.
15:58 TimToady it solves the halting problem :)
15:59 moritz_ it just takes its time :-)
15:59 isBEKaml moritz_: yours gets overwritten then..
15:59 rv2733 joined #perl6
15:59 moritz_ isBEKaml: I don't mind, if yours are better :-)
15:59 isBEKaml moritz_: not necessarily... ;)
15:59 PerlJam isBEKaml: It's in the repo anyway if we want moritz_'s back
16:00 isBEKaml I cannot connect to server.. :(
16:00 PerlJam isBEKaml: pastebin it then
16:01 isBEKaml ok, committing now..
16:01 pugssvn r30682 | svatsan++ | [examples] make hangman.pl compatible with Rakudo
16:02 moritz_ decommute &
16:02 pugssvn r30683 | svatsan++ | [ext] File::Spec::Unix compatiblity issues fixed
16:03 isBEKaml more... File::Spec::Unix.pm
16:03 isBEKaml Getting File::Spec::Unix to be used by hangman.pl was pretty awkward.. I copied the module over to ~/.perl6/lib folder . :(
16:04 [Coke] when installing rakudo, how can I specify where it should be installed?
16:05 PerlJam the most annoying thing for me lately is that I keep wanting to create variable names $like-this in Perl 5.  :)
16:05 isBEKaml Rakudo by default would be installed in the current location..
16:05 * PerlJam goes back to coding Perl 5
16:07 [Coke] looking at the makefilie, it seems to rely on DESTDIR which is never defined.
16:07 [Coke] (ah, that's kind of a red herring. nevermind.)
16:10 slavik joined #perl6
16:10 isBEKaml setting PERL6LIB environment variable didn't cut it, either..
16:16 pnate joined #perl6
16:19 alester joined #perl6
16:20 isBEKaml perl6 examples/games/hangman.pl
16:20 isBEKaml lol
16:21 cdarroch joined #perl6
16:21 cdarroch joined #perl6
16:25 isBEKaml My question was why don't globals work here? Or do we have a strict rule against using them?
16:34 isBEKaml rakudo: my $varstr = $*PROGBIND || "."; say $varstr;
16:34 p6eval rakudo da6b23: OUTPUT«.␤»
16:43 szabgab joined #perl6
16:50 molaf joined #perl6
16:55 Trashlord joined #perl6
17:04 [Coke] would anyone else like it if rakudo installed itself as rakudo (in addition to perl6) ?
17:05 [Coke] or, perl6-rakudo, or something else with the flavor in the name?
17:05 [Coke] whoever got the installing working, btw, +1.
17:05 moritz_ I'd like just "rakudo"
17:08 moritz_ having two binaries with different names would be confusing
17:08 TimToady maybe you should install it as R*  :)
17:08 sorear and "ng"
17:08 [Coke] moritz_: it's a common trick to have, e.g., tcl-8.4 and tcl-8.5 installed separately, and have tclsh be linked to the preferred one.
17:09 TimToady rakudo is kinda the "auth" in the name
17:09 [Coke] changing it wholesale to rakudo would certainly be an easier patch, though. =-)
17:10 sbp I vote for just kudo
17:10 sbp then you can install multiple kudos
17:10 sbp don't think about incrementing the k per version though
17:10 sbp will lead to problems down the line on many systems
17:11 Su-Shee the roles and traits idea come from smalltalk, right?
17:14 pugssvn r30684 | lwall++ | [hangman] fix syntax problems pointed out by STD
17:14 jgabr joined #perl6
17:15 [Coke] pugs svn pretty webterface?
17:16 diakopter http://perlcabal.org/svn/pugs/
17:18 jgabr Hi. Haven't seen any updates to planetsix in a while, but I see Gabor (for one) has been doing some blogging.
17:18 [Coke] diakopter: danke.
17:19 [Coke] jgabr: under what url do you see gabor's postings?
17:19 jgabr Coke: on his blog, I mean.
17:19 diakopter jgabr: but not with the perl6 tag
17:19 jgabr Ah.
17:19 [Coke] this is the feed we're pulling from him: http://szabgab.com/blog/Perl%206.rss
17:20 jgabr Whoops. Thanks.
17:20 jgabr Guess it's just been a quiet week Perl 6 blogwise.
17:21 diakopter I should have a new post this week.
17:22 moritz_ diakopter: do you want to write/mentor a new challenge?
17:23 diakopter "implement labels/goto in rakudo"
17:23 moritz_ diakopter: if you can mentor that, and give step-by-step introductions... sure :-)
17:23 jnthn diakopter: I look forward to it. :-)
17:24 Su-Shee "import rakudo into any browser by the way of sprixel." ;)
17:24 diakopter har.
17:24 diakopter the js sprixel? not possible, since it depends on the perl5 STD
17:25 diakopter the clr sprixel? someday, yes, when it runs in silverlight.
17:25 jnthn meh, just host STD and use AJAC ;-)
17:26 jgabr left #perl6
17:26 Su-Shee web sockets.
17:29 isBEKaml TimToady: how many errors did you get with hangman? ;)
17:39 isBEKaml I give up! ## It's crazy running around in loops over globals :(
17:40 isBEKaml "Symbol '$progdir' not predeclared in <anonymous>"
17:41 dju joined #perl6
17:43 dju joined #perl6
17:44 pugssvn r30685 | svatsan++ | [ext] Fixed File::Spec::Unix
17:44 * isBEKaml has **really** given up
17:58 pugssvn r30686 | moritz++ | [t/spec] regex modifier :x(Int) and :x(Range) tests
18:00 moritz_ rakudo: say (1..^3).max
18:00 p6eval rakudo 689429: OUTPUT«3␤»
18:00 moritz_ is that correct?
18:02 isBEKaml moritz_: I don't think so.
18:02 isBEKaml rakudo: say (1..^3)
18:02 p6eval rakudo 689429: OUTPUT«12␤»
18:04 TimToady that's correct; ranges are primarily intervals, and return the endpoint
18:04 TimToady however
18:05 TimToady rakudo: say (1 ...^ 3).max  # might be NYI
18:05 p6eval rakudo 689429: OUTPUT«1␤»
18:05 TimToady yes
18:05 moritz_ huh? that exists? :-)
18:05 aindilis` joined #perl6
18:05 TimToady rakudo: say (1 ... 2.999999999999).max  # might be NYI
18:05 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:06 TimToady rakudo: say (1.0 ... 2.999999999999).max
18:06 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:06 TimToady rakudo: say (1,2,3 ... 2.999999999999).max
18:06 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:06 TimToady rakudo: say (1.0,2.0,3.0 ... 2.999999999999).max
18:06 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:06 TimToady hmm
18:07 ejs joined #perl6
18:08 TimToady rakudo: say (1 ... 5)
18:08 p6eval rakudo 689429: OUTPUT«12345␤»
18:08 TimToady rakudo: say (1 ... 4.9)
18:08 p6eval rakudo 689429: OUTPUT«1234␤»
18:08 TimToady rakudo: say (1 ... 4.9).max
18:08 p6eval rakudo 689429: OUTPUT«4␤»
18:09 TimToady rakudo: say (1 ... 4.99999999).max
18:09 p6eval rakudo 689429: OUTPUT«4␤»
18:09 TimToady rakudo: say (1 ... 4.99999999999999999).max
18:09 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:09 TimToady right
18:10 TimToady say 2.999999999999.WHAT
18:10 TimToady rakudo: say 2.999999999999.WHAT
18:10 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:10 TimToady rakudo: say 2.99999999999.WHAT
18:10 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:10 TimToady rakudo: say 2.9999999999.WHAT
18:10 p6eval rakudo 689429: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are:␤:(Int $a, Int $b)␤␤current instr.: 'perl6;Rat;new' pc 486672 (src/gen/core.pir:69639)␤»
18:10 TimToady rakudo: say 2.999999999.WHAT
18:10 p6eval rakudo 689429: OUTPUT«Rat()␤»
18:11 TimToady 32-bit limitations, I guess
18:11 TimToady rakudo: say (1..4.9).max
18:11 p6eval rakudo 689429: OUTPUT«4.9␤»
18:12 TimToady rakudo: say (1 ...^ 4.9).max
18:12 p6eval rakudo 689429: OUTPUT«1␤»
18:12 TimToady rakudo: say (1 ... (^4.9)).max
18:12 p6eval rakudo 689429: OUTPUT«1␤»
18:13 TimToady rakudo: say (1 ... (0,1,2,3)).max
18:13 p6eval rakudo 689429: OUTPUT«1␤»
18:13 TimToady rakudo: say (1 ... 0,1,2,3).max
18:13 p6eval rakudo 689429: OUTPUT«1␤»
18:13 TimToady ooh, that's a bug
18:15 TimToady rakudo: say ^4.9
18:15 p6eval rakudo 689429: OUTPUT«01234␤»
18:15 TimToady rakudo: say ^4.0000000000000000000000000001
18:15 p6eval rakudo 689429: OUTPUT«PAST::Compiler can't compile node of type BigInt␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
18:15 TimToady sugoi
18:24 pugssvn r30687 | moritz++ | [t/spec] correct one :x test, add another one
18:27 * moritz_ now spectests a patch that implements :x on .match
18:29 [Coke] rs in 60m?
18:29 moritz_ yes, I think so
18:31 moritz_ oh, that patch broke :nth. Bad moritz_, no cookie
18:33 jnthn 60m?
18:34 jnthn I thought it was in 30m and was about to say I had a scheduling FAIL and would be 10 mins late or so...
18:34 moritz_ you might be right... I never got around to writing down the time :-)
18:34 moritz_ right, we did start 19UTC last week
18:35 moritz_ rakudo: say (1, 2, 3).defined
18:35 p6eval rakudo 689429: OUTPUT«1␤»
18:35 moritz_ rakudo: say any(1, 2, 3).defined
18:35 p6eval rakudo 689429: OUTPUT«1␤»
18:35 Sanitoeter joined #perl6
18:36 jnthn OK
18:36 moritz_ I don't care much either way
18:37 jnthn It'll likely be a quiet one today - I didn't see pmichaud around yet, masak is likely having fun in Russia (and rightly so :-)), colomon can't make it either.
18:38 moritz_ indeed
18:42 Guest63592 joined #perl6
18:54 sahadev joined #perl6
19:02 ShaneC joined #perl6
19:02 ShaneC left #perl6
19:06 BrowserUk ?
19:06 moritz_ !
19:16 Trashlord joined #perl6
19:22 ruoso perl6: my $a; { my $b = 1; $a = sub { return eval '$b++' } }; say $a.(); say $a.(); say $a.();
19:22 p6eval elf 30687: OUTPUT«Variable "$b" is not available at (eval 130) line 3.␤0␤Variable "$b" is not available at (eval 132) line 3.␤0␤Variable "$b" is not available at (eval 134) line 3.␤0␤»
19:22 p6eval ..pugs, rakudo 689429: OUTPUT«1␤2␤3␤»
19:26 * jnthn back
19:27 rindolf joined #perl6
19:28 rindolf Hi all.
19:28 jnthn o/ rindolf
19:28 rindolf rakudo: product [1 .. 4]
19:28 p6eval rakudo 689429: OUTPUT«Could not find sub &product␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
19:28 rindolf Hi jnthn
19:28 rindolf rakudo: [1..4].product()
19:28 jnthn rakudo: say [*] 1..4
19:28 p6eval rakudo 689429: OUTPUT«Method 'product' not found for invocant of class 'Array'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
19:28 p6eval rakudo 689429: OUTPUT«24␤»
19:28 eternaleye (just rakudo it origins) http://irclog.perlgeek.de/​perl6/2010-02-24#i_2027606
19:28 rindolf rakudo: [*] 1..4
19:28 p6eval rakudo 689429:  ( no output )
19:29 rindolf rakudo: ([*] 1..4).say
19:29 p6eval rakudo 689429: OUTPUT«24␤»
19:35 moritz_ rakudo: <a b c>.map: *.say
19:35 p6eval rakudo 689429:  ( no output )
19:36 lisppaste3 sahadev pasted "t/spec/S32-list/classify.t fixed" at http://paste.lisp.org/display/99420
19:37 moritz_ sahadev: the real fix is to move it outside of eval
19:38 moritz_ *and* add those commas
19:39 moritz_ sahadev: feel free to push your patch anyway... if you /msg me your email address, I can give you a commit bit to the pugs repo
19:39 sahadev the first one still needs eval (otherwise, fails with error: ":= binding of variables not yet implemented")
19:39 phenny sahadev: 15 May 14:29Z <moritz_> tell sahadev that I've applied most patches from your 'book' fork; I didn't apply the one about custom paper size because it makes it harder to talk about a specific page number across platforms
19:39 sahadev thanks, phenny
19:39 moritz_ sahadev: then a  #?rakudo skip 'binding NYI'  before the block should be used
19:40 sahadev moritz_: ok
19:41 moritz_ rakudo: my (@even, @odd); :(:@even, :@odd) = classify { $_ % 2 ?? 'odd' !! 'even' }, 1,2,3,4; say @even.perl
19:41 p6eval rakudo 689429: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 17864 (src/builtins/Junction.pir:393)␤»
19:41 moritz_ rakudo: my (@even, @odd); :(:@even, :@odd) := classify { $_ % 2 ?? 'odd' !! 'even' }, 1,2,3,4; say @even.perl
19:41 p6eval rakudo 689429: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤current instr.: '' pc 0 (EVAL_2:1)␤»
19:43 [Coke] are the perl6 advent files checked in anywhere as tests?
19:43 moritz_ nope
19:43 [Coke] (and if not, any suggestions on where to put them? pugs/t/<mumble> ?
19:44 [Coke] t/advent/2009/ ?
19:44 PerlJam [Coke]: sounds good.
19:44 moritz_ [Coke]: t/spec/integration/advent2009-$mumble.t
19:46 moritz_ sahadev: welcome to the pugs repo. It's a custom to add yourself to AUTHORS in the first commit (and that way testing your commit bit)
19:46 sahadev moritz_: thanks.
19:47 ruoso TimToady, we got to an interesting point at the list, at which we're getting to the conclusion that supporting closing over all values (supporting access of data even from string eval or arbitrary CALLER::{$val} and OUTER::{$val}) might pose a challenge to threading...
19:47 ruoso and maybe we're at the balance of concerns
19:49 ruoso requiring a static analisys of which variables need to be in the closure lexpad would be quite important in terms of threading semantics
19:49 ruoso this would mean "my $a; { my $b = 1; $a = sub { return eval '$b++' } }; say $a.(); say $a.(); say $a.()" would stop working
19:50 moritz_ as it does in perl 5, iirc
19:50 ruoso yes...
19:53 ruoso BrowserUk, anyway... the above comes from our discussion on the list ^^
19:54 * ruoso assumes BrowserUk and nigelsandever are actually the same person
19:59 jnthn "spent about three days humping" isn't a phrase I ever expected to see in a Parrot release announcement!
20:01 pugssvn r30688 | sahadev++ | added myself to the list
20:02 moritz_ ok, seems I finally have a *working* patch for :x
20:02 moritz_ after I added a safety feature of which I am convinced I don't need it
20:02 jnthn moritz_: Yay!
20:03 moritz_ but without it all test for :nth go wrong
20:06 iblechbot joined #perl6
20:16 * diakopter is finding it difficult to think inside the box.
20:19 diakopter or outside, for that matter.
20:19 moritz_ which box?
20:19 diakopter :)
20:20 diakopter trying to wrap my head around the semantacists on p6l
20:20 diakopter their writings, I mean
20:20 moritz_ oh
20:20 moritz_ I've started to routinely ignore any threads which go > 5 in depth
20:20 dalek rakudo: cf5afac | moritz++ |  (2 files):
20:20 dalek rakudo: implement :x in Any.match; also test it
20:20 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/c​f5afac745c18fa9cd34c060899e2d80a96347ca
20:23 diakopter I believe I do need to understand what they're writing.. it just .. may take a few more years.
20:23 sahadev moritz_: looks like my copy of t/spec was out of date. you seem to have already committed the suggested changes to S32-list/classify.t.
20:24 moritz_ sahadev: ah. I remembered writing such a patch myself, but assumed I'd forgotten to push it
20:24 sahadev i have to find something else to commit (if only to justify the addition of myself to AUTHORS)
20:24 diakopter :)
20:24 moritz_ sahadev: no hurry :-)
20:24 diakopter authoring AUTHORS is authoring too
20:24 sahadev diakopter: that kind of authoring, i can do any day :)
20:26 diakopter rakudo: my &marine = *; marine(marine, marine(marine)); say 'done'
20:26 p6eval rakudo 689429: OUTPUT«done␤»
20:26 rindolf Hmmm... why is git pull from the rakudo github repos so slow here?
20:26 moritz_ rindolf: slow network?
20:26 PerlJam rindolf: it's because you're so far away :)
20:27 rindolf moritz_: don't know.
20:27 [Coke] jnthn: yah, I'm a little wierded out there.
20:27 moritz_ rindolf: that would be my first place for investigating, if you plan to do any
20:27 diakopter github intentionally slows down the rakudo repos for people who don't hide behind crickets
20:28 [Coke] moritz_: t/spec/integration/advent2009/day*.t ?\
20:28 rindolf moritz_: it's fine from my wired computer, I think.
20:28 rindolf moritz_: but here I have wireless.
20:28 mikelifeguard joined #perl6
20:28 rindolf moritz_: it's the same Inet connection.
20:28 rindolf 76.00 KiB
20:29 moritz_ [Coke]: please keep the hierarchy flat to two levels below t/spec/ (ie one dir + file name)
20:29 rindolf Not too good.
20:29 moritz_ [Coke]: that's what some test harnesses out there in the wild assume, and it's bad to break their assumptions
20:29 mikelifeguard Is there a tool to automatically check perl code for perl6 compatibility? For example, there is the -3 flag in python 2.6 to tell you where stuff might break in python 3
20:29 [Coke] ok. perhaps I'll collate them to multiple days per file, then.
20:29 moritz_ rindolf: then it's the wireless?
20:29 rindolf moritz_: maybe.
20:30 moritz_ mikelifeguard: Perl 6 is so much different from Perl 5 that compatiblity is only given in *very* trivial scripts
20:30 moritz_ so it doesn't really make sense, IMHO
20:30 rindolf moritz_: I'm getting 318 KB via FTP from a different server in .il.
20:30 mikelifeguard hokay
20:31 moritz_ rindolf: maybe that's why you get so little ssh traffic over the line at the same time :-)
20:31 moritz_ (just kidding)
20:31 rindolf moritz_: heh.
20:31 mikelifeguard left #perl6
20:31 Su-Shee mikelifeguard: the difference between 5 and 6 is plainly larger then between 2.6 and 3. ;)
20:31 rindolf moritz_: now it's 244.00 KiB
20:32 rindolf OK, git pull finished now.
20:42 dalek rakudo: 72ed16f | moritz++ | src/core/Cool-str.pm:
20:42 dalek rakudo: simplify .match(:x) implementation a wee bit
20:42 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​2ed16ffb249c6aa0e86598bf7ff8f50f29338e1
20:46 diakopter sum1 needs to write a Harmony of the Synoptics
20:47 pugssvn r30689 | moritz++ | [t/spec] initial tests for combined modifiers in .match
20:49 Guest44059 left #perl6
20:50 patrickas joined #perl6
20:50 patrickas hello
20:50 moritz_ hi
20:50 ash_ joined #perl6
20:51 patrickas hi moritz_, how the little finger going? hope it is better!
20:51 patrickas :-)
20:52 colomon joined #perl6
20:52 patrickas is MAIN implemented in rakudo yet?
20:52 moritz_ it is
20:52 moritz_ and "no"
20:52 moritz_ it was, in alpha
20:52 orafu joined #perl6
20:53 moritz_ at least basically
20:53 * moritz_ wonders if that would make a good challenge
20:53 iblechbot joined #perl6
20:53 moritz_ you know, a basic command line parser for Perl 6, written in Perl 6
20:53 patrickas ok ... cause I was sure I'd read it was implemented somewhere ... but I could not get it to work ...
20:53 moritz_ and then I'll bribe jnthn++ to hook it up
20:54 colomon match :x   \o/
20:54 patrickas seems like a great challenge ... but maybe a jump a bit too big from the previous two
20:54 moritz_ colomon: I've got another simplication patch in my queue
20:55 moritz_ patrickas: it's not so bad, actually
20:55 colomon moritz_: I worked on Numeric patches while we were on the road, will spectest now that I have power.  :)
20:55 moritz_ patrickas: input would be a list of strings, output should be an array and a hash (of positional and named arguments)
20:56 patrickas ok ... want me to work on it ? or do you want to make it challenge number 3 ?
20:56 moritz_ patrickas: I'd like to make it challenge no. 3 (tomorrow morning)
20:57 moritz_ patrickas: of course you're welcome to work on it too... for this one I'll accept multiple submissions again
20:57 patrickas i could ... but since I am hooked already I'd rather leave the bait for osmeone else ;-)
20:58 moritz_ patrickas++
20:59 patrickas which reminds me ... I was wondering .. how do I detect context in perl6?
20:59 moritz_ simplification patch pushed... only spectested against S05* ... /me hopes the best
20:59 moritz_ patrickas: you don't
20:59 moritz_ patrickas: context doesn't flow inwards like in Perl 5
21:00 moritz_ patrickas: so instead you return objects that behave magically depending on the context
21:00 colomon spectest aborted, then.
21:00 patrickas and the objects behave differently by having secial methonds in them?
21:00 moritz_ anyway, I'm off to bed now
21:00 moritz_ patrickas: right; string context will call .Str etc.
21:00 colomon moritz_: 'night!
21:01 colomon wait, do you know where the #rs log is?
21:01 patrickas thx goodd night
21:01 moritz_ colomon: http://irclog.perlgeek.de/rakudosketch/today not really worth it
21:01 moritz_ really gone &
21:01 colomon moritz_++
21:05 dalek rakudo: 6aedf5e | moritz++ | src/core/Cool-str.pm:
21:05 dalek rakudo: [Any.match] remove some duplicated code
21:05 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6​aedf5ef99939e4ab7666cb9a2fa47ed0bd511b8
21:07 ash_ left #perl6
21:09 wknight8111 joined #perl6
21:16 nimiezko joined #perl6
21:16 diakopter std: \ \.STD
21:16 p6eval std 30689: OUTPUT«ok 00:01 110m␤»
21:17 nimiezko joined #perl6
21:20 nimiezko joined #perl6
21:37 dalek rakudo: 980e03c | (Solomon Foster)++ | src/core/ (2 files):
21:37 dalek rakudo: Implement (generic) Numeric.succ and Numeric.pred.  Remove the multi from Rat's
21:37 dalek rakudo: .succ and .pred.
21:37 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9​80e03c5b07cc1aac63930ac9715a20e54232a4b
21:37 dalek rakudo: 1bf6eab | (Solomon Foster)++ | src/core/ (3 files):
21:37 dalek rakudo: Create postfix:<i> for Numeric and Any, delete the old Complex and Any versions.
21:37 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/1​bf6eab29fa980793889cf23ccb94916d1b350bc
21:39 ethel joined #perl6
21:41 BrowserUk joined #perl6
21:45 BrowserUk ruoso: That example explains your point on the list about string eval. Thanks. I've been sitting here racking my brains trying to see the killer use case for that, and I'm coming up short? The only thing that crosses my mind is to allow lexicals in a REPL, which is a very desirable feature. But it strikes me that shoudl be achievable using a pair of coroutines.
21:45 TimToady interestingly, my $a; { my $b = 1; $a = sub { $b = $b; return eval '$b++' } }; say $a->(); say $a->(); say $a->();
21:45 TimToady does work in p5
21:46 TimToady so it just takes the lexicals from the current scope
21:46 ruoso TimToady, note the additional "$b = $b
21:46 TimToady ruoso: note it?  I put it there...
21:46 ruoso heh
21:46 * ruoso wrote that too quickly
21:46 TimToady but in any case, I'm inclined to put the burden on anyone who uses eval, either to do such workarounds, or to put up with poor performance
21:47 TimToady which, of course, is just another way of arguing it both ways :)
21:47 BrowserUk Ruoso: The first reads from stdin (Sorry $*IN) and then makes what it read available to the other that does the eval in the same context each time. That should work shouldn't it?
21:48 ruoso something like... eval <== $*IN
21:48 ruoso but eval does create a new scope whithin itself, so it wouldn't solve the REPL problem
21:49 ruoso I think we're getting to "we use locks for shared values"...
21:49 ruoso "unless they are actors"
21:50 ruoso I think "actor" is just going to be a different type of object
21:50 BrowserUk Ah! Shame.
21:50 ruoso that simply lives in a different thread and is always invoked through a queue
21:50 colomon TimToady: if you use :x(4) in .subst, it only substitutes if all four reps are found.
21:50 colomon TimToady: If you use :x(4) in .match, does it only match if all four are present?
21:50 TimToady that's the current design
21:51 colomon TimToady: the spec doesn't exactly say for the second, as far as I can see.
21:51 ruoso actor Foo { action bar($a, $b) { } }
21:52 colomon and I think the implementation and tests don't do that yet.
21:52 BrowserUk ruoso: You'll have to give me time to digest that.
21:52 TimToady well, 'x' generally means n times, not up to n times
21:53 patrickas rakudo: class Foo {method Str () { return 'Fourty Two';}};my Foo $x;my Str $s = $x;say $s;
21:53 p6eval rakudo cf5afa: OUTPUT«Type check failed for assignment␤current instr.: '&die' pc 17864 (src/builtins/Junction.pir:393)␤»
21:53 colomon rakudo: "hello world".match(/.o/, :x(5))>>.Str.perl.say
21:53 p6eval rakudo cf5afa: OUTPUT«()␤»
21:54 ruoso BrowserUk, putting it in a different way, the message passing concurrency might be available without prejudice to the shared-state concurrency, and that'd be explicit in the code...
21:54 ruoso and we would be free of green threads
21:55 jnthn patrickas: It's a type constraint, not a type coercion. :-)
21:56 jnthn class Foo {method Str () { return 'Fourty Two';}};myFoo $x;my Str $s = ~$x;say $s;
21:56 jnthn rakudo: class Foo {method Str () { return 'Fourty Two';}};myFoo $x;my Str $s = ~$x;say $s;
21:56 p6eval rakudo cf5afa: OUTPUT«Symbol '$x' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 152 (compilers/pct/src/PCT/HLLCompiler.pir:108)␤»
21:56 jnthn rakudo: class Foo {method Str () { return 'Fourty Two';}};my Foo $x;my Str $s = ~$x;say $s;
21:56 p6eval rakudo cf5afa: OUTPUT«Foo()␤»
21:56 jnthn rakudo: class Foo {method Stringy () { return 'Fourty Two';}};my Foo $x;my Str $s = ~$x;say $s;
21:56 p6eval rakudo cf5afa: OUTPUT«Foo()␤»
21:57 jnthn rakudo: class Foo {method Stringy () { return 'Fourty Two';}};my Foo $x .= new;my Str $s = ~$x;say $s;
21:57 p6eval rakudo cf5afa: OUTPUT«Foo()<0x370b620>␤»
21:57 jnthn rakudo: class Foo {method Str () { return 'Fourty Two';}};my Foo $x .= new;my Str $s = ~$x;say $s;
21:57 p6eval rakudo cf5afa: OUTPUT«Fourty Two␤»
21:57 jnthn Heh.
21:57 ashleydev_ joined #perl6
21:58 patrickas thx!
22:02 patrickas jnthn: so if a function expects Str I cannot pass Foo and expect it to work correctly if foo has a ..Str defined?
22:02 rgrau joined #perl6
22:03 patrickas I guess that would become a problem for multimethods ...
22:06 ashleydev joined #perl6
22:08 pjcj joined #perl6
22:16 sahadev left #perl6
22:17 patrickas I can't find out how to specify List context :(
22:20 jnthn patrickas: No, if you want to coerce then you can write a signature like ($foo as Str)
22:21 jnthn patrickas: @( ...stuff here is in list context... )
22:22 BrowserUk Semantically, what is teh difference between @a <== map { ... } <== grep { ... } <== $*IN and @a  map { ... } grep { ... }  $*IN ?
22:22 patrickas rakudo: class Foo {method Str () { return 'Fourty Two';};method Array () { return (4,2);};method List () { return (4,2);};};my Foo $x .= new;my @ar=@($x);@ar.say ;
22:23 p6eval rakudo cf5afa: OUTPUT«Fourty Two␤»
22:23 patrickas sorry for the total noob questions :(
22:25 BrowserUk *@a = map ...
22:25 jnthn list
22:25 jnthn not List
22:26 jnthn BrowserUk: The second (even with the =) is a syntax error anyway - need a comma between the block and the argument.
22:26 jnthn BrowserUk: The differenence is in laziness, though.
22:26 jnthn And also by using <== you're saying it's OK for the compiler to run each of the things in its own thread
22:26 jnthn And set up a producer/consumer pattern.
22:27 jnthn *compiler to generate code that will...
22:28 BrowserUk jnthn: OKay. So the instead of constructing a huge list and pasing it through the chain, it feeds 1 value through at a time.
22:31 k23z__ joined #perl6
22:31 BrowserUk There would be little or no benefit (indeed probably a cost) in using a separate kernel thread for each stage.
22:31 jnthn BrowserUk: It may also not bother doing anything until you look at @a
22:32 jnthn BrowserUk: List assignment is mostly eager (will not explode things that may be infinite though).
22:32 jnthn BrowserUk: <== and ==> are not.
22:33 BrowserUk Hm Interesting. What if you test the size of the list? Does that then block until the chain completes?
22:33 jnthn Asking .elems on a potentially infinite list is probably a bad idea, yes. :-)
22:35 BrowserUk jnthn: That implies that once you start lazy processing, you have to stick with lazy processing. No safe way to revert to eager.
22:36 jnthn It's only really an issue if the list is infinite though.
22:36 jnthn But yeah
22:36 cognominal joined #perl6
22:37 BrowserUk At some point $*IN will normally be exhausted and @a populated, but I don;t see an easy way to know when that has occurred and it would be safe to do something non-lazy with @a.
22:39 patrickas rakudo: my %h = ("a"=> 1 , "b"=>2 );(map { .WHAT } , %h).say;
22:39 p6eval rakudo cf5afa: OUTPUT«Hash()␤»
22:39 patrickas rakudo: my %h = ("a"=> 1 , "b"=>2 );%h.^add_method( 'list', method (  ) {    return self.pairs; });(map { .WHAT } , %h).say;
22:39 p6eval rakudo cf5afa: OUTPUT«Pair()Pair()␤»
22:40 patrickas How can I add the list methos to the class of %h instead of %h itself ?
22:40 patrickas "augment class Hash" doesn't seem to be doing what I thing it should!
22:41 colomon TimToady: I was wrong, moritz_++ did indeed make :x work strictly for the correct number of repetitions.
22:44 patrickas actually it works for arrays but not for hashes...
22:44 patrickas rakudo: my %h; %h.WHAT.say;
22:44 p6eval rakudo 980e03: OUTPUT«Hash()␤»
22:48 patrickas rakudo: my %h; my %hh = ("a"=> 1 , "b"=>2 );%h.WHAT.^add_method( 'list', method (  ) {    return self.pairs; });(map { .WHAT } , %hh).say;
22:48 p6eval rakudo 980e03: OUTPUT«Pair()Pair()␤»
22:48 patrickas \o/
22:50 BrowserUk phenny: tell ruoso, My first reaction is that it is better dealt with using something like: my @a = async{ map{...}, grep, <== $*IN }.join;  As everything that comes out of the grep is going to end up passing through the map and end up in memory in @a anyway.
22:50 phenny BrowserUk: I'll pass that on when ruoso is around.
22:54 BrowserUk phenny: tell ruoso, the use-case I'm envisaging is a filtering a small subset of a large input. You save memory by filtering the input lazily, but after that--depending upon how lists are implemented-- you don't save much more cos it's all going to end up in @a anyway.
22:54 phenny BrowserUk: I'll pass that on when ruoso is around.
22:58 BrowserUk phenny: tell ruoso, If @a was assigned a placeholder promise, you can get on with other stuff while it runs, and only block when you access @a at some point later if it hasn't completed.
22:58 phenny BrowserUk: I'll pass that on when ruoso is around.
22:58 Psyche^ joined #perl6
23:04 * patrickas thinks he fixed his first rakudo bug ever !
23:07 BrowserUk phenny: tell ruoso, And if IO primitives are set up as coroutines dispatched in the IO/Events thread, that allocate sharable buffers and post thread-chimeric handles to those buffers through queues,  then the whole chain runs as quickly as the data can be read without sleeps, locks or polling.
23:07 phenny BrowserUk: I'll pass that on when ruoso is around.
23:08 jaldhar_ joined #perl6
23:10 BrowserUk night all.
23:10 BrowserUk left #perl6
23:28 saaki joined #perl6
23:43 eternaleye joined #perl6
23:51 jhuni joined #perl6
23:58 colomon patrickas++

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo