Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-05-05

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:01 raiph joined #perl6
00:13 dalek tablets: 5f34264 | (Herbert Breunung)++ | docs/index.txt:
00:13 dalek tablets: formating index
00:13 dalek tablets: review: https://github.com/perl6/tablets/commit/5f342648d9
00:13 dalek tablets: 508bafd | (Herbert Breunung)++ | docs/appendix- (3 files):
00:13 dalek tablets: still weeding formating
00:13 dalek tablets: review: https://github.com/perl6/tablets/commit/508bafdfe6
00:14 eviltwin_b joined #perl6
00:22 eviltwin_b joined #perl6
00:44 JimmyZ_ joined #perl6
00:50 tokuhirom joined #perl6
00:54 eviltwin_b joined #perl6
01:01 eviltwin_b joined #perl6
01:05 rurban heap-buffer-overflow with /perl6 -e'my @a=splice([], 1);' reading 2 byte left a 64byte buffer
01:08 eviltwin_b joined #perl6
01:08 rurban error is in item + offset + elems1 src/pmc/resizablepmcarray.pmc:673
01:09 rurban when shrinking the array
01:24 gfldex rurban: what does perl6 --version for you?
01:25 rurban latest git master
01:25 rurban parrot also
01:25 rurban its actually a parrot bug
01:25 gfldex i don't got that problem under cygwin 32bit
01:28 wolfman2000 joined #perl6
01:30 eviltwin_b joined #perl6
01:43 vlixes joined #perl6
01:43 araujo joined #perl6
01:43 araujo joined #perl6
01:43 rurban gfldex: I use a special address checking tool address-sanitizer, like valgrind, just better
01:44 rurban Described here: http://blogs.perl.org/users/rurban/20​12/03/address-sanitizer-round-2.html
02:10 jaldhar joined #perl6
02:13 alvis` joined #perl6
02:19 arnsholt_ joined #perl6
02:19 ddima joined #perl6
02:21 tkr joined #perl6
02:25 eviltwin_b joined #perl6
02:30 ponbiki joined #perl6
02:33 eviltwin_b joined #perl6
02:39 eviltwin_b joined #perl6
02:40 Helios` joined #perl6
02:40 orafu joined #perl6
02:44 kranius joined #perl6
02:47 eviltwin_b joined #perl6
02:49 Timbus joined #perl6
02:49 eviltwin_b joined #perl6
02:50 Entonian joined #perl6
02:53 eviltwin_b joined #perl6
02:57 geekosaur joined #perl6
03:05 eviltwin_b joined #perl6
03:32 eviltwin_b joined #perl6
03:39 eviltwin_b joined #perl6
03:45 geekosaur joined #perl6
03:58 cognominal___ joined #perl6
04:01 thou joined #perl6
04:17 JimmyZ_ joined #perl6
04:26 eviltwin_b joined #perl6
04:41 geekosaur joined #perl6
04:48 birdwindupbird joined #perl6
04:49 eviltwin_b joined #perl6
04:56 geekosaur joined #perl6
05:14 moritz o/
05:17 sorear o/
05:25 kaare__ joined #perl6
05:35 noam joined #perl6
05:36 uvtc joined #perl6
05:45 uvtc How can I match one digit from 1..9, then one or more 0..9 digits after that? I'm trying $s ~~ m/(<[1..9]>\d2..*)/ but it doesn't seem to be working right (for one thing, it's not capturing the first digit).
05:45 uvtc And for another, it seems to be matching letters as well. $s looks like jf5b492c3i, and I'm trying to match the 492 in there, but I'm getting 492c3i.
05:46 moritz r: 'foo 42' ~~ /<[1..9]>\d/ and say ~$/
05:46 p6eval rakudo cf40f2: OUTPUT«42␤»
05:46 moritz uvtc:  ..* matches the same as .+
05:46 moritz uvtc: that is, any characters, but at least one
05:46 uvtc r: 'jf5b492c3i' ~~ /<[1..9]>\d/; say $0
05:46 p6eval rakudo cf40f2: OUTPUT«Any()␤»
05:47 moritz if you want it to capture, use parens around it
05:47 uvtc r: 'jf5b492c3i' ~~ /(<[1..9]>\d)/; say $0
05:47 p6eval rakudo cf40f2: OUTPUT«=> <49>␤␤»
05:47 uvtc moritz, could you show me the regex syntax to get that to match 492?
05:47 sorear <[1..9]> \d 2 . .*  means a digit from 1-9, then any digit, then a literal '2', then one or more arbitrary characters
05:48 moritz uvtc: just append a 2
05:48 uvtc I want to match: a digit from 1 to 9, then any number of digits following that.
05:48 uvtc Not just if it's 2.
05:48 uvtc (the digit 2)
05:48 uvtc r: 'jf5b492c3i' ~~ /(<[1..9]>\d+)/; say $0
05:48 moritz so, \d+ or \d*
05:48 p6eval rakudo cf40f2: OUTPUT«=> <492>␤␤»
05:48 sorear <[1..9]> \d*
05:49 uvtc Oh, using the + worked.
05:49 sorear I think you need to learn how to mentally parse regexes
05:49 uvtc I do.
05:49 uvtc :)
05:49 uvtc But I already mostly know Perl 5 regexes.
05:50 sorear [1-9] \d 2 . .* won't do what you want there either :)
05:50 uvtc Ah. I see some confusion. I'd originally tried to get *2* or more (not 1 or more), and I'd tried the usual \d{2,}
05:50 sorear I think you may have been trying to use 2..* as a repitition count?
05:51 uvtc but rakudo told me, Unsupported use of {N,M} as general quantifier; in Perl 6 please use ** N..M (or ** N..*) at line 14
05:51 TimToady so where's the **
05:51 uvtc Sorry about the confusion.
05:51 uvtc r: 'jf5b492c3i' ~~ /(<[1..9]>\d{2,})/; say $0
05:51 p6eval rakudo cf40f2: OUTPUT«===SORRY!===␤Unsupported use of {N,M} as general quantifier; in Perl 6 please use ** N..M (or ** N..*) at line 1, near ")/; say $0"␤»
05:52 uvtc r: 'jf5b492c3i' ~~ /(<[1..9]>\d2..*)/; say $0
05:52 p6eval rakudo cf40f2: OUTPUT«=> <492c3i>␤␤»
05:52 sorear r: 'jf5b492c3i' ~~ /(<[1..9]>\d**2..*)/; say $0
05:52 p6eval rakudo cf40f2: OUTPUT«=> <492>␤␤»
05:52 TimToady I repeat, where's your **?
05:52 sorear the ** isn't line noise, it actually means something
05:52 uvtc Oh, I see. I need the ** first, then the range.
05:52 uvtc r: 'jf5b492c3i' ~~ /(<[1..9]>\d**2..*)/; say $0
05:52 p6eval rakudo cf40f2: OUTPUT«=> <492>␤␤»
05:53 TimToady except that won't match 49
05:53 uvtc Right.
05:53 uvtc I only wanted 3-digit numbers and up.
05:53 eviltwin_b joined #perl6
05:54 uvtc Thanks! I suppose I wasn't understanding the error message, and should've asked directly about that first.
05:54 sorear fwiw, I would probably write this as <![0]> \d**3..*
05:54 uvtc r: 'jf5b492c3i' ~~ /(<![0]>\d**2..*)/; say $0
05:54 p6eval rakudo cf40f2: OUTPUT«=> <492>␤␤»
05:54 sorear to emphasise the idea that nonzero digits and unrestricted digits are of a kind
05:55 uvtc Hm. How can that work? ![0] looks to me like, "anything but zero" (for example, letters)
05:55 uvtc r: 'jf5b492c3i' ~~ /(<![0]>\d ** 2..*)/; say $0
05:55 p6eval rakudo cf40f2: OUTPUT«=> <492>␤␤»
05:55 sorear that's -[0]
05:55 sorear ![0] is a zero width assertion
05:56 sorear it doesn't match anything itself
05:56 sorear it only prevents the next item from matching 0...
05:56 uvtc [a..z] is all the characters from a to z, right_?
05:56 sorear r: 'jf5b492c3i' ~~ /(<-[0]>\d ** 2..*)/; say $0 # for comparison
05:56 p6eval rakudo cf40f2: OUTPUT«=> <b492>␤␤»
05:57 sorear yes, but we recommend you avoid things like that
05:57 sorear you might get mail from irate Spaniards wondering why your program accepts n and o but not ñ
05:57 uvtc Wait -- sorry, typo. I meant <[a..z]>, not [a..z].
05:57 sorear <:ll> probably better
05:58 uvtc sorear, Right. Not unicodey.
05:58 sorear or <:Lowercase_Letter>
06:01 uvtc How can I initialize a hash to look like this:  %h = 1 => 0,   2 => 0,   3 => 0,   4 => 0,   5 => 0;  ?
06:01 uvtc (without typing them all out?)
06:01 moritz r: my %h = 1..5 X=> 0; say %h.perl
06:01 p6eval rakudo cf40f2: OUTPUT«("1" => 0, "2" => 0, "3" => 0, "4" => 0, "5" => 0).hash␤»
06:02 uvtc Thanks, moritz.
06:07 eviltwin_b joined #perl6
06:15 fglock_ joined #perl6
06:15 sorear o/ fglock_
06:15 fglock_ sorear: hi!
06:16 sorear random comment
06:16 sorear niecza has an informal deprecation policy
06:16 sorear if a feature is currently supported in niecza AND documented in the synopses, I will not break it lightly
06:17 fglock_ perlito5 has a "* Deprecate" section in the TODO file
06:18 fglock_ with things that may eventually be deprecated
06:20 fglock_ I have a perl6 question, I have a set of classes that define an AST, and another set of classes that define a code emitter
06:20 fglock_ I currently link the classes with each other by sharing the class name with MONKEY_TYPING
06:21 fglock_ I want to get rid of the monkey_typing
06:22 moritz you can stub types before using them
06:22 moritz r: class A { ... }; class B { method x(A $) { } }; class A { }
06:22 p6eval rakudo cf40f2:  ( no output )
06:25 sorear fglock_: niecza does the exact same thing.  I suspect it may be optimal in the absense of whole-program compilation
06:25 fglock_ moritz: I understand in your example '$a.emit()' would be written 'B.emit($a)' ?
06:28 fglock_ sorear: because whole-program compilation would reconstruct a different AST for output?
06:29 uvtc I wrote a little string/number crunching program just for some speed tests. It's here https://gist.github.com/2600314 . But my calls to min and max don't seem to always work right. Could anyone tell me why?
06:29 sorear fglock_: that question does not make sense
06:30 sorear uvtc: you're taking the max of a collection of strings.
06:31 sorear uvtc: you should find that it always returns the lexicographically greatest item.
06:31 fglock_ sorear: I don't understand why you said "in the absense of whole-program compilation" - it that because you don't need to traverse the AST in the emitter?
06:31 uvtc sorear, Ah. Thanks! How can I tell min that I want to treat @nums as nums?
06:31 sorear uvtc: Easiest way is to add a + to line 15 so that the values are stored as numbers
06:32 sorear 15         push @nums, $0
06:32 sorear for some reason gist thinks there are three blank lines at the top
06:32 uvtc push @nums, +$0     ?
06:32 sorear yes
06:32 uvtc Thanks, sorear!
06:33 sorear fglock_: the 'natural' Perl 6 way would be to write emit() as a multi sub.
06:33 eviltwin_b joined #perl6
06:33 sorear fglock_: this is what PAST::Compiler does
06:33 sorear fglock_: but I won't tolerate the speed hit for that unless it can be optimized somehow, and I don't know how to do that without whole-program compilatiomn
06:34 fglock_ sorear: ah, that makes sense! that's how it works in the SBCL implementation too
06:39 fglock_ 'multi emit (AST::Int $node: ) { ... } ' could be compiled to a plain method call (sorry if the syntax is wrong)
06:40 fglock_ (reading S12)
06:44 sorear fglock_: that's called wishful thinking.  It is one of the most consistant features of of the synopses.
06:44 eviltwin_b joined #perl6
06:45 uvtc For anyone interested in performance comparisons (I understand that rakudo still has a lot of optimizations ahead of it), here's that simple script in Perl 6 https://gist.github.com/2600403 , and here it is in Python https://gist.github.com/2600409 .
06:45 fglock_ sorear: you mean it "looks like it can be optimized" but it can't?
06:46 sorear fglock_: first off, that colon is entirely out of place for a multi method
06:46 sorear and second, yes
06:50 fglock_ "consistent feature" you are referring to "wishful thinking"?
06:50 sorear yes
06:51 fglock_ heh - ok
06:52 uvtc left #perl6
06:52 fglock_ the reason that is wouldn't work is the lexical scoping?
06:52 fglock_ it
06:54 fglock_ when the multi is out of scope then the actual method would be called
06:54 moritz but at least you know at compile time which multis are in scope
06:55 moritz a piece of information that rakudo uses to good effect
06:56 moritz where it can, it determines the candidate to call at compile time, and sometimes even inlines the call
06:57 fglock_ reading the discussion at http://code.activestate.com/​lists/perl6-language/32268/
06:58 sorear single dispatch turns into vtable-like calls
06:59 sorear I don't know of any multi dispatch algorithm which scales in O(1) with the candidate count
06:59 sorear niecza has dozens of types of AST nodes
07:00 sorear I suppose I should actually test this, rather than just assuming 20 type checks will add a lot of overhead to calling
07:06 geekosaur joined #perl6
07:16 xinming joined #perl6
07:19 fglock_ sorear: SBCL multi dispatch lookup: http://www.sbcl.org/sbcl-intern​als/The-Cacheing-Mechanism.html
07:20 fglock_ lexical multis do complicate things a bit
07:25 fglock_ the method looks like a Bloom filter, I think
07:33 vlixes left #perl6
07:38 GlitchMr joined #perl6
07:39 eviltwin_b joined #perl6
07:40 SHODAN joined #perl6
07:43 fglock_ sorear: re candidate count, I understand they create a hash value that represents the candidates; they use this value to exclude the multis that don't match
07:49 dalek DBIish: 77f8857 | moritz++ | / (2 files):
07:49 dalek DBIish: [t] test that quoted question marks are OK
07:49 dalek DBIish:
07:49 dalek DBIish: also fix Pgs method do
07:49 dalek DBIish: review: https://github.com/perl6/DBIish/commit/77f88572b7
07:57 sorear fglock_: that would work better if Perl 6 had final classes :(
08:03 fglock_ sorear: I understand this is runtime dispatch, and the cache can be changed at runtime. Maybe they recompile as-needed, though
08:05 sergot joined #perl6
08:05 sergot o/
08:10 dalek tablets: 677dd45 | (Herbert Breunung)++ | docs/appendix-a-index.txt:
08:10 dalek tablets: still fixing link formating has also advantage of more fine grained bold making
08:10 dalek tablets: review: https://github.com/perl6/tablets/commit/677dd45ed1
08:11 adu joined #perl6
08:13 tokuhirom joined #perl6
08:18 fglock_ but yes, final classes are good for compile-time optimization; runtime dispatch on a static-ish vm is painful
08:24 tadzik sjn: re invoices, wizzair claims to have sent an invoice in english, but neither I nor sergot did receive one. I sent an email for them requesting one
08:25 moritz wizzair? is that an airline with wizz-bang features? :-)
08:26 tadzik you mean http://www.wizz-bang.com.au/ ? :)
08:34 Khisanth joined #perl6
08:36 eviltwin_b joined #perl6
08:55 moritz r: say 1 !~ 2
08:55 p6eval rakudo cf40f2: OUTPUT«===SORRY!===␤Unsupported use of !~ to do negated pattern matching;  in Perl 6 please use !~~␤at /tmp/jJi2NQrfnQ:1␤»
08:57 dalek tablets: a9ccd66 | moritz++ | docs/tablet-4-operators.txt:
08:57 dalek tablets: [op] negated smart match is !~~, not !~
08:57 dalek tablets: review: https://github.com/perl6/tablets/commit/a9ccd66841
09:00 eviltwin_b joined #perl6
09:14 masak morning, #perl6
09:15 masak r: say "492" ~~ / (\d\d\d) <?{ $0 >= 100 }> / # this is how I would have written it
09:15 p6eval rakudo cf40f2: OUTPUT«=> <492>␤ 0 => <492>␤␤»
09:21 tadzik I don't know what is "it", but I'd probably go for 1\d\d
09:22 masak r: say "492" ~~ / 1\d\d /
09:22 p6eval rakudo cf40f2: OUTPUT«#<failed match>␤»
09:22 masak tadzik: then it doesn't match.
09:22 tadzik oh, right
09:22 masak here, have some coffee :P
09:22 tadzik the water's still boiling :)
09:23 masak :)
09:33 masak general question: do you prefer to (a) have two methods, one .is-X-allowed and one .perform-X, and always do one after the other on the caller side, or (b) only have the .perform-X method, and check feasibility by trying and catching an exception?
09:34 tadzik what kind of allowance is this?
09:34 tadzik I like exceptions to be reserved for, well, exceptional situations
09:35 tadzik if it's an exception that sometimes the method is not allowed, then (b). If it just happens sometimes, and is a normal thing then (a)
09:36 masak well, in both scenarios .perform-X will throw an exception if the operation isn't allowed. it never fails silently.
09:36 tadzik understood
09:36 masak it's just that, in scenario (a), the expected way to detect illegal operations is to call .is-X-allowed first.
09:37 tadzik yeah, you're focusing on the API here, I'm thinking a bit more philosophical :)
09:37 tadzik is it really an exceptional situation that something is not allowed, or is it a normal thing you should think about?
09:37 masak I'm not sure we're using "exceptional situation" in the same way here.
09:37 masak to me it has nothing to do with "often" or "sometimes".
09:38 tadzik agreed
09:38 masak it has to do with whether the caller creates a situation for the callee that was somehow forbidden by contract.
09:39 masak that's why using exceptions for exiting a loop, for example, breaks this rule. because every finite loop ends, so it's not a break of a contract, it's expected.
09:41 eviltwin_b joined #perl6
09:43 masak why does the CHECK complainer output the called subs in alphabetic order, and not in the order the calls appeared in the file?
09:43 moritz example?
09:43 moritz ah, I know what you mean
09:44 moritz it can list several call locations for each routine
09:44 eviltwin_b joined #perl6
09:44 moritz so you can't get a consistent sorting by call location
09:44 moritz you could sort by first call location though
09:45 masak I think I'd prefer that.
09:45 masak sometimes alphabetic order is helpful, but here it doesn't give any advantage at all.
09:45 masak whereas call location is something I can relate to.
09:46 masak I just was to point out that it feels great to be having Rakudo complaints at this high level. :) jnthn++
09:46 eviltwin_b joined #perl6
09:46 masak means all the lower levels are basically fine.
09:47 moritz nom + bs = win!
09:47 masak :)
09:50 ab5tract joined #perl6
09:51 arnsholt_ masak: I think I'd use the is-X-allowed if there was some way for me as the caller to gracefully handle it not being allowed
09:52 arnsholt_ If If not, I'd just let the exception percolate up and probably get some kind of "I can't let you do that, Dave" message
09:55 masak arnsholt: oh, that sounds like a good rule-of-thumb.
09:56 masak it's like, go with triggering the exception if there's no better way to proceed.
10:06 masak r: say "ab c" ~~ / ab c /
10:06 p6eval rakudo cf40f2: OUTPUT«#<failed match>␤»
10:06 masak r: say "ab c" ~~ mm/ ab c /
10:06 p6eval rakudo cf40f2: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix / instead at line 1, near ""␤»
10:06 masak aww
10:07 masak r: say "ab c" ~~ / :s ab c /
10:07 p6eval rakudo cf40f2: OUTPUT«=> <ab c>␤␤»
10:07 moritz r: say 'ab c' ~~ ms/ ab c /
10:07 p6eval rakudo cf40f2: OUTPUT«#<failed match>␤»
10:07 masak oh, it's ms// these days?
10:07 moritz that last one should have worked
10:07 * masak submits rakudobug
10:07 moritz mm// is m:m//
10:07 masak what does :m mean?
10:08 moritz ignore:mark
10:08 masak oh right.
10:08 masak moritz++
10:09 masak r: say 'ab c' ~~ ms/ab c /
10:09 p6eval rakudo cf40f2: OUTPUT«#<failed match>␤»
10:09 masak just checking :)
10:09 moritz I think I have a fix locally
10:16 thelazydeveloper joined #perl6
10:17 jnthn afternoon o/
10:17 tadzik \o
10:18 jnthn masak: (output order) surprised it's alphabetic. I shove the things in a hash.
10:18 jnthn masak: It's all written in NQP though. Feel free to hack on it.
10:19 spider-mario joined #perl6
10:19 masak jnthn: nod
10:20 ab5tract joined #perl6
10:21 eviltwin_b joined #perl6
10:24 tadzik woooow, wtf
10:24 eviltwin_b joined #perl6
10:24 tadzik https://github.com/tadzik/pan​da/blob/master/bin/panda#L37
10:25 tadzik this line takes about 3-4 seconds to execute
10:25 tadzik removing <> around $string it needs approximately 0 seconds
10:26 jnthn What's in $string?
10:26 jnthn It's calling into the regex compiler there I guess...
10:26 tadzik an arbitraty string, e.g. "kitten"
10:27 tadzik pulling my $regex = / <$string> /; before the loop doesn't help much
10:28 tadzik (and then matching ~~ $regex)
10:28 jnthn Hmm.
10:28 jnthn It is slow indeed.
10:39 dalek rakudo/nom: 3b028e9 | moritz++ | src/Perl6/Grammar.pm:
10:39 dalek rakudo/nom: fix ms//
10:39 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3b028e9857
10:45 tadzik jnthn: how do you > /dev/null on windows?
10:46 moritz > nul  I think
10:46 moritz not sure though
10:47 moritz windows has several reserved names, such as 'con' and 'nul' and 'lpt' and so on, which may never be used as file names, and which serve such special purposes
10:49 tadzik I think about something along run-silently()
10:50 jnthn Yes, it's > NUL
10:50 jnthn tadzik: <$foo> uses eval, which also seems a bit slower than would be desirable.
10:51 tadzik ah, I see
10:56 whiteknight joined #perl6
10:57 jnthn tadzik: oooh...
10:57 jnthn tadzik: I just worked out why it's ridiculously slow.
10:58 tadzik hm?
10:58 jnthn Imagine /<$x>/ where $x contains "kitten"
10:58 jnthn And we match it against /a kitten/
10:58 jnthn It tries to match at the start of the string. It goes off and compiles $x into a regex. And evaluates it and...no match
10:58 jnthn So, it moves to the next character. Compiles $x into a regex *again*. And evaluates it and...no match.
10:59 jnthn And...yeah, it goes on :)
10:59 tadzik ew
10:59 tadzik yeah, that could hurt
10:59 * jnthn wonders what S05 says about the lifetime of <$x> :)
10:59 jnthn I suspect we should not be recompiling it every single time we backtrack.
11:00 tadzik it sort of sucks that MAIN(*@args, :$notests) supports panda --notests install NativeCall, but not panda install --notests NativeCall
11:01 tadzik and yet I'm afraid that might be per-spec
11:02 eviltwin_b joined #perl6
11:04 tadzik As usual, switches are assumed to be first, and everything after the first non-switch, or any switches after a --, are treated as positionals or go into the slurpy array (even if they look like switches).
11:04 tadzik yeah
11:09 tadzik how would you name a module that treats --arguments as switches even if they come after positionals?
11:10 moritz Getopt::Random :-)
11:12 tadzik Main::Sain :)
11:16 tadzik https://gist.github.com/2601641 cool :)
11:17 jnthn tadzik: S05 seems to give us some allowance to do some caching. Got a patch here that helps, just gonna spectest it.
11:17 tadzik \o/
11:17 NamelessTee joined #perl6
11:19 masak jnthn: the only reason to recompile $x in <$x> with every backtrack is if $x or one of its subrules contains code that changes $x.
11:19 masak jnthn: but that seems like a very corner-y case. I'd rather have the speed, and compile <$x> at most once per rule execution :)
11:20 jnthn masak: S05 has some langauge on the issue.
11:21 JimmyZ_ joined #perl6
11:21 jnthn masak: It's basically "does $x change" and "obey rebinding due to lexicality" and the thing I've implemented would seem to cover those requirements. :)
11:24 dalek panda: 5a4b981 | tadzik++ | bin/panda:
11:24 dalek panda: Rip off the REPL and refactor bin/panda a bit
11:24 dalek panda: review: https://github.com/tadzik/panda/commit/5a4b981cce
11:24 dalek panda: 83a7058 | tadzik++ | bin/panda:
11:24 dalek panda: Avoid regex compilation in 'panda search' to make it usable
11:24 dalek panda: review: https://github.com/tadzik/panda/commit/83a70583a0
11:24 dalek panda: 9b5ddfd | tadzik++ | lib/Panda/Ecosystem.pm:
11:24 dalek panda: Simplify Panda::Ecosystem, we're not _that_ slow anymore
11:24 dalek panda: review: https://github.com/tadzik/panda/commit/9b5ddfd508
11:24 dalek panda: 1b86a11 | tadzik++ | bin/panda:
11:24 dalek panda: Implement --nodeps and --notests, fixes GH-5
11:24 dalek panda: review: https://github.com/tadzik/panda/commit/1b86a1171d
11:26 dalek rakudo: d7f45ff | moritz++ | src/core/Cool.pm:
11:26 dalek rakudo: Cool.eval
11:26 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/d7f45ff8cf
11:26 dalek rakudo/nom: dbcdb16 | jnthn++ | src/core/Cursor.pm:
11:26 dalek rakudo/nom: In /<$x>/ don't recompile $x every single time we pass it while scanning/backtracking. This implements it exactly as S05 suggests: 'the compiled form is cached with the string'.
11:26 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dbcdb1670a
11:28 jnthn tadzik: Hopefully ^ is a good speedup :)
11:28 tadzik will see, thanks :)
11:33 moritz oh noez, somebody has pushed to rakudo/master again :(
11:34 jnthn me
11:34 jnthn I :master'd again though
11:34 jnthn :/
11:34 jnthn In my defense, I didn't have much coffee yet today... :P
11:35 moritz I think we should rename nom to master
11:35 moritz it just happens over and over again
11:35 moritz and it occasionally confuses people
11:35 moritz in the long run, there's just no benefit not to have master
11:39 masak +1
11:41 Celelibi hum... What about the "local" variables un perl6 ?
11:41 Celelibi What about $_ ?
11:41 am0c joined #perl6
11:42 gfldex r: .say for 1,2,3;
11:42 p6eval rakudo 3b028e: OUTPUT«1␤2␤3␤»
11:42 gfldex r: $_.say for 1,2,3;
11:42 p6eval rakudo 3b028e: OUTPUT«1␤2␤3␤»
11:42 Celelibi yes, that's the simple part.
11:42 gfldex still there but you will need is less
11:42 JimmyZ_ +1 to have master
11:43 JimmyZ_ because we are using git
11:43 Celelibi but I remember having some troubles with $_ in perl5
11:43 moritz well, p5 has messed up some things
11:43 Celelibi like map {foo($_, $somestuff)} @list
11:44 tadzik Celelibi: what kind of 'local' do you mean?
11:44 moritz for example the scoping of $_ in given and for is different
11:44 Celelibi and inside foo sone something like while (<$fd>)
11:44 tadzik if it's as in Perl 5's 'local $/', then we use dynamic $*Variables for that now
11:44 Celelibi which messed up the value of $_ in the map.
11:44 jaffa4 joined #perl6
11:44 geekosaur joined #perl6
11:44 jaffa4 hi
11:45 tadzik hi jaffa4
11:45 Celelibi actually it was more like map {foo($_, $bar); somethingelse($_, $baz) }
11:45 Celelibi @list
11:45 masak hi jaffa4
11:45 Celelibi the value of $_ on the call to somethingelse was different from the call to foo because a while (<$fd>) changed $_
11:46 Celelibi and I had to declare $_ as "local".
11:46 Celelibi tadzik: that's the local I talk about.
11:47 jaffa4 This example seems to be wrong in rakudo: http://paste.org/48868
11:47 jaffa4 Sorry This example seems to be wrong in niecza: http://paste.org/48868
11:47 gfldex Celelibi: that bahaviour would be a bug in perl6
11:47 Celelibi The thing that simulate in some way the the local variable by just saving the old value and restoring it at the end of the block.
11:47 tadzik Celelibi: in Perl 6 'local $FOO = 5' is 'my $*FOO = 5'
11:47 moritz jaffa4: you're right. Known bug.
11:47 gfldex but since we don't do while (<$fd>) anymore, it doesn't matter much
11:48 Celelibi tadzik: what's the star ?
11:48 tadzik I'm wondering how much sense does it make to have a sort of application-level configuration using dynamic variables
11:48 jaffa4 So how do I use that?
11:48 tadzik Celelibi: it indicates that it's a dynamic variable
11:49 tadzik e.g. panda would do my $*VERBOSE = True, and then various panda modules will look at it
11:49 Celelibi gfldex: what do we do instead ?
11:50 gfldex slurp("yourfile.end")
11:50 Celelibi what if the file is big?
11:50 tadzik no
11:50 tadzik we use lines(), not slurp()
11:50 moritz or just   for $fd.lines -> $l { say $l }
11:50 tadzik slurp() serves a different purpose
11:50 moritz and since lists are lazy, this doesn't consume all the memory upfront
11:50 Celelibi ok
11:51 JimmyZ_ r: say (7, 14, * ... 100);
11:51 p6eval rakudo 3b028e: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \$v, Mu *%_)␤␤  in method Numeric at src/gen/CORE.setting:648␤  in sub infix:<==> at src/gen/CORE.setting:2377␤  in method ACCEPTS at src/gen/CORE.setting:2159␤  in block <anon> at src/gen/CORE.setting:1…
11:51 Celelibi lists are always lazy?
11:51 gfldex if they use gather/take
11:51 Celelibi ok
11:51 gfldex most of the stuff in the settings do that
11:51 tadzik r: say (7, 14  ... 100);
11:51 p6eval rakudo 3b028e: OUTPUT«(timeout)»
11:51 tadzik heh
11:52 tadzik r: say (7, 14  ... * > 100);
11:52 p6eval rakudo 3b028e: OUTPUT«7 14 21 28 35 42 49 56 63 70 77 84 91 98 105␤»
11:52 Celelibi what's the "..." in this context?
11:52 tadzik series operator
11:53 tadzik r: say (1, 2, 4  ... * > 1000);
11:53 p6eval rakudo 3b028e: OUTPUT«1 2 4 8 16 32 64 128 256 512 1024␤»
11:54 jaffa4 r: say (1,4,10 .. 100)
11:54 p6eval rakudo 3b028e: OUTPUT«1 4 10..100␤»
11:54 tadzik :)
11:54 jaffa4 r: say (1,4,10 ... 100)
11:54 p6eval rakudo 3b028e: OUTPUT«Unable to deduce sequence␤  in method Str at src/gen/CORE.setting:8671␤  in method Stringy at src/gen/CORE.setting:677␤  in method join at src/gen/CORE.setting:1063␤  in method Str at src/gen/CORE.setting:4978␤  in method gist at src/gen/CORE.setting:5272␤  in sub …
11:54 JimmyZ_ why outputs 1024?
11:54 jaffa4 r: say (1,4,9 ... 100)
11:54 p6eval rakudo 3b028e: OUTPUT«Unable to deduce sequence␤  in method Str at src/gen/CORE.setting:8671␤  in method Stringy at src/gen/CORE.setting:677␤  in method join at src/gen/CORE.setting:1063␤  in method Str at src/gen/CORE.setting:4978␤  in method gist at src/gen/CORE.setting:5272␤  in sub …
11:55 tadzik JimmyZ_: 1024 satisfies *>1000, so it stops then, but it includes it. Exclusive is also possible
11:55 tadzik r: say (1, 2, 4  ...^ * > 1000);
11:55 p6eval rakudo 3b028e: OUTPUT«1 2 4 8 16 32 64 128 256 512␤»
11:55 JimmyZ_ oh
11:55 tadzik ...^, as in ..^ with ranges
11:55 tadzik r: say (1..^10).list
11:55 p6eval rakudo 3b028e: OUTPUT«1 2 3 4 5 6 7 8 9␤»
11:55 Celelibi where can I find more about this syntax?
11:56 masak S03
11:56 masak http://perlcabal.org/syn/S03.html
11:56 tadzik http://perlcabal.org/syn/S03​.html#List_infix_precedence
11:56 tadzik scroll down to infix:<...>
11:56 JimmyZ_ I think ...^ is the most what I want
11:57 tadzik alpha: say (1, 2, 4 ... 1000).perl
11:57 eviltwin_b joined #perl6
11:57 tadzik no alpha? :(
11:58 Celelibi <tadzik> Celelibi: in Perl 6 'local $FOO = 5' is 'my $*FOO = 5' <-- what's the difference with "temp $FOO = 5"?
11:58 tadzik I'm not sure what temp is
11:58 masak tadzik: no alpha.
11:58 Celelibi http://www.programmersheaven.c​om/2/Perl6-FAQ-Variables#temp
11:58 JimmyZ_ r: say (1..100/7)>>*>>7
11:58 p6eval rakudo 3b028e: OUTPUT«7 14 21 28 35 42 49 56 63 70 77 84 91 98␤»
11:59 tadzik Celelibi: I suppose temp lives only in the current scope, while dynamics are global-ish (example coming)
12:00 tadzik r: my $*FOO = 5; sub foo { say $*FOO }; foo; { my $*FOO = 6; foo(); }; foo
12:00 p6eval rakudo 3b028e: OUTPUT«5␤6␤5␤»
12:00 * jnthn back alter
12:00 jnthn *later
12:01 masak tadzik: 'temp' means "this variable gets its previous value at scope LEAVE time".
12:01 tadzik right
12:01 masak in fact, 'temp' should be LHF now that we have LEAVE.
12:02 huf how is temp different from redeclaring the variable in the inner scope with my?
12:02 Celelibi ok, temp $x; is just like "my $x = $x" (provided this would be a legal statment)
12:03 masak huf: redeclaring in an inner scope creates a new container. 'temp' re-uses the old one.
12:03 masak Celelibi: 'my $x = $x' is a no-op in Perl 6, and (I think) always illegal in Perl 5.
12:03 Celelibi then "temp $x = constantevalue" does not make much sens.
12:03 masak it doesn't? I think it does.
12:04 huf masak: i see
12:05 huf masak: where would this matter?
12:05 Celelibi does rakudo actually implements temp variables?
12:05 Chillance joined #perl6
12:05 huf is this similar to the $foo = [] vs @$foo = () distinction?
12:05 huf from perl5 i mean
12:07 Celelibi are $*FOO variables "our" variables?
12:07 Celelibi if not, what's the difference?
12:08 geekosaur joined #perl6
12:09 Celelibi And is there a fucking way to make rakudo work faster?
12:09 Celelibi For evey perl6 -e line I type it takes a second to compile and do stuff before actually running my code.
12:12 Celelibi tadzik: what does actually do "my $*FOO = 6" in your previous example?
12:12 masak huf: no, I don't think so. that distinction is about "actual values" vs their references. this distinction is about "actual values" vs the container they're stored in.
12:12 Celelibi does it create a new variable (as I would expect by the "my" keyword)?
12:12 tadzik Celelibi: from that moment, up to the end of current lexical scope, the global variable $*FOO has a value of 6
12:12 huf masak: hmm. so in what actual case would using temp vs redeclaring with my result in different behavior?
12:12 Celelibi Does it just store the old value and restore it at the end of the scope?
12:13 Celelibi (just like "local")
12:13 tadzik somehow
12:13 huf or is this just to signal intent to the next programmer (and maybe make it a bit faster)?
12:16 masak huf: so, in the 'my' case there are essentially two different variables with the same name.
12:17 Celelibi tadzik: I need to have an actual mental representation of what happen.
12:17 masak huf: in that case, we could have a situation where a routine called from the inner scope sees the outer variable (with the original value).
12:17 Celelibi Some languages create several variables with the same name and trying to access it just take the last value.
12:17 huf masak: since the compiled routine is actually referencing a container, not the name of the variable?
12:17 Celelibi that's the case of O'Caml and its "let".
12:17 masak huf: in the case of 'temp', there would only ever be one variable, and the routine called would see the current, temporized value.
12:18 masak huf: hm. maybe.
12:18 tadzik Celelibi: think of a dynamic variable as a global variable. Then redeclaring it locally is like 'temp'
12:18 Celelibi masak: what if I take a reference to a $*FOO?
12:18 tadzik it changes the value globally, and restores it at the end of scope
12:19 huf masak: is this mostly theoretical at the moment, since the implementations arent far enough along to have bumped into this distinction?
12:19 masak huf: all normal lexical lookups are settled at compile-time, and compiled into something like "two scopes up, third door on your right".
12:19 huf ah.
12:19 masak huf: the implementations are far enough.
12:19 masak the distinction I'm talking about can already be demonstrated.
12:19 * masak puts together an example
12:19 huf so temp is totally cool and i should use it and finally we can localize lexicals? sweet.
12:20 masak r: my $var = 5; sub foo { $var = 42; #`(pretend this is temp) bar; $var = 5; #`(pretend this happens automatically) }; sub bar { say $var }
12:20 p6eval rakudo dbcdb1:  ( no output )
12:21 masak r: my $var = 5; sub foo { $var = 42; #`(pretend this is temp) bar; $var = 5; #`(pretend this happens automatically) }; sub bar { say $var }; foo
12:21 p6eval rakudo dbcdb1: OUTPUT«42␤»
12:21 masak that's the 'temp' case.
12:21 masak r: my $var = 5; sub foo { my $var = 42; bar; }; sub bar { say $var }; foo
12:21 p6eval rakudo dbcdb1: OUTPUT«5␤»
12:21 masak that's the 'my' case.
12:21 huf the normal lexical variable lookup
12:22 huf i see.
12:22 masak aye.
12:22 huf sweet. thanks for the explanation.
12:22 masak all I've been saying so far is that "normal lexical lookup applies" :)
12:22 huf ;))))
12:22 masak even with 'temp'.
12:22 huf right, since there is no second variable in that case.
12:23 masak right.
12:24 masak TimToady sometimes refers to 'temp' and 'let' as "pseudo-declarators". since they don't declare a new thing, they just modify an existing one.
12:25 lutok joined #perl6
12:25 Celelibi r: my $*FOO = 5; my $RFOO = \$*FOO; say $$RFOO
12:25 p6eval rakudo dbcdb1: OUTPUT«5␤»
12:25 Celelibi why doesn't this work on my computer ?
12:25 masak because your computer is broken?
12:25 masak because you installed Rakudo wrong?
12:26 masak because you have a very old version of Rakudo>
12:26 masak ?
12:26 flussence maybe your shell's doing something screwy with the \
12:26 Celelibi I just apt-get install rakudo
12:26 Celelibi this shouldn't be wrong.
12:26 flussence oh, that'd be why
12:26 flussence which distro is that?
12:27 Celelibi debian
12:27 masak r: my $a; say (\$a).^name
12:27 p6eval rakudo dbcdb1: OUTPUT«Capture␤»
12:27 Celelibi "This is Rakudo Perl 6, version 2011.07 built on parrot 3.6.0 0"
12:27 masak that's old.
12:27 masak b: my $*FOO = 5; my $RFOO = \$*FOO; say $$RFOO
12:27 p6eval b 922500: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "$$RFOO"␤»
12:27 masak right.
12:27 Celelibi ok, let's upgrade to sid's version.
12:28 flussence that'd also explain why your perl6 -e takes forever
12:28 tadzik sid is not too new either :/
12:28 tadzik they have 2012.01
12:28 Celelibi works still better.
12:29 Celelibi and the sid version take longer to compile...
12:29 Celelibi it takes 2 seconds!
12:29 Celelibi That's just... unbearable.
12:29 flussence 2 seconds every time? that can't be right
12:30 tadzik it takes 0.29 here
12:30 tadzik 2012.01 is pre-bs
12:30 Celelibi between 2.6 and 3 seconds yes.
12:31 tadzik Celelibi: the startup time has been massively improved over the last few months
12:31 Celelibi ok.
12:32 tadzik Celelibi: what's time perl6 -e 1 on 2012.01?
12:33 JimmyZ_ rakudo: my $a = 3; my $b = 4; $a = $a xor $b; $b = $b xor $a; $a = $a xor $b; say $a, ' ', $b;
12:33 p6eval rakudo dbcdb1: OUTPUT«3 4␤»
12:34 Celelibi my $*FOO = 5; my $RFOO = \$*FOO; sub p {say $*FOO; say $$RFOO}; p; {my $*FOO = 42; p}
12:34 JimmyZ_ r: my $a = 3; my $b = 4; $a xor= $b; $b xor= $a; $a xor= $b; say $a, ' ', $b;
12:34 p6eval rakudo dbcdb1: OUTPUT«4 4␤»
12:34 Celelibi r: my $*FOO = 5; my $RFOO = \$*FOO; sub p {say $*FOO; say $$RFOO}; p; {my $*FOO = 42; p}
12:34 p6eval rakudo dbcdb1: OUTPUT«5␤5␤42␤5␤»
12:34 JimmyZ_ is it a bug?
12:34 Celelibi tadzik: quite nothing.
12:34 Celelibi 0.013
12:34 tadzik hm, 0.1 here
12:35 tadzik maybe that's too simple :)
12:35 Celelibi tadzik: my bad, I forgot the 6. This was the time for perl 5. ^^
12:35 tadzik :)
12:35 Celelibi time perl6 -e 1
12:35 Celelibi perl6 -e 1  2,33s user 0,14s system 98% cpu 2,508 total
12:35 tadzik yeah, it's 0.1 on my git version
12:37 flussence that reminds me, I've got some overdue fixing to do... (tryrakudo@feather3:~$ time perl6 -e 1 -> 0m0.958s)
12:38 Celelibi r: my $x; sub foo {temp $x;}
12:38 p6eval rakudo dbcdb1: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&temp' called (line 1)␤»
12:39 masak is there an easier way to say .kv.hash.invert?
12:39 JimmyZ_ rakudo: my $a = 3; $a = $a xor 4; say $a;
12:39 p6eval rakudo dbcdb1: OUTPUT«3␤»
12:39 JimmyZ_ rakudo: my $a = 3; $a xor= 4; say $a;
12:39 p6eval rakudo dbcdb1: OUTPUT«Nil␤»
12:39 masak more precisely, why don't we have .invert on Lists?
12:39 JimmyZ_ masak: is it a bug?
12:39 masak JimmyZ_: "it"?
12:40 flussence r: my @list = 'a'..'z'; say {@list Z=> 1..*}.perl
12:40 p6eval rakudo dbcdb1: OUTPUT«Block.new()␤»
12:40 flussence argh
12:40 masak JimmyZ_: no.
12:40 flussence r: my @list = 'a'..'z'; say { (@list Z=> 1..*) }.perl
12:40 p6eval rakudo dbcdb1: OUTPUT«Block.new()␤»
12:40 flussence r: my @list = 'a'..'z'; say %(@list Z=> 1..*).perl
12:40 p6eval rakudo dbcdb1: OUTPUT«("a" => 1, "b" => 2, "c" => 3, "d" => 4, "e" => 5, "f" => 6, "g" => 7, "h" => 8, "i" => 9, "j" => 10, "k" => 11, "l" => 12, "m" => 13, "n" => 14, "o" => 15, "p" => 16, "q" => 17, "r" => 18, "s" => 19, "t" => 20, "u" => 21, "v" => 22, "w" => 23, "x" => 24, "y" => 25…
12:40 masak JimmyZ_: precedence. same as 'and' and 'or'.
12:40 flussence r: my @list = 'a'..'z'; say @list.kv.hash.invert.perl;
12:40 p6eval rakudo dbcdb1: OUTPUT«("a" => "0", "b" => "1", "c" => "2", "d" => "3", "e" => "4", "f" => "5", "g" => "6", "h" => "7", "i" => "8", "j" => "9", "k" => "10", "l" => "11", "m" => "12", "n" => "13", "o" => "14", "p" => "15", "q" => "16", "r" => "17", "s" => "18", "t" => "19", "u" => "20", "…
12:40 JimmyZ_ hmm
12:40 masak JimmyZ_: don't use the loose-precedence boolean operators when you don't require loose precedence.
12:40 flussence oops, off by one
12:41 flussence r: my @list = <a b c d e f b d d>; say @list.kv.hash.invert.perl;
12:41 p6eval rakudo dbcdb1: OUTPUT«("a" => "0", "b" => "1", "c" => "2", "d" => "3", "e" => "4", "f" => "5", "b" => "6", "d" => "7", "d" => "8").list␤»
12:41 JimmyZ_ rakudo: my $a = 3; my $b = 4; $a = $a xor $b; $b = $b xor $a; $a = $a xor $b; say $a, ' ', $b;
12:41 masak I'm advocating an .invert on Lists
12:41 p6eval rakudo dbcdb1: OUTPUT«3 4␤»
12:41 flussence r: my @list = <a b c d e f b d d>; say %(@list Z=> 0..*).perl;
12:41 p6eval rakudo dbcdb1: OUTPUT«("a" => 0, "b" => 6, "c" => 2, "d" => 8, "e" => 4, "f" => 5).hash␤»
12:41 flussence well that didn't work...
12:41 masak :)
12:42 Celelibi hum... for perl 5 "local" was also creating a new variable with the same name and the same visibility but with a lifetime limited to the block.
12:42 masak also, I'd like a sub form of .invert
12:42 Celelibi And not just storing the value and restoring it back later.
12:43 flussence Celelibi: it's a bit hard to store/revert there, since they can have tied variables
12:43 eviltwin_b joined #perl6
12:49 masak moritz: somehow we're back to the ugly, noisy stacktraces with lots of eager/gimme/reify in them :/
12:51 eviltwin_b joined #perl6
12:54 sergot joined #perl6
12:55 zhutingting joined #perl6
12:59 * masak writes 'return so all', and shivers happily
13:08 fgomez joined #perl6
13:13 poincare101 joined #perl6
13:14 eviltwin_b joined #perl6
13:21 fgomez joined #perl6
13:29 moritz masak: are we? example?
13:29 moritz r: for 1..10 { die 'foo' }
13:29 p6eval rakudo dbcdb1: OUTPUT«foo␤  in block <anon> at /tmp/9Am3mG992v:1␤␤»
13:29 eviltwin_b joined #perl6
13:29 moritz no eager/gimme/reify
13:32 masak I'm getting it all the time in the script I'm writing.
13:32 masak I'll try and golf it.
13:33 isBEKaml joined #perl6
13:34 masak r: for ^1 { for ^1 { die "foo" } }
13:34 p6eval rakudo dbcdb1: OUTPUT«foo␤  in block <anon> at /tmp/JNHtXyA2qd:1␤  in method reify at src/gen/CORE.setting:4783␤  in method reify at src/gen/CORE.setting:4678␤  in method reify at src/gen/CORE.setting:4678␤  in method gimme at src/gen/CORE.setting:5065␤  in method eager at src/gen/CORE.…
13:35 masak moritz: two nested for loops.
13:35 moritz curious.
13:35 masak seems it can handle the one, but not two or more :)
13:35 masak and my script has two or more.
13:35 moritz I'll see if I can awesomify it
13:35 isBEKaml so... matrix operations always bomb? :)
13:35 moritz masak++ # actually using my code
13:36 masak moritz++ # making things incrementally better
13:36 moritz isBEKaml: no, you can matrix-operate with a single loop and multiple variables :-)
13:36 jnthn Also it's a bug in error reporting, not in nested loops. :)
13:36 moritz right, not dying also helps :-)
13:37 masak sometimes not dying isn't an option.
13:38 isBEKaml O.o(topic of all things philosophical suddenly takes form in #perl6!)
13:40 isBEKaml left #perl6
13:40 moritz jnthn: in Grammar.pm, can I access subroutines from Perl6::Actions?
13:40 isBEKaml joined #perl6
13:40 moritz jnthn: in particular I think I need make_simple_code_object to evaluate the <arglist> of a use statement at compile time
13:40 jnthn moritz: Technically, if they're our-scoped, yes. BUT it feels...odd.
13:41 jnthn moritz: Ah... World feels a righter place.
13:41 jnthn (And make_simple_code_object arguably belongs in World anyway.)
13:45 moritz jnthn: should I rename it to create_simple_code_object?
13:46 moritz jnthn: most world stuff seems to start with create_ instead of make_
13:46 jnthn +1
13:46 jnthn I bet a bunch of $*W calls it does become self. too
13:46 moritz 3
13:47 jnthn Sounds about right.
13:50 geekosaur joined #perl6
13:52 eviltwin_b joined #perl6
13:53 birdwind1pbird joined #perl6
13:54 tadzik hehe. My browser suggests http://daringfireball.net/p​rojects/markdown/syntax#img when I tye in 'mark'. I should probably learn this syntax once and well
13:59 masak r: my %h1 = 1..4; my %h2 = 5..8; my %h = %h1, %h2; say %h.^name
13:59 p6eval rakudo dbcdb1: OUTPUT«Hash␤»
14:00 masak r: constant %h1 = 1..4; constant %h2 = 5..8; constant %h = %h1, %h2; say %h.^name
14:00 p6eval rakudo dbcdb1: OUTPUT«Parcel␤»
14:00 masak I just got bitten by this. I expected Hash in the second case, too.
14:00 tadzik r: my %h1 = 1..4; my %h2 = 5..8; my %h = %h1, %h2; say %h.perl
14:00 p6eval rakudo dbcdb1: OUTPUT«("1" => 2, "3" => 4, "5" => 6, "7" => 8).hash␤»
14:00 masak is my expectation wrong here? if so, why? what is it we enable by making %h a Parcel in the constant case?
14:00 jnthn masak: Remember that constants don't do the right kinda thing with % and @ just yet.
14:01 masak oh, so it's a NYI thing?
14:01 masak I'd like to note for the record that I expect the above two to both give Hash.
14:01 jnthn masak: Yeah. All my attempts to build a model that satisfies all the things people expect "constant" to do have failed. :/
14:01 masak jnthn: I can understand if it's tricky.
14:02 masak but here's what I expect: I expect it to work like 'my' :)
14:02 masak I'm interested to hear what other expectations that clashes with.
14:02 jnthn masak: Well, one view is "constants are really just binding the RHS under a name into the package"
14:02 masak r: constant %h1 = 1..4; constant %h2 = 5..8; constant %h = (%h1, %h2).hash; say %h.perl
14:02 p6eval rakudo dbcdb1: OUTPUT«("1" => 2, "3" => 4, "5" => 6, "7" => 8).hash␤»
14:02 masak r: constant %h1 = 1..4; constant %h2 = 5..8; constant %h = (%h1, %h2).hash; say %h.^name
14:02 p6eval rakudo dbcdb1: OUTPUT«Hash␤»
14:02 masak there's a workaround for now.
14:03 jnthn masak: Do %h1.^name to understand the issue :)
14:03 jnthn masak: Anyway, if they are just bindings then we never actually made a hash in the above example.
14:03 masak r: constant %h1 = 1..4; say %h1.^name
14:03 p6eval rakudo dbcdb1: OUTPUT«Range␤»
14:03 masak right, yes.
14:04 masak I expect that one to say Hash as well.
14:04 jnthn masak: TimToady seems to what that we have them be more container-ish.
14:04 jnthn masak: The upshot of JFDI on that one is that Hash is mutable...
14:04 masak yeah. we're running into unresolved container/mutability issues.
14:04 jnthn Right.
14:05 masak it's pretty clear that the spec is inconsistent there somewhere.
14:05 jnthn So basically, whichever way I change it out of the options I have in front of me seems to make things better in one way and worse in another. :)
14:06 jnthn I can try and do something like "we force it to be an EnumMap" or "we force it to be a List", I guess.
14:06 jnthn Anyway, I agree the current state is wrong.
14:08 moritz it's even RONG! :-)
14:08 jnthn Really 'orribly Not Good? :)
14:17 eviltwin_b joined #perl6
14:20 noam joined #perl6
14:21 masak I'm having similar pains now, when assigning lists calculated with nested maps to an array.
14:21 masak when I do it with 'my', the array assignment flattens the lists, and everything works smoothly.
14:21 masak when I do it with 'constant', things don't flatten, and turn into unexpectednesses down the line.
14:25 lichtkind joined #perl6
14:27 lichtkind moritz: we gotta do something with http://faq.perl6.org/
14:31 masak do what?
14:45 flussence it does look a little... rough
14:47 geekosaur joined #perl6
14:47 masak there isn't enough padding in places, agreed.
14:47 lichtkind masak: i mean mostly the conent
14:47 lichtkind wirs question i will soon better explain better in tablets
14:48 masak and the code bits could do with their own background color. (grey, preferably)
14:48 lichtkind and when i have a better FAQ i maybe should redirect there
14:48 masak lichtkind: well, this FAQ was created for very specific purposes. just make sure those purposes are not lost.
14:51 lichtkind masak: dont worry i incorporate it first
14:54 eviltwin_b joined #perl6
14:54 isBEKaml lichtkind: I saw cowens coming around to tablets. Is he active here? I vaguely recall him working on revaming perldocs on the p5 doc list.
14:54 masak so, you're objecting against this FAQ being here, because your material explains things better, after you've incorporated this FAQ into your material?
14:55 isBEKaml masak: I think lichtkind means that content is a little sparse on perl6 faq.
14:55 allbery_b joined #perl6
14:58 masak agreed.
15:02 lichtkind isBEKaml: i didnt known this he just mad some small patches which were fine so far
15:03 lichtkind isBEKaml: and the content is partiall random and partially doesnt belong there rather into docs
15:03 lutok joined #perl6
15:04 isBEKaml lichtkind: I was just pleasantly surprised to see him contributing to tablet docs. He had been incredibly helpful on perl beginners list and probably understands more perl than I can ever hope to. :)
15:05 lichtkind isBEKaml: good to know
15:06 eviltwin_b joined #perl6
15:11 penguin_ joined #perl6
15:13 geekosaur joined #perl6
15:17 eviltwin_b joined #perl6
15:24 lichtkind isBEKaml: but you dont have interest to contribute?
15:24 fglock_ joined #perl6
15:24 isBEKaml lichtkind: I'll be around. :)
15:25 isBEKaml lichtkind: Though TBQH, tablets wiki finally seems a lot better than the shitty perl.org's wiki formatting.
15:27 noam joined #perl6
15:28 noam joined #perl6
15:28 sisar joined #perl6
15:30 sisar tadzik: i'm sorry, but i'm not yet ready to hack on Panda yet. I need a bit more improvement of my P6-fu... that said, i'll surely get back to panda later.
15:31 masak let us know if we can assist with the P6-fu bit.
15:31 sisar masak: sure
15:32 sisar masak: so i'm back to your June 2011 posts. On http://strangelyconsistent.or​g/blog/june-25-2011-connect-4 , variable "$current_player" is not predeclared, line 36.
15:34 masak oops
15:34 * masak looks
15:34 masak indeed.
15:34 masak probably worked earlier due to a bug in b.
15:35 masak should work just by moving the declaration of $current_player to somewhere above 'sub input_move'.
15:35 sisar masak: yeah, i got that :)
15:35 masak I'll also make sure to fix it in the post. thanks for noticing.
15:37 sisar masak: no problem. while you are at it, you might also fix the hangamn code which I reported earlier as missing a ".IO" or something similar...
15:38 masak oh, yes.
15:39 sisar masak, neverming. You've already fixed it !
15:39 sisar *mind
15:40 JimmyZ_ r: 1, 1, 2, 3, 5 ... * > 30
15:40 p6eval rakudo dbcdb1:  ( no output )
15:42 masak oh, good.
15:43 sisar masak, earlier "True" and "False" were called "Bool::True" and "Bool::False" ?
15:43 masak still are.
15:43 sisar ohk
15:43 masak they exist both under the package name Bool, and imported into your current namespace.
15:44 masak that holds true for user-defined enumerations, as well.
15:44 sisar ah, i see.
15:44 masak r: enum A <b c d e>; say A::c; say d
15:44 p6eval rakudo dbcdb1: OUTPUT«c␤d␤»
15:44 masak but yes, they've also recently changed so that .gist prefers the short form.
15:45 lichtkind isBEKaml: tablets are not wiki based any more
15:47 [Coke] Celelibi: I am Coke, and I condone your anti pepsi rhetoric.
15:47 sisar masa: "June is Coming". Can we expect another streak of 30 perl6-tutorials-spiced-with-games ?
15:47 sisar masak; ^
15:47 masak heh :)
15:48 geekosaur joined #perl6
15:48 masak well, I meant to spend a little bit of time each day in June 2012 cleaning up the material I wrote last year, supplying it with things that in retrospect turned out to be missing, etc.
15:48 masak preparing things for publishing.
15:48 Psyche^ joined #perl6
15:49 masak but... now I've allocated two vacation weeks in the beginning of June, and I don't expect to be bringing the laptop on vacation. so, it'll have to be some other month. maybe July :)
15:51 sisar oh, yeah sure, adding things to them might also be good. Just carry the same style: building things from ground up, assuming no previous knowledge.
15:51 [Coke] PerlJam++ # made a mental note to follow up on a scrollback comment, scrollforward slightly, he's already got it covered.
15:51 sisar I;m fine with July too
15:51 sisar masak++
15:52 eviltwin_b joined #perl6
15:52 masak sisar: I'm happy to hear you're working through the posts. your feedback on them is valuable.
15:52 sisar :)
15:53 masak sisar: the amount of stuff added in the last few posts is disproportionate. which is part of the reason why I want to go back and edit things.
15:54 sisar yeah, I agree. Things are not causal in the last posts. Like you talk of things you have not introduced yet. Revisiting them is a good idea.
15:54 noam joined #perl6
15:54 sisar masak: i did not have much problem with them though.
15:55 sisar for example, on http://strangelyconsistent.​org/blog/june-24-2011-types, you mention subroutine signatures, though you have not mentioned them before.
15:56 masak well, I'm talking mostly about the 27..30 posts.
15:57 [Coke] moritz: does nom+bs rhyme with zombies?
15:57 sisar ah, well. When you are polishing them, if you want a student's perspective, you know where to find me :)
16:00 masak \o/
16:01 sisar .oO (inside everyone, there is a critic ;-)
16:02 moritz lichtkind: when questions are frequently asked, I answer them on faq.perl6.org. Contributions from others are very welcome too
16:06 masak &
16:06 moritz [Coke]: yes, if the "+" is silent :-)
16:07 allbery_b joined #perl6
16:08 dalek rakudo/use-arglist: ff4843a | moritz++ | src/Perl6/Grammar.pm:
16:08 dalek rakudo/use-arglist: preparations for use with arglist
16:08 dalek rakudo/use-arglist: review: https://github.com/rakudo/rakudo/commit/ff4843a557
16:08 dalek rakudo/use-arglist: 3b5d78c | moritz++ | src/Perl6/ (3 files):
16:08 dalek rakudo/use-arglist: move make_simple_code_object to World, rename it to start with create_
16:08 dalek rakudo/use-arglist: review: https://github.com/rakudo/rakudo/commit/3b5d78c3ae
16:08 moritz phenny: "arglist"?
16:08 phenny moritz: "malice" (de to en, translate.google.com)
16:09 jnthn :D
16:09 [Coke] HA!
16:09 arnsholt Oooh, use with arglist
16:10 arnsholt moritz++
16:10 moritz arnsholt: only preparations so far
16:11 jnthn moritz: You know there's a make_thunk too? :)
16:11 eviltwin_b joined #perl6
16:11 moritz jnthn: no. I just stole the code from the 'constant' handler
16:12 moritz jnthn: I guess make_thunk should be in World too?
16:17 sisar masa: "for example, on http://strangelycon...." <---- scratch that comment, i was wrong.
16:17 sisar *masak
16:17 * sisar afk
16:21 jnthn moritz: Yes, it's better if they're in the same place.
16:21 jnthn (More predictable.)
16:23 JimmyZ_ joined #perl6
16:23 JimmyZ_ joined #perl6
16:27 * jnthn afk
16:33 Celelibi <sisar> .oO (inside everyone, there is a critic ;-) <-- even inside your sistar ? That's awkward.
16:33 Celelibi :)
16:33 sisar :)
16:38 Timbus joined #perl6
16:40 moritz TIL that SGML was a simplification of GML
16:40 moritz or standardization
16:43 moritz considering that sgml isn't quite great, I shudder to think how GML must have been
16:44 JimmyZ_ postgresql uses sgml for documentation
16:45 moritz well, HTML (versions 1 to 4) is SGML, so that's not too surprising
16:46 JimmyZ_ hehe
16:52 sftp joined #perl6
16:56 xenu joined #perl6
16:57 PacoAir joined #perl6
16:57 moritz http://en.wikipedia.org/wiki/Standard_Ge​neralized_Markup_Language#Other_features
16:59 geekosaur joined #perl6
17:02 sergot joined #perl6
17:13 tokuhirom joined #perl6
17:21 dalek rakudo/use-arglist: ba1f23a | moritz++ | src/Perl6/ (3 files):
17:21 dalek rakudo/use-arglist: move make_thunk to World, as create_thunk
17:21 dalek rakudo/use-arglist: review: https://github.com/rakudo/rakudo/commit/ba1f23ad67
17:22 sorear good * #perl6
17:22 moritz good * sorear
17:24 eviltwin_b joined #perl6
17:24 isBEKaml joined #perl6
17:35 dalek Perlito: 2f51501 | (Flavio S. Glock)++ | / (2 files):
17:35 dalek Perlito: Perlito5 - command line option -v message
17:35 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/2f51501a39
17:36 fglock_ o/
17:45 sorear o/
17:47 eviltwin_b joined #perl6
17:52 lichtkind continue is gone?
17:53 geekosaur joined #perl6
17:53 lichtkind how to i go to next when clause .nextsame?
17:53 moritz proceed iirc
17:58 eviltwin_b joined #perl6
18:02 eviltwin_b joined #perl6
18:06 brrt joined #perl6
18:07 lichtkind thank you
18:08 eviltwin_b joined #perl6
18:11 au joined #perl6
18:12 eviltwin_b joined #perl6
18:12 lichtkind moritz: break is also asay?
18:12 lichtkind ahhh i mena away
18:18 mucker joined #perl6
18:20 moritz hm, the thunk that should evaluate the arglist is a Code object, but invoking it gives me "Method 'postcircumfix:<( )>' not found for invocant of class 'Bool'"
18:21 eviltwin_b joined #perl6
18:23 lichtkind moritz: i ask becasue i didnt found it but just want to get sure
18:24 lichtkind didnt found in synopses
18:27 moritz succeed I think
18:27 birdwindupbird joined #perl6
18:27 moritz I mean, 'break' is now called 'succeed'
18:29 lichtkind moritz: thats how i read it too, i just want to be sure when recrafting this area
18:31 tadzik 'evening
18:32 ggoebel joined #perl6
18:33 jaffa4 How woild you repeated matching in niecza?
18:33 lichtkind hai tadzik
18:54 eviltwin_b joined #perl6
18:57 dalek tablets: 4fb608a | (Herbert Breunung)++ | README.md:
18:57 dalek tablets: reform how to help section
18:57 dalek tablets: review: https://github.com/perl6/tablets/commit/4fb608a522
18:57 dalek tablets: 6219e26 | (Herbert Breunung)++ | README.md:
18:57 dalek tablets: new formating rules
18:57 dalek tablets: review: https://github.com/perl6/tablets/commit/6219e260f2
18:57 dalek tablets: fcd1f99 | (Herbert Breunung)++ | docs/tablet-4-operators.txt:
18:57 dalek tablets: Merge branch 'master' of github.com:perl6/tablets
18:57 dalek tablets: review: https://github.com/perl6/tablets/commit/fcd1f99083
18:57 dalek tablets: 28b45aa | (Herbert Breunung)++ | docs/ (4 files):
18:57 dalek tablets: update jump command and massive ongoong link format fix
18:57 dalek tablets: review: https://github.com/perl6/tablets/commit/28b45aa066
18:59 NamelessTee joined #perl6
19:02 eviltwin_b joined #perl6
19:07 geekosaur joined #perl6
19:18 dalek Perlito: 2d338cf | (Flavio S. Glock)++ | / (8 files):
19:18 dalek Perlito: Perlito5 - javascript: add sprintf(), printf()
19:18 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/2d338cf419
19:20 wamba joined #perl6
19:22 eviltwin_b joined #perl6
19:28 autark joined #perl6
19:35 eviltwin_b joined #perl6
20:04 adu joined #perl6
20:21 eviltwin_b joined #perl6
20:30 geekosaur joined #perl6
20:53 dalek tablets: 0eb0ce1 | gerdr++ | docs/tablet-2-basic-syntax.txt:
20:53 dalek tablets: minor correction UTF-8 <-> Unicode
20:53 dalek tablets: in particular, there is no such thing as a 'UTF-8 character'
20:53 dalek tablets: review: https://github.com/perl6/tablets/commit/0eb0ce1cc7
20:53 dalek tablets: 2df5fcf | (Tomasz Konojacki)++ | docs/tablet-2-basic-syntax.txt:
20:53 dalek tablets: Merge pull request #5 from gerdr/patch-1
20:53 dalek tablets:
20:53 dalek tablets: minor correction UTF-8 <-> Unicode
20:53 dalek tablets: review: https://github.com/perl6/tablets/commit/2df5fcfecf
21:03 lichtkind phew
21:06 dalek tablets: 9df26e8 | (Herbert Breunung)++ | docs/appendix- (2 files):
21:06 dalek tablets: major reformat is finally over
21:06 dalek tablets: review: https://github.com/perl6/tablets/commit/9df26e894c
21:06 dalek tablets: f749de1 | (Herbert Breunung)++ | docs/tablet-2-basic-syntax.txt:
21:06 dalek tablets: Merge branch 'master' of github.com:perl6/tablets
21:06 dalek tablets: review: https://github.com/perl6/tablets/commit/f749de1a8a
21:08 dalek tablets: fe53478 | (Herbert Breunung)++ | README.md:
21:08 dalek tablets: added gerdr++ to authors list
21:08 dalek tablets: review: https://github.com/perl6/tablets/commit/fe53478f0b
21:08 dorlamm joined #perl6
21:16 jferrero joined #perl6
21:18 lutok joined #perl6
21:19 lichtkind can you hear that !!!!  i reworted over 1000 links hulk!!
21:20 raiph joined #perl6
21:22 sorear lichtkind++
21:24 raiph hi all
21:24 raiph lichtkind++
21:24 sorear hello raiph
21:25 lichtkind thanks
21:25 lichtkind its alsmost as i have bithday :)
21:25 lichtkind birthday
21:26 lichtkind bit its late :)
21:31 sergot lichtkind++
21:32 lichtkind i had yesterday :9
21:32 lichtkind thanks :)
21:32 tadzik yay, happy birthday lichtkind!
21:32 eviltwin_b joined #perl6
21:32 lichtkind :)
21:37 raiph happy day after b'day lichtkind
21:38 lichtkind thank you
21:39 sergot lichtkind: happy birthday! \o/
21:39 lichtkind :)
21:39 sergot :)
21:39 sergot And good night everyone! o/
21:40 Chillance joined #perl6
21:43 eviltwin_b joined #perl6
21:48 lichtkind good night
21:50 sorear night
21:55 adu joined #perl6
21:57 eviltwin_b joined #perl6
21:58 kaare_ joined #perl6
22:05 felher joined #perl6
22:21 thelazydeveloper joined #perl6
22:26 dalek tablets: 20e2c64 | (Herbert Breunung)++ | docs/report.pl:
22:26 dalek tablets: added shebang to report script
22:26 dalek tablets: review: https://github.com/perl6/tablets/commit/20e2c64b92
22:26 dalek tablets: 1211ee2 | (Herbert Breunung)++ | docs/report.pl:
22:26 dalek tablets: not counting empty lines
22:26 dalek tablets: review: https://github.com/perl6/tablets/commit/1211ee2d58
22:26 dalek tablets: 52a8253 | (Herbert Breunung)++ | docs/appendix-h-links.txt:
22:26 dalek tablets: update links
22:26 dalek tablets: review: https://github.com/perl6/tablets/commit/52a8253188
22:55 dalek tablets: 3237594 | (Herbert Breunung)++ | docs/ (2 files):
22:55 dalek tablets: repairing minor format issues
22:55 dalek tablets: review: https://github.com/perl6/tablets/commit/3237594b40
23:00 lestrrat joined #perl6
23:07 eviltwin_b joined #perl6
23:17 geekosaur joined #perl6
23:18 alvis joined #perl6
23:18 dalek tablets: 6127a13 | (Herbert Breunung)++ | docs/build-html.pl:
23:18 dalek tablets: dont numerate headings
23:18 dalek tablets: review: https://github.com/perl6/tablets/commit/6127a13d1d
23:27 eviltwin_b joined #perl6
23:30 eviltwin_b joined #perl6
23:33 eviltwin_b joined #perl6
23:36 eviltwin_b joined #perl6
23:56 eviltwin_b joined #perl6

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

Perl 6 | Reference Documentation | Rakudo