Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-11-07

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:55 anuby joined #perl6
01:07 fgomez joined #perl6
01:09 hypolin joined #perl6
01:10 havenn joined #perl6
01:16 eternaleye_ joined #perl6
01:20 vlixes joined #perl6
01:21 diakopter byr freather
01:23 PerlJam joined #perl6
01:23 dalek joined #perl6
01:24 Juerd joined #perl6
01:24 pmichaud joined #perl6
01:24 sergot joined #perl6
01:24 masak joined #perl6
01:24 topo joined #perl6
01:24 [Coke] joined #perl6
01:24 Util joined #perl6
01:24 tadzik joined #perl6
01:25 p6eval joined #perl6
01:25 hugme joined #perl6
01:46 Vlavv joined #perl6
01:48 Vlavv joined #perl6
02:01 supernovus joined #perl6
02:02 supernovus So, for building Rakudo Star (the distribution), do they fork the libraries that are included, or just use the newest versions as of when the distribution is put together?
02:04 supernovus seen masak
02:04 aloha masak was last seen in #perl6 39 mins 58 seconds ago joining the channel.
02:04 gootle joined #perl6
02:08 jerome joined #perl6
02:11 supernovus I wonder if they'll ever make it so that you don't have to recompile all your pre-compiled Perl 6 modules every time you recompile Rakudo. Sigh.
02:14 plobsing joined #perl6
02:19 supernovus No such method 'get_string' for invocant of type 'str'
02:37 skids supernovus: likely that is a problem with a failure being returned from a compiled module.  That regressed in star09 IIRC.
02:38 skids oh he quit.
03:04 chee joined #perl6
03:06 havenn joined #perl6
03:58 bapa joined #perl6
04:22 bapa joined #perl6
04:49 hypolin joined #perl6
05:20 sorear joined #perl6
05:24 telex joined #perl6
05:37 erkan joined #perl6
05:37 erkan joined #perl6
05:38 meilincore joined #perl6
05:42 meilincore left #perl6
06:35 kaleem joined #perl6
07:02 Woodi morning everyone :)
07:03 sorear o/ Woodi
07:03 SamuraiJack joined #perl6
07:03 Woodi what you think about putting Object-relational Mapper project into Google Code ?
07:05 anuby joined #perl6
07:36 domidumont joined #perl6
07:36 wamba joined #perl6
07:39 Woodi actually I had in mind a) do research on existing implementations word-wide and possible approuches b) find possible ways of OR-mapping in Perl6 c) implement something
07:39 diakopter TRIUMPH
07:39 Woodi but looks a) and b) alone qualifies for GCI
07:40 sorear yay, vote counting is ~over, now I can be productive again
07:40 diakopter :P
07:41 Woodi I hear taxes will incrase :)
07:42 sorear taxes always increase, no matter what they promise
07:42 sorear naught is sure in life but for death and taxes
07:45 domidumont joined #perl6
07:46 moritz Woodi: I've toyed a bit with a micro-ORM, and frequently ran into DBIish segfaults
07:46 Woodi ok
07:46 moritz Woodi: so an ORM project can only work for somebody who is willing and able to debug and fix those
07:46 Woodi then "resolve DBIsh segfaults" !
07:47 Woodi not many projects so far on perlfaundation page...
07:47 Woodi why ppls no brainstorm in such cases is beyound my imagination :)
07:48 sorear why brainstorm more projects?  we're already overworked
07:48 Woodi sorear: but GCI is for ppls from outside ?
07:49 domidumont joined #perl6
07:50 Woodi it is attracting ppls in small steps. many ppls. and maybe few of them will be able to contribute some wizardy later too :)
07:54 cognominal joined #perl6
07:56 flightrecorder joined #perl6
07:57 sorenso joined #perl6
08:00 wamba1 joined #perl6
08:03 GlitchMr joined #perl6
08:10 brrt joined #perl6
08:11 bruges_ joined #perl6
08:14 sorenso joined #perl6
08:15 anuby_ joined #perl6
08:28 moritz k
08:28 moritz ww
08:57 havenn joined #perl6
08:59 brrt joined #perl6
09:09 kresike joined #perl6
09:10 kresike hello all you happy perl6 people
09:12 fhelmberger joined #perl6
09:25 cognominal joined #perl6
09:28 havenn joined #perl6
09:38 FROGGS joined #perl6
09:46 dakkar joined #perl6
09:49 fhelmberger joined #perl6
09:51 chee joined #perl6
09:58 kurahaupo joined #perl6
09:58 GlitchMr42 joined #perl6
10:01 Gothmog_ joined #perl6
10:04 havenn joined #perl6
10:23 silug joined #perl6
10:23 masak good antenoon, #perl6
10:25 brrt hi masak
10:25 moritz \o
10:31 jnthn morning, #perl6
10:32 brrt hi jnthn
10:35 jnthn r: my %h; %h<a>:exists
10:35 p6eval rakudo 5dd878:  ( no output )
10:35 moritz \o
10:35 jnthn This now parses/passes along the adverb. :)
10:35 moritz o/
10:35 moritz does it do something already?
10:35 brrt oh, that is nice
10:35 brrt general adverb parsing, or just for :exists?
10:36 jnthn So if anybody has tuits to work on implementing the actual logic in the postcircumfix methods... :)
10:36 jnthn brrt: General adverb parsing.
10:36 tadzik r: my %h; %h<a>:delete; %h.perl.say
10:36 p6eval rakudo 5dd878: OUTPUT«().hash␤»
10:36 tadzik ossum
10:36 brrt yay
10:38 jnthn r: sub infix:<with>($a, $b, :$joiner) { $a ~ $joiner ~ $b }; say 'fish' with 'chips' :joiner(' and ')
10:38 p6eval rakudo 5dd878: OUTPUT«fish and chips␤»
10:39 brrt jnthn++, that is really cool
10:40 masak jnthn++ # wow!
10:40 jnthn Finally figured out how the hell STD did it :)
10:40 masak :P
10:41 * brrt is updating rakudo as we speak
10:41 brrt so the next release is going to have macros and adverbs
10:41 brrt that is really really cool
10:41 * masak .oO( adverbs on macros o.O )
10:42 brrt oh behave
10:42 masak :)
10:43 moritz and heredocs, and quote adverbs
10:43 masak r: multi infix:<+>($l, $r, :$awesome!) { "AWESOME <guitar solo>" }; say 40 + 2 :awesome
10:43 p6eval rakudo 5dd878: OUTPUT«Unexpected named parameter 'awesome' passed␤  in sub infix:<+> at src/gen/CORE.setting:2945␤  in block  at /tmp/g0Saze_0v7:1␤␤»
10:43 masak jnthn: Y NO WORKS? :(
10:45 jnthn Um.
10:46 jnthn 'cus named parameters don't participate in multi-dispatch, I guess.
10:46 jnthn But still, it should consider your candidate tighter...
10:46 moritz r: multi infix:<+>($l, $r, :$awesome!) { "AWESOME <guitar solo>" }; say Any + Any :awesome
10:46 p6eval rakudo 5dd878: OUTPUT«AWESOME <guitar solo>␤»
10:47 jnthn oh!!
10:47 jnthn Yeah, of course
10:47 moritz does seem to be a dispatch problem, not an adverb problem
10:47 jnthn Not even a problem
10:47 jnthn A specific (Int, Int) is going to be tighter and an (Any, Any) even if the (Any, Any) is in an outer scope.
10:47 jnthn *than an
10:47 jnthn *inner
10:47 jnthn :)
10:48 masak oh!
10:48 masak r: multi infix:<+>(Int, Int, :$awesome!) { "AWESOME <guitar solo>" }; say 40 + 2 :awesome
10:48 p6eval rakudo 5dd878: OUTPUT«AWESOME <guitar solo>␤»
10:50 masak \o/
11:03 fgomez joined #perl6
11:04 havenn joined #perl6
11:06 jnthn Don't forget this is the first release with operator precedence traits and shell words too :)
11:08 gootle joined #perl6
11:09 jnthn r: my $i = 0; while $i < 10 { FIRST { say 'post' }; LAST { say 'wish' }; NEXT { say "and" }; say $i++ };
11:09 p6eval rakudo 5dd878: OUTPUT«post␤0␤and␤1␤and␤2␤and␤3␤and␤4␤and␤5␤and␤6␤and␤7␤and␤8␤and␤9␤and␤wish␤»
11:09 jnthn Also, did that last night (before they only worked in for loops) :)
11:19 SHODAN joined #perl6
11:26 rindolf joined #perl6
11:31 jnthn meeting &
11:34 daxim joined #perl6
11:40 chee joined #perl6
11:45 fhelmberger joined #perl6
11:45 masak jnthn++ # FIRST NEXT LAST in for loops
11:46 masak er, while loops*
11:46 masak r: my $count = 10; loop { say $count--; last unless $count; LAST { say "liftoff!" } }
11:46 p6eval rakudo 5dd878: OUTPUT«10␤9␤8␤7␤6␤5␤4␤3␤2␤1␤liftoff!␤»
11:47 masak cool.
11:55 _ilbot joined #perl6
11:55 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: http://irc.perl6.org/ | UTF-8 is our friend!
11:59 masak r: my $count = 10; loop { say $count--; last unless $count; LAST { say "$count -- liftoff!" } }
11:59 p6eval rakudo 5dd878: OUTPUT«10␤9␤8␤7␤6␤5␤4␤3␤2␤1␤0 -- liftoff!␤»
12:07 brrt joined #perl6
12:09 bowtie joined #perl6
12:13 cognominal joined #perl6
12:34 Psyche^ joined #perl6
13:07 havenn joined #perl6
13:10 chee joined #perl6
13:26 mtk joined #perl6
13:31 bluescreen10 joined #perl6
13:31 benabik joined #perl6
13:48 azawawi joined #perl6
13:48 azawawi hi #perl6
13:54 mtk joined #perl6
14:07 PacoAir joined #perl6
14:08 atrodo joined #perl6
14:09 Ulti hi azawawi people were around not long ago ;)
14:10 azawawi i noticed
14:11 azawawi it is like coming and say hi to an empty room ... :)
14:11 * azawawi hears the echo
14:11 sivoais joined #perl6
14:11 flightrecorder joined #perl6
14:12 masak I guess people are busy.
14:12 masak I know I am :)
14:15 * moritz is, too
14:17 azawawi masak: i will level up alone... not a big deal :)
14:19 azawawi solo
14:20 brrt joined #perl6
14:24 FROGGS joined #perl6
14:26 kresike joined #perl6
14:28 plobsing joined #perl6
14:29 * azawawi home &
14:29 * azawawi %*ENV{'home'}  # :) &
14:30 moritz %*ENV<home>
14:42 PerlJam greetings perlings!
14:42 tadzik hello jammings
14:46 PerlJam [Coke]: I hope you're happy now!  :)
14:48 flussence rn: my @a = gather for ^5 { FIRST { next }; take $_ }; say @a
14:49 p6eval niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0m��Action method statement_prefix:FIRST not yet implemented at /tmp/a4nndJ9_Wn line 1:�------> [32mmy @a = gather for ^5 { FIRST { next }[33m�[31m; take $_ }; say @a[0m��Unhandled exception: Unable to resolve method stateme…
14:49 p6eval ..rakudo 5dd878: OUTPUT«0 1 2 3 4␤»
14:49 flussence shouldn't rakudo say «1 2 3 4» there?
14:52 PerlJam aye, looks like a bug
14:56 moritz I guess FIRST is called before the loop is entered
14:56 moritz r: for ^5 { my $x = $_ ** 2; FIRST { say $x } };
14:56 p6eval rakudo 5dd878: OUTPUT«Any()␤»
14:56 moritz yes, looks like
14:57 [Coke] PerlJam: yay, it's over. Now maybe we can do things!
15:00 PerlJam oh, maybe it isn't a bug.   "FIRST {...}*      at loop initialization time, before any ENTER"  and "ENTER {...}*      at every block entry time, repeats on loop blocks."  So FIRST happens before block entry, which is consistent with what happens.
15:02 moritz so not as awesome as one might want to wish for :(
15:03 PerlJam r: my @a = gather for ^5 { START { next }; take $_ }; say @a
15:03 p6eval rakudo 5dd878: OUTPUT«1 2 3 4␤»
15:03 moritz PerlJam: remember that phasers don't need a block
15:03 moritz r: my @a = gather for ^5 { START next; take $_ }; say @a
15:03 p6eval rakudo 5dd878: OUTPUT«1 2 3 4␤»
15:05 cognominal joined #perl6
15:06 PerlJam START and FIRST seem backwards to me.  Or at least START seems like it should be called FIRST.
15:07 stopbit joined #perl6
15:08 moritz .oO( at FIRST it STARTled me too )
15:08 wamba joined #perl6
15:16 PerlJam r: for ^3 { my $x = FIRST time; say $x }  # I'm not sure about this one.
15:16 p6eval rakudo 5dd878: OUTPUT«Nil␤Nil␤Nil␤»
15:18 chee joined #perl6
15:21 broquaint joined #perl6
15:22 * jnthn back
15:33 wamba joined #perl6
15:36 [Coke] r: my $x = cat FIRST sink time;
15:36 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&cat' called (line 1)␤»
15:36 thou joined #perl6
15:37 jnthn No cat in Rakudo yet :)
15:37 jnthn And FIRST outside of a loop don't mean much...
15:37 cognominal joined #perl6
15:38 arnsholt What's cat for, btw?
15:38 moritz for creating a stringish stream
15:38 jnthn loling at
15:38 jnthn :)
15:38 jnthn Yeah, not quite sure how to implement it.
15:39 * moritz neither
15:40 jnthn Well, we're looking good on features for the Nov release. :)
15:40 jnthn I think we can have :delete and :exists working well in time for it.
15:40 perigrin sub cat { map { Str.coerce($_) } @_ } # excuse the moose-isims
15:40 fgomez joined #perl6
15:41 jnthn perigrin: It needs to have lazy semantics and behave more like a string if it's, say, matched against, not like a list of strings.
15:41 jnthn The map gets the laziness but not the "act like a string"
15:41 moritz perigrin: the problem isn't constructing the objects; it's making everything else that works with string work with Cats too
15:41 jnthn Right
15:42 jnthn Especially things like the regex engine.
15:42 perigrin moritz: implement a herd operator ... once you can herd Cats you can do anything in programming.
15:42 jnthn *groan* :)
15:43 PerlJam as long as it's not "hurd"
15:43 perigrin PerlJam: depends on how gnu your hurd is ...
15:46 arlinius joined #perl6
15:49 thou joined #perl6
15:54 kaare_ joined #perl6
15:55 flussence r: https://gist.github.com/4032415
15:55 p6eval rakudo 5dd878: OUTPUT«0,1,2,3,4,5,6,7,8,9␤»
15:55 flussence \o/
16:04 [Coke] r: say "mmm {('A'..'a')[11054]}"
16:04 p6eval rakudo 5dd878: OUTPUT«(timeout)»
16:04 [Coke] awww.
16:07 [Coke] r: say "mmm {('A'..'a')[454]}"
16:07 p6eval rakudo 5dd878: OUTPUT«mmm QM␤»
16:07 [Coke] r: say "mmm {('A'..'a')[424]}" #whoops
16:07 p6eval rakudo 5dd878: OUTPUT«mmm PI␤»
16:09 chee joined #perl6
16:09 thou joined #perl6
16:11 jimmy1980 joined #perl6
16:13 cognominal joined #perl6
16:25 skids joined #perl6
16:31 brrt left #perl6
16:39 masak [Coke]: "mmm QM" makes a lot of sense too, if you're into quantum computing.
16:39 masak er. quantum mechanics.
16:42 kresike bye folks
16:43 masak fare thyself well, kresike.
16:53 benabik_ joined #perl6
16:54 benabik joined #perl6
16:55 chee joined #perl6
16:57 jimmy1980 joined #perl6
17:06 skids r: role A [$x] { method d { "OHA1".say } }; role B { method d { "OHB1".say } }; role C does A[1] does B { method d { self.A[1]::d() } }; class D does C { }; my D $c .=new(); $c.d; # is there a syntax for explicitly using a parametric role's method?
17:06 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤Unable to parse expression in block; couldn't find final '}' at line 2, near "self.A[1]:"␤»
17:07 chee joined #perl6
17:08 jnthn skids: Not as far as I know
17:12 thou joined #perl6
17:19 zby_home joined #perl6
17:19 MayDaniel joined #perl6
17:27 sorenso joined #perl6
17:28 chee joined #perl6
17:32 thou joined #perl6
17:33 * masak would like something like http://msdn.microsoft.com/en-us/library/yh598w02.aspx as a Perl 6 module, for automatically closing file handles
17:39 SamuraiJack joined #perl6
17:40 spider-mario joined #perl6
17:42 jnthn I've been suggesting something like that for a while ;)
17:43 jnthn Making the limits of resource holding explicit.
17:43 cognominal joined #perl6
17:53 GlitchMr .u В
17:53 phenny U+0412 CYRILLIC CAPITAL LETTER VE (В)
18:01 cognominal joined #perl6
18:03 * flussence wants something like masak's asking for too. Not real destructors per se, just something like LEAVE but as an object method...
18:05 arnsholt Yeah, deconstructors would be good
18:05 Chillance joined #perl6
18:06 flussence (PHP has real destructors but I've found them somewhat less than useful for real-world code...)
18:13 cognominal joined #perl6
18:24 havenn joined #perl6
18:26 cognominal joined #perl6
18:40 leont joined #perl6
18:41 fglock joined #perl6
18:41 sorear o/
18:43 fglock o/
18:43 fhelmberger joined #perl6
18:45 cognominal joined #perl6
18:45 Entonian joined #perl6
18:49 xinming_ joined #perl6
19:06 cognominal_ joined #perl6
19:12 brrt joined #perl6
19:22 masak r: role Disposing { method dispose { say self ~ " disposed" } }; macro RAII($res, $code) { quasi { {{{$code}}}(); LEAVE { {{{$res}}}.dispose } } }; my $res = (class C does Disposable {}).new; RAII $res, { say "processing..." }
19:22 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤Unable to parse $*PKGDECL definition at line 2, near "does Dispo"␤»
19:22 masak r: role Disposing { method dispose { say self ~ " disposed" } }; macro RAII($res, $code) { quasi { {{{$code}}}(); LEAVE { {{{$res}}}.dispose } } }; class C does Disposable {}; my $res = C.new; RAII $res, { say "processing..." }
19:22 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤Unable to parse $*PKGDECL definition at line 2, near "does Dispo"␤»
19:22 masak oh.
19:23 masak r: role Disposing { method dispose { say self ~ " disposed" } }; macro RAII($res, $code) { quasi { {{{$code}}}(); LEAVE { {{{$res}}}.dispose } } }; class C does Disposing {}; my $res = C.new; RAII $res, { say "processing..." }
19:23 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling block RAII: Error while compiling block : Error while compiling block : Error while compiling op p6type: Error while compiling op callmethod: Unknown QAST node type QAST::Unquote␤at /tmp/I4MtNVgKXY:1␤…
19:23 * masak submits rakudobug
19:23 jnthn Don't you have enough copies of "nested blocks don't work"? :)
19:24 masak maybe.
19:25 jnthn ;)
19:25 masak (but whyyyy)
19:25 jnthn Because they're declarations, and the delayed decl stuff ain't done yet, I guess...
19:25 jnthn Though that seems unrelated to failing to find the unquite.
19:25 jnthn *unquote
19:25 masak aye.
19:26 jnthn I assume it's not soemthing simple like not processing the [0] node of the quasi block properly?
19:26 masak o.O
19:27 masak of course not. who would commit such a trivial mistake?
19:27 jnthn (every block has two kids, one with decls, one with statements...)
19:27 * masak hides between two lines of source code
19:27 leont left #perl6
19:27 jnthn my $past := $<block>.ast<past_block>.pop;
19:27 jnthn nqp::bindattr($quasi_ast, $ast_class, '$!past', $past);
19:27 jnthn :P
19:28 PerlJam masak: you must be thin to fit in such a tight space.
19:28 masak jnthn: yes, that seems wrong in the light of what you just said.
19:29 masak PerlJam: it's all a question of eating fewer carbs and setting the font size high enough.
19:30 jnthn .oO( unlikely sentence was unlikely... )
19:34 jlaire joined #perl6
19:52 [particle]1 joined #perl6
19:52 chee joined #perl6
19:55 jlaire joined #perl6
19:59 [particle] joined #perl6
19:59 am0c joined #perl6
20:08 dalek rakudo/nom: 692a610 | jnthn++ | src/core/Any.pm:
20:08 dalek rakudo/nom: Implement :exists and :delete for associative.
20:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/692a6102ee
20:08 dalek rakudo/nom: f81716a | jnthn++ | t/spectest.data:
20:08 dalek rakudo/nom: Run S32-hash/delete_adverb.t.
20:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/f81716ae21
20:09 dalek roast: 9e30ec8 | jnthn++ | S (5 files):
20:09 dalek roast: Rakudo unfudges.
20:09 dalek roast: review: https://github.com/perl6/roast/commit/9e30ec8b23
20:10 jnthn %h<a>:delete # can haz :)
20:15 kurahaupo joined #perl6
20:16 skids jnthn++
20:17 brrt has anyone implemented dynamically scoped subroutines?
20:17 brrt and if so, why, and how
20:18 chee joined #perl6
20:20 cognominal_ brrt: there are anonymous routines and dynamically scoped variables, and variable can have an & sigil. That gives all waht you want.
20:21 diakopter can also use $ sigil
20:21 brrt fair enough
20:22 brrt nr: my sub &*foo ($x) { ... };
20:22 p6eval niecza v22-19-gd874a8e: OUTPUT«Potential difficulties:â�¤  $x is declared but not used at /tmp/Smphzehzwu line 1:â�¤------> [32mmy sub &*foo ([33mâ��[31m$x) { ... };[0mâ�¤  &foo is declared but not used at /tmp/Smphzehzwu line 1:â�¤------> [32mmy sub &*foo [33mâ��[31m($x) { ... };[0mâ�¤â�¤Â»â€¦
20:22 p6eval ..rakudo 5dd878: OUTPUT«===SORRY!===␤Missing block␤at /tmp/lOHmhu0v68:1␤»
20:22 cognominal_ or should that be variable with variable with dynamic extent?   scope and extent are two different thing even if I don't remember being used in the synopses.
20:22 brrt nr: my sub &*foo ($x) { say $x + 1; }; &*foo(32);
20:22 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤Missing block␤at /tmp/srzaMNiVMj:1␤»
20:22 p6eval ..niecza v22-19-gd874a8e: OUTPUT«Potential difficulties:â�¤  &foo is declared but not used at /tmp/aOVZz0CwcJ line 1:â�¤------> [32mmy sub &*foo [33mâ��[31m($x) { say $x + 1; }; &*foo(32);[0mâ�¤â�¤Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Anyâ�¤  at /tmp/aOVZz0CwcJ…
20:23 cognominal_ * don't remember the "extent" word being used
20:24 * brrt fails to make & a sigil in rakudo
20:24 masak nr: my &*foo = sub ($x) { say $x + 1 }; &*foo(32)
20:25 brrt nr: my &foo = sub ($x) { say $x * 2; }; &foo(34);
20:25 p6eval rakudo 5dd878, niecza v22-19-gd874a8e: OUTPUT«33␤»
20:25 p6eval rakudo 5dd878, niecza v22-19-gd874a8e: OUTPUT«68␤»
20:25 masak brrt: this is essentially what cognominal told you at 21:20.
20:25 brrt yes, i see, i just failed to do it at my laptop
20:26 brrt sorry for being annoying about some things :-)
20:27 masak no problem.
20:27 masak S06 says you should bea ble to do it your way, too.
20:27 masak but it doesn't work yet.
20:29 masak also, 'sub foo($x) is dynamic' is s'posed to work and result in the same thing.
20:29 masak (S06 does 'my sub', but I think that may be a holdover from when subroutines weren't 'my'-scoped by default)
20:31 brrt as a related question, what happens when i define an our variable in a routine?
20:31 brrt nr: sub foo { our $bar = 4; }; foo; print $bar;
20:31 p6eval niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable $bar is not predeclared at /tmp/EoAPX5SN7I line 1:â�¤------> [32msub foo { our $bar = 4; }; foo; print [33mâ��[31m$bar;[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437…
20:31 p6eval ..rakudo 5dd878: OUTPUT«===SORRY!===␤Variable $bar is not declared␤at /tmp/EHfUhsLwFD:1␤»
20:31 masak it goes out of scope at the end of the routine.
20:32 brrt a routine is a package?
20:32 masak it is not.
20:32 masak and that's not the right conclusion to draw from the result of the evaluation, and from what I said ;)
20:33 masak try again.
20:33 havenn joined #perl6
20:34 brrt nr: sub foo { our $bar = 3; }; foo(); say ::<bar>;
20:34 p6eval niecza v22-19-gd874a8e: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Niecza.StashCursor.Core (System.String key, Boolean final, Niecza.StashCursor& sc, Niecza.Variable& v, Niecza.Variable bind_to) [0x00000] in <file…
20:34 p6eval ..rakudo 5dd878: OUTPUT«Any()␤»
20:34 [Coke] did anyone answer the recent stackoverflow question about perl6 ?
20:34 brrt [Coke] link please :-)
20:35 masak nr: sub foo { our $bar = 3 }; foo; say our $bar
20:35 p6eval niecza v22-19-gd874a8e: OUTPUT«3␤»
20:35 p6eval ..rakudo 5dd878: OUTPUT«Any()␤»
20:35 [Coke] brrt: if I had that, I'd know if it was answered.... and it was.
20:35 * masak submits rakudobug
20:35 [Coke] http://stackoverflow.com/questions/13262675/how-to-include-file-in-perl-6
20:35 masak nqp: sub foo { our $bar := 3 }; foo(); our $bar; say($bar)
20:35 p6eval nqp: OUTPUT«Routine declaration requires a signature at line 2, near "{ our $bar"␤current instr.: 'panic' pc 13089 (src/stage2/gen/NQPHLL.pir:4619) (src/stage2/gen/NQPHLL.pm:324)␤»
20:35 masak nqp: sub foo() { our $bar := 3 }; foo(); our $bar; say($bar)
20:35 p6eval nqp: OUTPUT«3␤»
20:36 brrt pretty nice p6 is on stackoverflow now
20:37 masak oh, there's been a few stackoverflow questions about Perl 6.
20:37 [Coke] 56. :)
20:38 masak nice. :)
20:40 havenn joined #perl6
20:41 havenn joined #perl6
20:45 brrt p6: ::.perl
20:45 p6eval rakudo 5dd878, niecza v22-19-gd874a8e:  ( no output )
20:45 brrt p6: say ::.perl
20:45 p6eval niecza v22-19-gd874a8e: OUTPUT«PseudoStash.new(...)␤»
20:45 p6eval ..rakudo 5dd878: OUTPUT«PseudoStash.new("GLOBALish", GLOBAL, "EXPORT", EXPORT, "\$?PACKAGE", GLOBAL, "::?PACKAGE", GLOBAL, "\$_", Any, "\$/", Any, "\$!", Any, "\$=pod", Array.new(), "!UNIT_MARKER", !UNIT_MARKER, )␤»
20:45 brrt p6: say PACKAGE::.perl
20:45 p6eval niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared name:â�¤        'PACKAGE::' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /h…
20:45 p6eval ..rakudo 5dd878: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&PACKAGE' called (line 1)␤»
20:47 brrt p6: say $&PACKAGE.perl
20:47 p6eval niecza v22-19-gd874a8e: OUTPUT«[31m===[0mSORRY![31m===[0m��Invalid hard reference syntax at /tmp/W2xTE44vkh line 1:�------> [32msay $[33m�[31m&PACKAGE.perl[0m��Parse failed��»
20:47 p6eval ..rakudo 5dd878: OUTPUT«===SORRY!===␤Invalid hard reference syntax at line 2, near "&PACKAGE.p"␤»
20:48 brrt p6: say $?PACKAGE.perl
20:48 p6eval rakudo 5dd878: OUTPUT«GLOBAL␤»
20:48 p6eval ..niecza v22-19-gd874a8e: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Niecza.StashCursor.Core (System.String key, Boolean final, Niecza.StashCursor& sc, Niecza.Variable& v, Niecza.Variable bind_to) [0x00000] in <file…
20:56 [Coke] r: use Exporter;
20:56 p6eval rakudo 5dd878: OUTPUT«===SORRY!===␤Could not find Exporter in any of: /home/p6eval/nom-inst/lib/parrot/4.8.0-devel/languages/perl6/lib, /home/p6eval/nom-inst/lib/parrot/4.8.0-devel/languages/perl6/vendor/lib, /home/p6eval/nom-inst/lib/parrot/4.8.0-devel/languages/perl6/site/lib, /home/p…
20:57 havenn joined #perl6
20:58 mj41 hi, Is there any way to do something like say Qc $template; without eval? ... example https://gist.github.com/4034388
20:59 brrt left #perl6
21:00 [Coke] ... you want to run arbitrary code in a Str without an eval?
21:02 mj41 [Coke]: ... yes ... maybe it doesn't make sense at all :-)
21:02 jnthn mj41: I just did a load of quote improvements recently and I'm not aware of a way to do that :)
21:06 mj41 I think Qc is sort of syntax useful for simple template system. But not sure if it is intended to be somehow reusable on Str without eval. ... Sorry if it doesn't make sense. ... Eval is probably good enough.
21:08 jnthn Well, the thing that does the interpolation is the parser
21:08 jnthn And eval is the way to call back into that :)
21:08 jnthn You could possibly argue we need a way to call *directly* into the quote parser, such that it expects to parse the whole of a string.
21:09 jnthn Since eval starts in the main language.
21:13 mj41 jnthn: yes something like that ... problem with eval solution is line 13 https://gist.github.com/4034388 ... but I can live with this for now :-).
21:17 [Coke] mj41: what's the problem?
21:17 [Coke] r: https://gist.github.com/4034388
21:17 p6eval rakudo f81716: OUTPUT«1␤abc $mvar 10 $mvar abc␤2␤abc $mvar 10 $mvar abc␤3␤...how?␤»
21:18 mj41 [Coke]: if you uncomment line 13
21:18 [Coke] r: https://gist.github.com/4034551
21:18 p6eval rakudo f81716: OUTPUT«1␤abc $mvar 10 $mvar abc␤2␤===SORRY!===␤Confused␤at eval_0:1␤»
21:18 mj41 you need to escape all 」
21:18 [Coke] r: https://gist.github.com/4034551
21:18 p6eval rakudo f81716: OUTPUT«1␤abc $mvar 10 $mvar abc␤2␤something borked␤===SORRY!===␤Confused␤at eval_0:1␤»
21:19 [Coke] so if the eval might fail, wrap it in a try, no?
21:20 [Coke] so if the eval might fail, wrap it in a try, no?
21:20 [Coke] r: https://gist.github.com/4034551
21:20 p6eval rakudo f81716: OUTPUT«1␤abc $mvar 10 $mvar abc␤2␤something borked␤3␤...how?␤»
21:20 [Coke] (there, need proper catch block)
21:22 mj41 rhr: say Qc 'abc \' $mvar {$mvar} $mvar abc';
21:24 mj41 rhr: say Qc 'abc \' abc';
21:30 cognominal__ joined #perl6
21:33 kaare_ joined #perl6
21:34 masak mj41: it's also fairly easy to do your own templating with .trans
21:34 masak I do that quite a lot.
21:36 masak 'night, #perl5
21:36 masak er, #perl6 :P
21:39 ggoebel joined #perl6
21:47 [Coke] masak: *mock horror*
21:47 am0c joined #perl6
21:49 cognominal joined #perl6
21:49 mj41 night ... and thx for help and new features https://raw.github.com/mj41/Perl-6-GD/master/export/Summary%20-%20Compilers%27%20features%20-%20GoodData.png
21:51 jnthn mj41++ # producing the graph
21:59 PerlJam Is there an easyish way to make an RPM out of a CPAN dist (including its dependencies) ?
21:59 PerlJam oops, ww
22:00 PerlJam (but if you guys know the answer, I'd appreciate it :)
22:01 geekosaur cpan2rpm?
22:06 sftp_ joined #perl6
22:06 * flussence wishes distro package managers had pluggable repo support so stuff like CPAN became built-in...
22:07 jrockway joined #perl6
22:08 erkan joined #perl6
22:08 erkan joined #perl6
22:19 jlaire joined #perl6
22:20 Tene yum has pluggable repo support
22:21 Tene I usually use cpan2dist, I think.  I've previously used cpanspec, and before that cpan2rpm.
22:22 Tene looks like out of those three, my laptop only has cpanspec installed, so I probably used that most-recently.
22:22 Krunch joined #perl6
22:26 PerlJam Tene: thanks, that helps.
22:29 jlaire joined #perl6
22:29 Tene Feel free to message me if you run into any trouble.
22:37 Krunch are there any kind of "complex" synchronisation objects in perl6? specifically i am interested in a thread-safe queue (this seems to have been in rfc185 previously)
22:38 sorear funny you should mention that, because thread-safe queues are the ONLY complex sync object in niecza
22:39 sorear multithreading has not seen very much love in either compiler yet
22:40 Krunch just found rfc86 which mentions mailboxes
22:40 Krunch but yeah, i realise threads are not quite there yet
22:41 chee joined #perl6
22:43 PerlJam Krunch: what were you going to do with these "complex synchronization objects" if you found them?  :)
22:44 Krunch just trying to write a "concurrent hello world" in perl6
22:45 Krunch https://linuxfr.org/news/de-tout-de-rien-des-bookmarks-du-bla-bla-45#comment-1406218
22:54 BillySeth joined #perl6
23:13 havenn joined #perl6
23:15 havenn_ joined #perl6
23:21 jaldhar joined #perl6
23:21 vlixes joined #perl6
23:27 * jnthn has blaught: http://6guts.wordpress.com/2012/11/08/lots-of-improvements-coming-in-the-rakudo-november-release/
23:28 jnthn sleep &
23:47 snearch joined #perl6

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

Perl 6 | Reference Documentation | Rakudo