»ö« | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by moritz_ on 25 June 2010.
alksentrs So you don't have to put parens in ( ...long expression... ).perl.say 00:00
masak alksentrs: .perl.say given ...long expression... 00:01
alksentrs rakudo: .perl.say given 3 + 5
p6eval rakudo f8e959: OUTPUT«8␤»
00:02 Psyche^ joined
TimToady rakudo: 3+5 ~~ .perl.say 00:03
p6eval rakudo f8e959: OUTPUT«8␤»
alksentrs Perl 6 has a steep learning curve 00:04
TimToady in spots
alksentrs When I was learning it, anything involving : as syntax was incomprehensible 00:05
e.g. :a<b>
TimToady yes, : is one of the highly context sensitive characters
masak alksentrs: you are not alone in that. 00:06
00:06 jhuni left, Patterner left, Psyche^ is now known as Patterner 00:08 Italian_Plumber joined 00:10 risou joined
alksentrs In something like say(2 + * + (* + 4)), how does Perl know how far to extend the implicit block? 00:10
TimToady to the first approximation, it's only defined over infixes 00:11
with *.foo as a special case
alksentrs right
TimToady and unaries, I mean
00:12 risou left
alksentrs ok 00:12
TimToady rakudo: sort -*, <3 5 2 59 382 7>
p6eval rakudo f8e959: ( no output )
TimToady rakudo: say sort -*, <3 5 2 59 382 7>
p6eval rakudo f8e959: OUTPUT«382597532␤»
TimToady rakudo: say ~sort -*, <3 5 2 59 382 7> 00:13
p6eval rakudo f8e959: OUTPUT«382 59 7 5 3 2␤»
TimToady arguably *.foo is just a unary
but the args have to curry correctly 00:14
00:14 azert0x left
TimToady re steep learning curve, we hope that for most people that turns into a long learning curve, where they learn things only as they need them, and can get away with cargo-cult programming where they don't understand completely yet 00:15
Quadrescence rakudo: say ~sort ***, <3 5 2 59 382 7>
p6eval rakudo f8e959: OUTPUT«===SORRY!===␤HyperWhatever (**) not yet implemented at line 22, near "*, <3 5 2 "␤»
TimToady some people insist on marching straight up the cliff, though :) 00:16
Quadrescence rakudo: say ~sort 2**, <3 5 2 59 382 7>
p6eval rakudo f8e959: OUTPUT«===SORRY!===␤Confused at line 22, near "say ~sort "␤» 00:17
TimToady ** is an operator
Quadrescence yes indeed
rakudo: say ~sort 2*(*), <3 5 2 59 382 7>
p6eval rakudo f8e959: OUTPUT«2 3 5 7 59 382␤»
Quadrescence good work good work
let's take a look at ambiguity 00:18
rakudo: say ~sort 2***, <3 5 2 59 382 7>
00:18 lichtkind left
p6eval rakudo f8e959: OUTPUT«2 3 5 7 59 382␤» 00:18
TimToady not really ambiguous under LTM rules
Quadrescence This reminds me of Mathematica's pure functions, kind of. (<expression-containing-#>)& 00:19
(#+1)& ==> (lambda (x) (+ x 1))
00:20 azert0x joined
TimToady x +? 00:20
oh, lisp
Quadrescence (: 00:21
TimToady -> $x { $x + 1 } hereabouts
is how we spell lambda
well, that, and *+1
and { $^x + 1 }
and { $_ + 1 }
alksentrs On perlcabal.org/syn/, would it be possible to have better link descriptions than "X tags" and "C tags"? Not everyone knows POD.
TimToady um, yes? 00:22
alksentrs: would you like a pugs commit bit so you can fix it? 00:25
alksentrs I've never used SVN before... (I have used Git)
TimToady we're probably switching it to git pretty soon
Quadrescence TimToady: I dare you to use ⍵ instead of * as the formal parameter. ;) 00:27
TimToady why? is there prior art? 00:28
Quadrescence Should I leave "why?" as an exercise?
TimToady tends not to have read math papers
TimToady prefers his greek to come the classical way 00:29
Quadrescence I guess you tend not to read APL either. ;)
(neither do I)
00:30 ruoso joined
alksentrs Why are there 2 versions of Term::ANSIColor on modules.perl6.org/ ? (Perl6-Term--ANSIColor and perl6-Term-ANSIColor.) 00:30
00:30 _macdaddy left, azert0x left
masak rakudo: my @a = 1, 2, 3; my %h = :@a; @a = (); say %h.perl # sometimes I expect cloning behavior in the second statement 00:31
p6eval rakudo f8e959: OUTPUT«{"a" => []}␤»
masak or maybe in the third one. 00:32
TimToady maybe you should program in a language without side effects
masak :) 00:33
alksentrs rakudo: {}[-1] 00:34
p6eval rakudo f8e959: OUTPUT«Null PMC access in get_string()␤ in 'Any::postcircumfix:<[ ]>' at line 1659:CORE.setting␤ in main program body at line 1␤»
masak submits rakudobug
Quadrescence rakudo: {{}}[-1] 00:35
TimToady std: {}[-1]
p6eval rakudo f8e959: ( no output )
std 32122: OUTPUT«===SORRY!===␤Unsupported use of [-1] subscript to access from end of array; in Perl 6 please use [*-1] at /tmp/wdmhyaF1XE line 1:␤------> {}[-1]⏏<EOL>␤Parse failed␤FAILED 00:01 115m␤»
alksentrs rakudo: {}() 00:36
p6eval rakudo f8e959: OUTPUT«invoke() not implemented in class ''␤ in main program body at line 22:/tmp/7rA5fvKgZR␤»
masak rakudo: {}[2]
p6eval rakudo f8e959: ( no output )
alksentrs "class '' "?
TimToady usually means a parrot type leaking through
masak moritz_++ submitted a very similar ticket today. 00:37
Quadrescence rakudo: {}[({{2}}[0])[0]] 00:38
p6eval rakudo f8e959: ( no output )
alksentrs rakudo: grammar G {}; G.parse('') 00:39
p6eval rakudo f8e959: OUTPUT«Method 'TOP' not found for invocant of class ''␤ in 'Grammar::parse' at line 5871:CORE.setting␤ in main program body at line 22:/tmp/fVBDHf3NAX␤»
00:45 espadrine left
masak Rakudo really sucks at reporting the right names of classes. 00:46
rakudo: class A {}; A.foo
p6eval rakudo f8e959: OUTPUT«Method 'foo' not found for invocant of class ''␤ in main program body at line 22:/tmp/IiczNZ8QJZ␤»
dalek psi: da2dcaa | masak++ | / (2 files):
[Yapsi] Detect variable use before declaration

A semi-substantial patch. Keeps track of the 'currently visible variables' to detect a use-before-declaration. This unbreaks two previously failing tests.
psi: 5f23b48 | masak++ | t/runtime.t:
[t/runtime] uncommented one more test

This test has been working since before last release, as a matter of fact.
pugssvn r32123 | colomon++ | [t/spec] Unfudge two tests that now work. 00:57
01:02 masak left
dalek psi: 6baad9f | masak++ | t/ (2 files):
[t] whitespace therapy
01:05 meppl left 01:09 cjk101010 left 01:21 alksentrs left 01:23 yrgd left 01:31 yrgd joined 01:36 jferrero left 01:37 hercynium left, whiteknight left 01:45 hercynium joined 01:52 masak joined
masak did you know that you can now use 'when' as a statement modifier? www.effectiveperlprogramming.com/blog/543 01:55
std: my $a = our $a 02:04
p6eval std 32123: OUTPUT«Potential difficulties:␤ Useless redeclaration of variable $a (see line 1) at /tmp/QdzuD4bQpC line 1:␤------> my $a = our $a⏏<EOL>␤ok 00:01 117m␤»
02:08 agentzh joined
masak another use case for the $obj.&subroutine() form: inside an interpolated string, when you're too lazy to use curlies ;-) 02:08
TimToady gah, they put break semantics on the statement modifier. I wish they'd follow Perl 6's lead here instead of just making stuff up. 02:11
tylercurtis O.o while (...) { ... when ...; } 02:13
masak TimToady: you should go talk to them.
colomon oooo! to maximize something, one should not use min! 02:14
FurnaceBoy colomon++
masak colomon: I think I read a theorem about that once.
colomon couldn't figure out how he'd broken the weasel evolution algorithm....
masak colomon: did yours try to produce the diametrical opposite of METHINKS IT LOOKS LIKE A WEASEL? :P 02:15
colomon yes, exactly.
FurnaceBoy lol 02:19
Shakespeare refudiated?
masak yes. that is the diametrical opposite. 02:20
FurnaceBoy blinks
masak it has no characters in common in the appropriate locations.
FurnaceBoy ahhh a derangement ?
masak not at all.
simply optimized for not being like the target string. :)
FurnaceBoy ic
colomon and since it was the initial string, it never got any worse or better, it just stayed there. 02:21
masak of course. it's optimal :)
colomon slowly recalculating, desperately looking for a string which was even worse.
masak :) 02:22
can't improve on perfection.
02:24 leprevost joined 02:27 jhuni joined, Italian_Plumber left 02:32 flatwhatson left 02:36 flatwhatson joined 02:40 bluescreen joined 02:41 bluescreen is now known as Guest97742
colomon my version of the weasel: gist.github.com/560146 02:46
masak colomon: (^($target.chars)).map({ @chars.pick }) 02:52
that looks odd to me.
@chars.pick($target.chars) would have worked fine. 02:53
colomon ooooo, better!
and looked nicer.
masak hm, { fitness $_ } or *.&fitness ? :) 02:55
the 'say' line should be moved to the start of the while loop to avoid duplication. 02:56
oh, belay that.
colomon masak: I've been trying to figure out the right approach for that.
masak then you won't get the last one, of course.
colomon yeah, it needs to come before and after.
masak we need an NOW_AND_LAST block :P 02:57
colomon eerr, wait, it needs :replace 03:00
masak oops. sorry :/
colomon next step: optimize max? 03:02
right now it does twice as many calls to $by (in this script) than it actually needs to. 03:04
masak why?
tylercurtis It does $by($a) cmp $by($b) every time with a unary $by instead of caching the transformed values. 03:05
colomon you don't need to cache.
you just need to keep track of the least result from $by as well as the input value that got that least result 03:06
masak colomon++
colomon I've been meaning to get around to implementing that for about five months, I think. :) 03:07
03:07 dju left
colomon afk # bed 03:08
masak 'night, colomon! 03:09
03:09 FurnaceBoy left 03:15 dju joined 03:27 Transformer joined 03:29 isBEKaml joined, Transformer left
isBEKaml yapsi: say 42 03:29
p6eval yapsi: ( no output )
03:29 hercynium left
isBEKaml ehh. p6eval yapsi borken? 03:29
masak seems so. :/ 03:30
morning, isBEKaml :)
isBEKaml morning, masak!
masak is attempting to implement 'our' declarations
03:31 jaldhar joined, colomon left
isBEKaml great! I see you also fixed the variable declaration thingy. 03:32
03:32 _jaldhar left
masak I did. that's tonight's results so far. 03:33
03:39 molaf joined 03:40 REPLeffect left
lue ohai o/ 03:42
masak hello lue
rakudo: say ?( any(Bool::True, Bool::False) )
p6eval rakudo 2ac5fe: OUTPUT«1␤»
masak rakudo: say so any(Bool::True, Bool::False)
p6eval rakudo 2ac5fe: OUTPUT«any(Bool::True, Bool::False)␤»
masak submits rakudobug
03:54 REPLeffect joined
isBEKaml masak: I see. 03:57
masak this 'our' variables business is a bit funny too.
isBEKaml bbiab # coffee
03:58 ash_ joined
masak so far I have this: I need to create a SIC block which is never actually executed. call it 'package'. all it contains is directives for all the 'our'-declared variables in the program. 03:59
lue Is there a Perl 6 Pod interpreter out there already? [I'm going to write one anyway, just curious]
masak lue: there's three that I know of.
Util perl6: my @x = 1, 2, 3; my ( $first, *@rest ) := |@x; say [ :@x, :$first, :@rest ].perl;
p6eval pugs: OUTPUT«*** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/ygSvi6KIGA line 1, column 18-46␤»
..rakudo 2ac5fe: OUTPUT«["x" => [1, 2, 3], "first" => \(1, 2, 3), "rest" => []]␤»
masak lue: see gist.github.com/500732 04:00
Util: I'm not sure binding of a list of things has been correctly implemented in Rakudo yet. 04:01
std: label1: say "OH HAI"; label1: say "OH HAI again!" 04:03
p6eval std 32123: OUTPUT«===SORRY!===␤Illegal redeclaration of 'label1' at /tmp/ntrRpTkFQO line 1:␤------> label1: say "OH HAI"; label1: ⏏say "OH HAI again!"␤Illegal redeclaration of symbol 'label1' (see line 1) at /tmp/ntrRpTkFQO line 1:␤------> label1: say "OH
.oO(I remember being specifically told 'not to worry about it' when I coded := a while ago, likely because it's more difficult than I would imagine.)
masak std: if 1 { if 2 { label1: say "OH HAI" } }; if 3 { if 4 { label1: say "OH HAI again" } }
p6eval std 32123: OUTPUT«ok 00:01 116m␤»
masak TimToady: ^^
ash_ is that wrong?
masak lue: indeed. don't worry about it. :)
ash_: I maintain that it is. 04:05
ash_ how/why?
masak ash_: let's say you want to goto label1. which one do you end up with?
04:05 fitnerd joined
ash_ none, you shouldn't be able to jump into a conditional block scope, imo 04:06
masak well, you can.
as long as the block doesn't require params.
Util masak: thanks!
masak np
the odd thing about labels is that they're not only visible to their enclosed scopes, but also to their surrounding scopes. 04:07
ash_ err, really?
masak in other words, you can goto both outwards and inwards.
ash_ thats going to be confusing...
masak the only restriction being the parameters thing.
ash_ hmm
masak because of that, I think that my second program is as illegal as my first one.
ash_ well, under those conditions, then std seems to be off
i still am not sure i'd want to be able to jump into a block, can you jump into a loop? 04:08
TimToady I want to be able to go from one when block to the next with goto
the conflicting labels will be caught when we start hoisting labels up into parent blocks 04:09
we don't do that now, so we can't see the conflict
masak ok.
lue masak: being a TI-BASIC programmer, that kind of scope-jumping seems perfectly alright to me [that doesn't mean I support labels, of course :)] 04:10
masak ash_: you can jump into a while loop (one without -> and params), but likely not into a for loop.
lue: :)
lue: most BASICs solve this by not really encapsulating the call stack. 04:11
ash_ so... you can jump into: loop { }, while { }, until { } style loops?
masak right. provided they don't do -> $a, $b stuff.
04:11 molaf left
masak which they might. 04:12
isBEKaml masak: sorry, I didn't notice your ping. seemingly we were typing at the same and I went off. :/ 04:13
masak no worries. 04:14
isBEKaml masak: talking about the 'our' business, if we were to go by the way you describe, wouldn't it be cumbersome to write find-declarations or find-variables within 'package'.
.oO(in TI-BASIC, you're allowed to be lazy and in many cases leave off the final quote or parenthesis. I'm glad I found Perl 6.
isBEKaml masak: basically, leaving the whole set of 'our' declared variables and blocks in the 'package' would mean we have to find ways to jump around to them when called from elsewhere in the program. 04:16
masak isBEKaml: I've been thinking about that in the past few days. 04:17
isBEKaml am I sorely wrong here? (I won't be surprised)
masak isBEKaml: the amazing thing is, lexical lookup stays the same.
it's being done through the exact same mechanism as with 'my'.
the only thing that's different is that the container that the variable points to happens to reside in the special never-called 'package' block. 04:18
TimToady rosettacode.org/wiki/One-dimensiona...ata#Perl_6
masak so all wee need to do is to provide the runtime with enough information to know when a declared variable should be bound to a variable in the package block. 04:19
isBEKaml masak: I guessed as much about the lexical lookup. I was more concerned about variable state with 'our'. They are mutable everywhere, right? :)
lue masak: I would love to help out with rakudo's parsing of Pod. My idea is a standalone program, like P5's perldoc.
masak well, neither more or less than 'my' variables :)
isBEKaml but _not_ everywhere. 04:20
masak lue: then you might enjoy checking out mberends++' module.
lue [One reason I'm interested in it is so I can read S26 nicely formatted :)]
masak isBEKaml: well, neither are 'our' variables, viewed in that light.
std: { our $b }; say $b
p6eval std 32123: OUTPUT«Potential difficulties:␤ $b is declared but not used at /tmp/Xbufh2uJOg line 1:␤------> { our $b⏏ }; say $b␤ok 00:01 117m␤» 04:21
masak hm.
maybe I do have the wrong mental model, after all.
isBEKaml rakudo: { our $b } say $b; 04:22
p6eval rakudo 2ac5fe: OUTPUT«===SORRY!===␤Confused at line 22, near "{ our $b }"␤»
isBEKaml rakudo: { our $b }; say $b;
masak TimToady: ain't you glad we added .rotate now? :)
p6eval rakudo 2ac5fe: OUTPUT«===SORRY!===␤Symbol '$b' not predeclared in <anonymous> (/tmp/UZTaRlfTea:22)␤»
masak TimToady: which one is right, STD or Rakudo? 04:23
TimToady hmm.
std: { our $b }; say GLOBAL::<$b>
p6eval std 32123: OUTPUT«Potential difficulties:␤ $b is declared but not used at /tmp/kz2poooqe_ line 1:␤------> { our $b⏏ }; say GLOBAL::<$b>␤ok 00:02 117m␤» 04:24
s_mosher TimToady, these concise examples on rosettacode are becoming more and more readable to me. I'm not sure if that's my fault, yours/whomever's, or Perl6's.
TimToady surely the current package is GLOBAL...
s_mosher: you are doubtless being corrupted by the dark side of the duct tape.
masak TimToady: you mean that the lookup happens on the $b in GLOBAL::, so it's not an error? 04:25
TimToady std: { our $b }; say OUR::<$b>
p6eval std 32123: OUTPUT«Potential difficulties:␤ $b is declared but not used at /tmp/YjGJWYZ04w line 1:␤------> { our $b⏏ }; say OUR::<$b>␤ok 00:01 117m␤»
s_mosher that would explain some other things I've been noticing too ;)
TimToady std: { our $b }; say $GLOBAL::b
p6eval std 32123: OUTPUT«Potential difficulties:␤ $b is declared but not used at /tmp/wtcFqXz8Vp line 1:␤------> { our $b⏏ }; say $GLOBAL::b␤ok 00:01 117m␤» 04:26
TimToady oh, it's not complaining about the use, but the lack of use inside the block
s_mosher in some of the examples the Perl6 code comes off as more or less equally readable as the problem statement
TimToady s_mosher: that's one of our nefarious plans
s_mosher I can't say the same for (in this case) say the picolisp example that invariably follows
masak I think I will not worry about this for the first iteration of 'our' declarations. Rakudo doesn't seem to.
04:26 cjk101010 joined
isBEKaml rakudo: {our $b = 42; say $b; }; $b = 24; say $b 04:27
p6eval rakudo 2ac5fe: OUTPUT«===SORRY!===␤Symbol '$b' not predeclared in <anonymous> (/tmp/dnghhC1WQB:22)␤»
s_mosher I think it's great that it's working out that way. I never would have expected that.
masak Rakudo follows the mental model I had just moments ago.
TimToady I coulda done Z+ with shift and unshift, but then I'd've had to supply extra 0s
masak s_mosher: I hope we'll be able to surprise more people that way.
04:27 Italian_Plumber joined, Italian_Plumber left
s_mosher the big advantage is the Perl6 code is quicker to read than the problem statement is 04:28
TimToady well, people say the same about Haskell, but I'll be darned if I can see it
s_mosher well, in this case
I can't read haskell, even when I can, I can't
isBEKaml TimToady: "Perl6 quicker to read than the problem statement." Another slogan? :)
TimToady Perl 6: just ignore the comments... 04:29
04:29 Raihjken joined
Raihjken lolwow umm hi. First time here :) 04:30
TimToady "self-documenting code" where have I heard that before...
Raihjken lawlz maybe in class
I know my teacher spoke about it a couple times :D
.oO(Perl 6: Do * you want.)
Raihjken Anyway was just lookin at Perl6, saw a link "come here to get started"
Soo.. yeah
TimToady and here you came 04:31
Raihjken yeah
TimToady what sort of things are you interested in?
Raihjken I've programmed with perl before, I'm not a total noob, well.. mostly.
masak Raihjken: welcome!
Raihjken I think the only thing I made that worked, was a program that could read and write little text files, and play the music you wrote :)
as beeps :/
TimToady beeps are a good start 04:32
masak rakudo: say ~<beep boop>.pick(3, :replace)
p6eval rakudo 2ac5fe: OUTPUT«beep beep boop␤»
masak :)
Raihjken lol umm I'm guessing I got a whisper or something from Masak, how would i go about replying (never being in an irc thing before)
lue beeps are what all the cool 80's equipment used. Hello Raihjken o/
Raihjken I used the Audio::Beep Module
and some simple code
So you guys work on Perl6? 04:33
TimToady we pretend to
Raihjken :P
masak we like to think we are
TimToady we're really just playing
Raihjken nice.
brb Shadow is shoving his face into his foot guessing he wants his litterbox changed >.>
my foot*
I think he's hinting XD
TimToady my brother-in-law's critter is also named Shadow 04:34
Raihjken kewl
TimToady mine isn't, but I'm quite certain she wants her litterbox changed
Raihjken I have two cats that are actually mine, Shadow and Ashes, were fostering a cat named spark that we helped out (he bit an electrical cord as a kitten and umm it wasn't pretty especially with the resulting mouth infection) 04:35
Bella is my parents >.>
THen we have the 3 dogs, and the weird dog I Dunno it's name but it looks kinda weird, were fostering it
TimToady are you familiar with any other programming languages?
Raihjken <3
tylercurtis TimToady: does the :: sigil impose a type constraint?
TimToady :: isn't really a sigil
masak more like a collection of dots :P 04:36
Raihjken I know HTML, some JavaScript, some CSS, very little Java/C++ and not a whole lot of perl but enough to do the little things I need it to do
masak \o/
Raihjken I've read extremely little of the jargon file >.>
I haven't had time this summer to do much been at my girlfriends camp, I just turned 18 a couple weeks ago 04:37
masak congratulations.
it's a nice age.
isBEKaml jargon file in catb? We don't use too many jargons here. ;)
TimToady ah, sorear++, who hangs around here, is just a bit older
Raihjken she kinda leaves the computer stuff to me, ice skating and bead-art are more her thing <3
TimToady I'm a bit older than that
Raihjken lawl yeah the one on catb
Everyone here works on Perl6? 04:38
masak isBEKaml: we don't use jargon here? that's an interesting statement.
Raihjken like.... Everyone?
masak Raihjken: no.
isBEKaml masak: :P
TimToady when jnthn comes back from vacation, you'll find a kindred lolcat
Raihjken XDXD
caturday is better imo.
isBEKaml masak: I said "We don't use too many jargons here"
masak Raihjken: we have many people here who never say anything. when we need to vacuum, we just lift them gently.
tylercurtis Does the :: not-really-a-sigil impose a type constraint?
Raihjken umm 04:39
masak isBEKaml: how much is too much in this case?
tylercurtis: sometimes.
TimToady tylercurtis: depends on how you're using it
Raihjken the only things I know that you put before code would be
use Tk
isBEKaml masak: well, that depends on how much is too much. :P
Raihjken use Strict
and use warnings
tylercurtis is wondering if he can treat self in methods without explicit invocant parameters as ::self.
Raihjken :P
TimToady I doubt it
std: ::self 04:40
p6eval std 32123: OUTPUT«ok 00:01 114m␤»
Raihjken XD
what was that S:
masak Raihjken: I think you'll blend in here just fine. we need to find a way to direct your youthful energy into a project.
Raihjken kewl
TimToady and suppress about half of the XDs
Raihjken only one thing
masak Raihjken: maybe talk to lue too, when he's around.
Raihjken I start school next wing
lue hai o/
Raihjken week*
huge typo
masak oh, there's my lue <3 04:41
Raihjken :)
TimToady lue is also one of our loose cannons
masak that's why I thought of him :)
Raihjken lawl so now I'm a loose cannon :P
masak XD