Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-01-27

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:08 thestarslookdown joined #perl6
00:11 __Ace__ joined #perl6
00:54 meppl good night
01:07 kingkongrevenge hmmm? That's weird.  They must do some by country ip filtering.
01:08 kingkongrevenge doh.  ignore.
01:21 Lorn joined #perl6
01:37 cj alrighty... now to determine my username...
01:37 cj r14437 | cjcollier | 2006-10-21 16:36:56 -0700 (Sat, 21 Oct 2006) | 2 lines
01:37 cj er, password
01:38 cj can someone reset my password for me, or tell me where I can do so?
01:39 diakopter ch: which password
01:39 diakopter cj:
01:40 diakopter oh, ok
01:40 diakopter yes, PM the password you want
01:47 ruz joined #perl6
01:56 pugs_svn r19708 | cjcollier++ | s/be/by/
01:56 cj ooh, looks like I figured it out :)
01:58 cj what is this syntax?
01:58 cj '{ package ' ~ $.name ~ '; ' ~ Main::newline()
01:58 cj from http://svn.pugscode.org/pugs/v6/v6-KindaPerl6/src/KindaPerl6/Visitor/Emit/Perl5.pm
01:58 lambdabot http://tinyurl.com/yqzgby
01:58 cj the '~' character seems to be a perl5 '.'
01:58 cj s/character/operator/
02:03 spinclad that it is, yes
02:44 cj so is that perl6?
02:54 cj is there a p6 template lib yet?
03:00 cj sprintf'll do
03:03 cj i'll need a file open/read/close interface as well
03:07 diakopter cj: re kp6 IL emitter?  which IL?  MSIL?
03:07 cj mono
03:08 cj ms would be an added bonus
03:11 cj alright... I'll go look for those...
03:12 cj if the p5 code could be moved to an external template file, it would be easy to inherit from the p5 emitter class to implement other back ends
03:20 cj how does one get $'s class name?
03:22 cj you folks are always so chatty when I'm not asking questions :)
03:37 [particle] joined #perl6
03:42 BinGOs joined #perl6
03:42 cj http://wp.colliertech.org/cj/?p=171
03:42 lambdabot Title: The Pædantic Programmer � Blog Archive � Lang.NET 2008
03:49 * cj waits around for fglock
03:57 * jrockway guesses "ref"
03:58 Auzon maybe $.class?
03:58 Auzon pugs: $.class
03:58 exp_evalbot OUTPUT[*** Undeclared variable: ("$__SELF__",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0xb689d68c>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0xb67de8a0>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:0xb689eb20>,
03:58 exp_evalbot ..pe_flags = MkEntryFlags {ef_isContext = False}, pe_st...
03:58 Auzon :P
03:58 Auzon I think that is right
03:59 Auzon pugs: $.qwetrt
03:59 exp_evalbot OUTPUT[*** Undeclared variable: ("$__SELF__",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0xb689d320>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0xb67de688>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:0xb689e7ac>,
03:59 exp_evalbot ..pe_flags = MkEntryFlags {ef_isContext = False}, pe_st...
03:59 Auzon Hm. Maybe.
03:59 [particle1 joined #perl6
04:15 cj pugs: $.name
04:15 exp_evalbot OUTPUT[*** Undeclared variable: ("$__SELF__",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0xb6899d90>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0xb68aa42c>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:0xb689922c>,
04:15 exp_evalbot ..pe_flags = MkEntryFlags {ef_isContext = False}, pe_st...
04:15 Auzon cj: There's no $__SELF__ so it won't work. We need to be in an object or something to make it happen.
04:25 cj Auzon: ah.  what's the minimum required to define a class?
04:25 Auzon I dunno. Let's see...
04:25 Auzon pugs: class FooBar {}
04:25 exp_evalbot RESULT[undef]
04:26 Auzon pugs: class Foo {}  my $item = Foo.new();
04:26 exp_evalbot RESULT[\Foo.new()]
04:27 Auzon pugs: class Foo {method dwim() {say $.class;}}  my $item = Foo.new(); $item.dwim();
04:27 exp_evalbot OUTPUT[*** No such method in class Foo: "&class"␤    at /tmp/eZNZ3gZhaQ line 1, column 31-38␤]
04:27 Auzon pugs: class Foo {method dwim() {say $.name;}}  my $item = Foo.new(); $item.dwim();
04:27 exp_evalbot OUTPUT[*** No such method in class Foo: "&name"␤    at /tmp/PYPNrHAdsp line 1, column 31-37␤]
04:27 Auzon pugs: class Foo {method dwim() {say $.isa;}}  my $item = Foo.new(); $item.dwim();
04:27 exp_evalbot OUTPUT[*** No compatible multi variant found: "&isa"␤    at /tmp/vcuzsQofOA line 1, column 31-36␤]
04:28 Auzon pugs: class Foo {method dwim() {say $.WHAT;}}  my $item = Foo.new(); $item.dwim();
04:28 exp_evalbot OUTPUT[Foo␤]
04:28 Auzon There you go. $.WHAT
04:28 spinclad pugs: class Foo {method dwim() {say $.WHAT;}}  my $item = Foo.new(); $item.WHAT
04:28 exp_evalbot RESULT[::Foo]
04:29 spinclad pugs: class Foo {method dwim() {say $.WHAT;}}  my $item = Foo.new(); $item.HOW
04:29 exp_evalbot RESULT[\Class.new(("attrs" => {}), ("does" => ()), ("is" => ("Object",)), ("name" => "Foo"))]
04:29 spinclad pugs: class Foo {method dwim() {say $.WHAT;}}  my $item = Foo.new(); $item.HOW.name
04:29 exp_evalbot RESULT["Foo"]
04:30 Auzon Which way is "correct"?
04:30 spinclad pugs: class Foo {}  my $item = Foo.new(); $item.HOW.name
04:30 exp_evalbot RESULT["Foo"]
04:30 spinclad What is one trying to do?
04:30 Auzon Ask cj
04:30 Auzon "how does one get $'s class name?"
04:31 spinclad $item.HOW.name seemed to do that
04:32 Auzon pugs: class Foo {method dwim() {say $.WHAT;}}  my $item = Foo.new(); $item.WHAT
04:32 exp_evalbot RESULT[::Foo]
04:32 Auzon hm
04:32 Auzon ok
04:33 spinclad at least the .HOW part is given in the synopses; S02 and S12
04:34 spinclad pugs: class Foo {method dwim() {say $.HOW;}}  my $item = Foo.new(); $item.dwim()
04:34 exp_evalbot OUTPUT[<obj:Class>␤]
04:34 thestarslookdown joined #perl6
04:34 spinclad pugs: class Foo {method dwim() {say $.HOW.name;}}  my $item = Foo.new(); $item.dwim()
04:34 exp_evalbot OUTPUT[Foo␤]
04:35 spinclad but the dwim method is extra
04:36 Auzon pugs: class Foo {}  my $item = Foo.new(); say $item.WHAT
04:36 exp_evalbot OUTPUT[Foo␤]
04:36 Auzon Aha
04:36 Auzon So $item.WHAT stringifies (if that's the right term) to the class name
04:36 spinclad right
04:37 Auzon Oh. Duh, because ::Foo means Main::Foo
04:37 Auzon pugs: class Foo {}  my $item = Foo.new(); $item.WHAT === Main::Foo
04:37 exp_evalbot OUTPUT[*** No such subroutine: "&Main::Foo"␤    at /tmp/Q3C18gn8PY line 1, column 37 - line 2, column 1␤]
04:37 spinclad class Foo {}  my $item = Foo.new(); $item.WHAT === $Main::Foo
04:38 spinclad pugs: class Foo {}  my $item = Foo.new(); $item.WHAT === $Main::Foo
04:38 exp_evalbot RESULT[Bool::False]
04:38 Auzon But I think that means: $item.WHAT === $Foo
04:38 spinclad pugs: class Foo {}  my $item = Foo.new(); $item.WHAT === ::Foo
04:38 exp_evalbot RESULT[Bool::True]
04:39 spinclad pugs: class Foo {}  my $item = Foo.new(); $item.WHAT === *::Foo
04:39 exp_evalbot OUTPUT[*** ␤    Unexpected ":Foo"␤    expecting term postfix or operator␤    at /tmp/Iqj3s7H1jb line 1, column 54␤]
04:39 spinclad ::Foo is in the root package, not Main, i think
04:40 Auzon Is the main package simply :: in Perl 6?
04:40 spinclad yes
04:40 spinclad seems so
04:40 Auzon or an empty string, I would say, cause :: is a separator
04:44 spinclad no, * is the global package; ::Foo is searching lexically outward for Foo; *::Foo looks directly in GLOBAL
04:44 spinclad S02:1639
04:44 Auzon Aha.
04:45 cj so $.WHAT ?
04:45 cj should return ::Foo for class Foo?
04:46 Auzon Yes.
04:46 spinclad or Foo, depending i guess on whether Foo is in scope
04:46 Auzon well, you should be able to do this...
04:47 Auzon pugs: class Foo {}  my $item = Foo.new(); my $second = $item.WHAT.new();
04:47 exp_evalbot RESULT[\Foo.new()]
04:48 spinclad pugs: class Foo {}  my $item = Foo.new(); my $second = $item.HOW.new();
04:48 exp_evalbot RESULT[\Foo.new()]
04:49 spinclad .HOW is the class, .WHAT is its name
04:50 spinclad pugs: class Foo {}  Foo.new();
04:50 exp_evalbot RESULT[Foo.new()]
04:51 spinclad pugs: class Foo {}  my $first = Foo.new();
04:51 exp_evalbot RESULT[\Foo.new()]
04:51 spinclad i'm actually surprised that .WHAT.new() worked.
04:53 spinclad pugs: class Foo {}  my $item = Foo.new(); $item.WHAT === Foo
04:53 exp_evalbot RESULT[Bool::True]
04:53 Auzon Well, if .WHAT returns the class name, it's no different from "$namething".new() if $namething is Foo
04:53 Auzon That's how I see it, at least
04:54 Auzon pugs: class Foo {}  my $classname = "Foo"; "$classname".new()
04:54 exp_evalbot RESULT[Str.new()]
04:55 Auzon pugs: class Foo {}  my $classname = "Foo"; $classname.new()
04:55 exp_evalbot RESULT[Str.new()]
04:55 Auzon hm
04:55 Auzon ^_^'
04:55 spinclad S12:1816: WHAT is the type's prototype object, HOW is its metaclass object
04:56 spinclad pugs: class Foo {}  Foo.WHAT === Foo.HOW
04:56 exp_evalbot RESULT[Bool::False]
04:56 spinclad pugs: class Foo {}  my $foo = Foo.new(); $foo.WHAT === $foo.HOW
04:56 exp_evalbot RESULT[Bool::False]
04:56 Auzon pugs: class Foo {}  my $classname = Foo; $classname.new()
04:56 exp_evalbot RESULT[Foo.new()]
04:56 Auzon pugs: class Foo {}  my $classname = 'Foo'; '$classname'.new()
04:57 exp_evalbot RESULT[Str.new()]
04:57 spinclad pugs: class Foo {}  my $foo = Foo.new(); $foo.WHAT === Foo
04:57 exp_evalbot RESULT[Bool::True]
04:57 Auzon So how can you create an object from a class depending on the string?
04:59 cj pugs: class Foo {}  my $item = Foo.new(); $item.WHAT;
04:59 exp_evalbot RESULT[::Foo]
04:59 spinclad look the string up in the class's package; that gets you the class...
05:00 cj pugs: class Foo {}  my $item = Foo.new(); Str.new($item.WHAT);
05:00 exp_evalbot OUTPUT[*** Must only use named arguments to new() constructor␤    Be sure to use bareword keys.␤    at /tmp/je31OguDub line 1, column 37-56␤]
05:00 Auzon pugs: class Foo {}  my $classname = '::Foo'; '$classname'.new()
05:00 exp_evalbot RESULT[Str.new()]
05:00 Auzon pugs: class Foo {}  my $classname = '::Foo'; ::'$classname'.new()
05:00 exp_evalbot OUTPUT[*** ␤    Unexpected "'$"␤    expecting "(", twigil or word character␤    at /tmp/loCUMcKGww line 1, column 42␤]
05:00 Auzon pugs: class Foo {}  my $classname = '::Foo'; ::$classname.new()
05:00 exp_evalbot OUTPUT[*** ␤    Unexpected "$classname"␤    expecting "(", twigil or word character␤    at /tmp/VPTh5ccQDq line 1, column 42␤]
05:01 Auzon oh well
05:01 spinclad pugs: class Foo {}  ::('Foo').new()
05:01 exp_evalbot RESULT[Foo.new()]
05:01 cj pugs: class Foo {}  my $item = Foo.new(); my $classname = $item.WHAT; $classname;
05:01 exp_evalbot RESULT[\::Foo]
05:02 cj pugs: class Foo {}  my $item = Foo.new(); my $classname = "" ~ $item.WHAT ~ ""; $classname;
05:02 exp_evalbot RESULT[\"Foo"]
05:02 spinclad pugs: class Foo {}  my $item = Foo.new(); my $classname = $item.WHAT; $classname.WHAT
05:02 exp_evalbot RESULT[::Foo]
05:02 cj aha.
05:02 cj pugs: class Foo {}  my $item = Foo.new(); my $classname = "" ~ $item.WHAT; $classname;
05:02 exp_evalbot RESULT[\"Foo"]
05:02 cj so $classname stores a reference to a string "Foo"?
05:03 spinclad pugs: class Foo {}  my $item = Foo.new(); ~$item.WHAT
05:03 exp_evalbot RESULT["Foo"]
05:03 spinclad pugs: class Foo {}  my $item = Foo.new(); (~$item.WHAT).WHAT
05:03 exp_evalbot RESULT[::Str]
05:03 spinclad ~ stringifies
05:04 spinclad so yes
05:04 Auzon pugs: die
05:04 exp_evalbot OUTPUT[*** Died␤    at /tmp/CFKSI9I0jz line 1, column 1 - line 2, column 1␤]
05:04 spinclad hey!
05:04 Auzon Awfully fast for spawning an interpreter
05:05 spinclad pugs: 1
05:05 exp_evalbot RESULT[1]
05:05 Auzon I wanted to know if it was an eval or what
05:06 Auzon rakudo: class Foo {} Foo.new()
05:06 exp_evalbot OUTPUT[Statement not terminated properly at line 1, near "Foo.new()"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;statementlist' pc 14830 (src/gen_grammar.pir:2402)␤called from Sub
05:06 exp_evalbot ..'parrot;Perl6::Grammar;statement_block' pc 12017 (src/gen_grammar.pir:1396)␤called fr...
05:06 Auzon rakudo: class Foo {} Foo.new();
05:06 exp_evalbot OUTPUT[Statement not terminated properly at line 1, near "Foo.new();"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;statementlist' pc 14830 (src/gen_grammar.pir:2402)␤called from Sub
05:06 exp_evalbot ..'parrot;Perl6::Grammar;statement_block' pc 12017 (src/gen_grammar.pir:1396)␤called f...
05:06 Auzon rakudo: class Foo {}; Foo.new();
05:06 exp_evalbot OUTPUT[get_bool() not implemented in class 'Foo'␤current instr.: 'parrot;PCT::HLLCompiler;command_line' pc 1273 (src/PCT/HLLCompiler.pir:685)␤called from Sub 'parrot;Perl6::Compiler;main' pc 7241 (perl6.pir:155)␤]
05:07 spinclad rakudo: class Foo {}; Foo;
05:07 exp_evalbot OUTPUT[get_bool() not implemented in class ''␤current instr.: 'parrot;PCT::HLLCompiler;command_line' pc 1273 (src/PCT/HLLCompiler.pir:685)␤called from Sub 'parrot;Perl6::Compiler;main' pc 7241 (perl6.pir:155)␤]
05:07 spinclad rakudo: class Foo {}
05:07 exp_evalbot RESULT[Null PMC access in find_method()␤current instr.: '_block10' pc 19 (EVAL_10:10)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 789 (src/PCT/HLLCompiler.pir:459)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1059 (src/PCT/HLLCompiler.pir:585)␤called from Sub
05:07 exp_evalbot ..'parrot;PCT::HLLCompiler;command_line' pc 1242 (src/PCT/HLLCompiler.pir...
05:07 Auzon heh.
05:11 Auzon pugs: class Foo {}; Foo.new.perl
05:12 exp_evalbot RESULT["Foo.new()"]
05:12 Auzon pugs: class Foo {}; Foo.new
05:12 exp_evalbot RESULT[Foo.new()]
05:12 Auzon pugs: class Foo {}; Foo.new()
05:12 exp_evalbot RESULT[Foo.new()]
05:26 lisppaste3 joined #perl6
05:39 manfred joined #perl6
05:43 cj pugs: class Foo {}  my $item = Foo.new(); $item.WHAT.perl;
05:43 exp_evalbot RESULT["::Foo"]
05:43 cj pugs: class Foo {}  my $item = Foo.new(); "" ~ $item.WHAT
05:43 exp_evalbot RESULT["Foo"]
05:43 cj I think that's what I want
05:43 Auzon You can just use it in a string context
05:44 Auzon pugs: class Foo {}; my $item = Foo.new(); print $item
05:44 exp_evalbot OUTPUT[<obj:Foo>]
05:44 Auzon pugs: class Foo {}; my $item = Foo.new(); say $item
05:44 exp_evalbot OUTPUT[<obj:Foo>␤]
05:44 Auzon pugs: class Foo {}; my $item = Foo.new();  $item.WHAT
05:44 exp_evalbot RESULT[::Foo]
05:44 Auzon pugs: class Foo {}; my $item = Foo.new();  ~$item.WHAT
05:44 exp_evalbot RESULT["Foo"]
05:44 Auzon pugs: class Foo {}; my $item = Foo.new();  say $item.WHAT
05:44 exp_evalbot OUTPUT[Foo␤]
05:45 cj "" ~ $item.WHAT seems hacky...
05:45 Auzon Just use ~ $item.WHAT
05:45 Auzon It's like Perl 5's scalar
05:45 Auzon well, kind of
05:45 cj pugs: class Foo {}  my $item = Foo.new(); ~ $item.WHAT
05:45 exp_evalbot RESULT["Foo"]
05:45 cj nice
05:45 Auzon pugs: ~15
05:46 exp_evalbot RESULT["15"]
05:46 Auzon pugs ~*
05:46 Auzon pugs: ~*
05:46 exp_evalbot RESULT["Inf"]
05:46 Auzon pugs: *
05:46 exp_evalbot RESULT[Inf]
05:46 TimToady that's not actually correct
05:46 Auzon Which part?
05:46 TimToady the Inf part
05:46 TimToady it should return Whatever
05:46 Auzon I suspected as much
05:47 TimToady and that is the type you match it with in a signature
05:47 Auzon pugs: +"a5"
05:47 exp_evalbot RESULT[0.0]
05:47 Auzon pugs: +"5"
05:47 exp_evalbot RESULT[5.0]
05:47 Auzon pugs: +"5".WHAT
05:47 exp_evalbot RESULT[0]
05:47 Auzon pugs: +("5").WHAT
05:47 exp_evalbot RESULT[0]
05:47 TimToady precedence
05:47 Auzon pugs: (+"5").WHAT
05:47 exp_evalbot RESULT[::Num]
05:47 Auzon There we go
05:48 cj TimToady: o/
05:49 cj TimToady: I'm going to the evil empire on monday to discuss p6 on .net
05:49 TimToady I have a nephew and a son-in-law who work for them, so it's not all that bad...
05:51 TimToady what do you want to tell them about p6?
05:58 cj http://wp.colliertech.org/cj/?p=171
05:58 lambdabot Title: The Pædantic Programmer � Blog Archive � Lang.NET 2008
05:58 cj TimToady: I know it's not all bad.  I have many friends who work there, and my wife worked there for over 7 years.  I say "evil empire" with tongue planted firmly in cheek.
06:00 cj TimToady: I don't necessarily want to tell anyone anything about p6.  I intend to look for support getting a CLI implementation bootstrapped.
06:00 cj the kp6 p5 emitter looks like it will be quite useful with small modifications.
06:01 cj the continuation problem is a sticky point, but it should be possible to get around it with some creative thinking :)
06:02 cj honestly, I don't know the p6 language well enough to talk about it at length.  I just know that I like p5, and I expect a lot of folks will want to migrate.  I like the C# language and the .NET infrastructure in general, so it would be nice if p6 could interoperate with little effort.
06:03 TimToady okay, well, have the appropriate amount of fun :)
06:04 TimToady me, I've been up since 5:00am, so my idea of fun involves a pillow
06:04 TimToady zzz &
06:31 jrockway cj: interesting blog post, also interesting to see
06:32 jrockway it seems that parrot has left a bad taste in the mouths of CLR and JVM developers wrt perl6
06:32 jrockway "they're writing their own VM, ours are *so much better*, so let's ignore perl6"
06:32 jrockway so it's good to see someone from .NET or whatever interested in perl6
06:32 jrockway very good in fact :)
06:50 cj woot :)
06:53 jjore joined #perl6
06:58 drrho joined #perl6
07:07 devogon joined #perl6
07:48 iblechbot joined #perl6
07:54 cj you hear that, TimToady?  I'm someone from .NET :)
08:11 iblechbot joined #perl6
08:42 jferrero joined #perl6
08:44 rho joined #perl6
08:47 kst joined #perl6
08:51 BinGOs joined #perl6
09:32 kanru joined #perl6
09:49 chris2 joined #perl6
10:18 BinGOs_ joined #perl6
10:51 zamolxes joined #perl6
11:00 cosimo_ joined #perl6
11:07 meppuru joined #perl6
11:07 poletti joined #perl6
11:26 cosimo_ left #perl6
11:32 poletti joined #perl6
11:34 cosimo_ joined #perl6
12:23 zf8 joined #perl6
12:23 zf8 left #perl6
12:26 barney joined #perl6
13:26 chris2 joined #perl6
13:26 nothingmuch joined #perl6
13:45 blindfish joined #perl6
13:47 cosimo_ left #perl6
14:09 poletti joined #perl6
14:19 snearch joined #perl6
14:22 __Ace__ joined #perl6
14:34 ludan joined #perl6
14:35 ludan hi
14:39 moritz_ hi ludan
14:49 zf8 joined #perl6
14:49 zf8 left #perl6
15:20 meppel-san joined #perl6
15:22 Psyche^ joined #perl6
16:01 Aankhen`` joined #perl6
16:36 sri_work joined #perl6
16:44 Limbic_Region joined #perl6
16:45 jhorwitz joined #perl6
16:51 Psyche^ joined #perl6
16:57 PerlJam joined #perl6
17:06 kanru joined #perl6
17:23 thoughtpolice joined #perl6
17:26 poletti joined #perl6
17:28 njbartlett joined #perl6
17:37 poletti joined #perl6
17:43 riffraff joined #perl6
17:44 MrKrueger joined #perl6
17:44 riffraff hi
17:47 cognominal_ joined #perl6
18:01 poletti joined #perl6
18:04 IRSeekBot joined #perl6
18:09 alester joined #perl6
18:32 nothingmuch joined #perl6
18:42 marmic joined #perl6
19:10 Auzon pugs: ^Z
19:10 exp_evalbot OUTPUT[*** No such subroutine: "&Z"␤    at /tmp/n5OA2zNGde line 1, column 1 - line 2, column 1␤]
19:10 Auzon pugs: ^'z'
19:10 exp_evalbot RESULT[()]
19:10 Auzon pugs: 'a' .. ^'z'
19:10 exp_evalbot RESULT[()]
19:10 Auzon pugs: 'a' .. 'z'
19:10 exp_evalbot RESULT[("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")]
19:10 Auzon pugs: 'A' .. 'z'
19:10 exp_evalbot RESULT[("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")]
19:10 Auzon pugs: 'a' .. 'Z'
19:10 exp_evalbot RESULT[()]
19:10 Auzon Perplexing. O.o
19:14 pugs_svn r19709 | cosimo++ | [t] fixed S29-trig/e.t syntax errors
19:36 JarJarBinks joined #perl6
19:40 cj Auzon: 'a' is asciibetically superior to 'Z'
19:41 Auzon pugs: say for ord('a'), ord('A'), ord('z'), ord('Z')
19:41 exp_evalbot OUTPUT[␤␤␤␤]
19:41 Auzon pugs: say ord('a'), ord('A'), ord('z'), ord('Z')
19:41 exp_evalbot OUTPUT[976512290␤]
19:41 poletti joined #perl6
19:42 Auzon pugs: say join "\n", ord('a'), ord('A'), ord('z'), ord('Z')
19:42 exp_evalbot OUTPUT[97␤65␤122␤90␤]
19:42 Auzon still seems odd that 'A' .. 'z' means 'A' .. 'Z'
19:42 Auzon where 'a' .. 'Z' means nothing
19:46 cj Auzon: it's likely a case-insensitive match
19:46 cj probably wrong
19:50 allbery_b weren't ranges specified with some dwimmery (at least at some point) due to the memory of what e.g. EBCDIC did with the alphabet?
19:50 cj allbery_b: I hadn't heard about that.  do you remember where you heard that vicious rumor?
19:51 allbery_b pugs is still doing the wrong thing but I can see that from a buggy attempt)
19:51 allbery_b point being that A..Z is not contiguous in EBCDIC and there are special characters interspersed, but when someone says A..Z they probably mean only letters
19:54 cj allbery_b: have you written a test case bringing this problem to light? :)
19:54 allbery_b I'm still poking at specs to see where I encountered that (might have been an apocalypse but since determined to be a bad idea, or something)
19:58 allbery_b nothing explicit as yet but look at the alpha example for endpoint * in http://perlcabal.org/syn/S03.html#Range_semantics
19:58 lambdabot Title: S03
20:02 alester joined #perl6
20:06 allbery_b I think that was where I got the idea of DWIMmy ranges.  probably need TimToady to confirm/deny
20:07 allbery_b in any case even if it's dwimmy, pugs isn't dwimming right
20:24 thoughtpolice joined #perl6
20:27 pugs_svn r19710 | particle++ | [fudge] added 'is_approx' and removed tabs
20:30 pugs_svn r19711 | particle++ | [rakudo] while/until statements now parse
20:30 Auzon rakudo: my $i = 0; while($i < 5) {say $i; $i++}
20:30 exp_evalbot OUTPUT[0␤1␤2␤3␤4␤]
20:31 Auzon rakudo: for (0 .. 5) {.say}
20:31 exp_evalbot OUTPUT[Missing '}' at line 1, near ".say}"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;block' pc 13244 (src/gen_grammar.pir:1850)␤called from Sub 'parrot;Perl6::Grammar;pblock' pc 12919
20:31 exp_evalbot ..(src/gen_grammar.pir:1722)␤called from Sub 'parrot;Perl6::Grammar;for_statement...
20:31 Auzon rakudo: for (0 .. 5) {say $_}
20:31 exp_evalbot OUTPUT[0␤1␤2␤3␤4␤5␤]
20:31 moritz_ rakudo: for (0 .. 5) { $_.say }
20:31 exp_evalbot OUTPUT[Method 'say' not found for invocant of class 'Float'␤current instr.: '_block19' pc 65 (EVAL_10:33)␤called from Sub '_block10' pc 39 (EVAL_10:16)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 789 (src/PCT/HLLCompiler.pir:459)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1059
20:31 exp_evalbot ..(src/PCT/HLLCompiler.pir:585)␤called from Sub 'parr...
20:31 moritz_ rakudo: for (0 .. 5) -> $a { say $a  }
20:31 exp_evalbot OUTPUT[0␤1␤2␤3␤4␤5␤]
20:32 moritz_ fascinating ;)
20:32 Auzon Are we Turing Complete yet? :P
20:33 moritz_ I guess ;)
20:33 moritz_ you don't need very much for turing completeness
20:33 moritz_ arrays, while and if are enough
20:33 Auzon No, you sure don't.
20:33 pugs_svn r19712 | particle++ | [rakudo] add directives to S29-num/ and convert pod to pod6
20:40 lidden joined #perl6
20:43 lidden joined #perl6
20:53 cosimo_ joined #perl6
20:58 poletti joined #perl6
21:16 meppl joined #perl6
21:19 [particle1 joined #perl6
21:39 cj pugs: class Foo::Bar {}  my $item = Foo::Bar.new(); ~ $item.WHAT
21:39 exp_evalbot RESULT["Foo::Bar"]
21:40 cj yay.
21:40 cj that's what I was hoping you'd say.
21:41 cj is there something analagous to C#'s "property"?  ie, an easy syntax to define set/get handler?
21:41 Auzon pugs: class Foo {has $y} my $thing = Foo.new; Foo.y = 5; say Foo.y
21:41 exp_evalbot OUTPUT[*** No such method in class Foo: "&y"␤    at /tmp/HZcELNMgUz line 1, column 41-50␤]
21:42 cj Class Foo { int i; int I { set { i = value; } get { return i } } }
21:42 cj something like that
21:42 cosimo_ left #perl6
21:42 moritz_ pugs: class Foo { has $.x is rw; \}; my $a = Foo.new; $a.x = 4 ; say $a.perl
21:42 exp_evalbot OUTPUT[*** ␤    Unexpected "};"␤    at /tmp/vwMm31b2mW line 1, column 29␤]
21:42 Auzon pugs: class Foo { has $.x is rw; }; my $a = Foo.new; $a.x = 4 ; say $a.perl
21:42 exp_evalbot OUTPUT[\Foo.new(("x" => 4),)␤]
21:43 moritz_ a \ too much ;)
21:43 moritz_ if an object variable has the . twigil ($.scalar, @.list) it has a getter by default
21:44 moritz_ and the "is rw" defines a setter
21:45 moritz_ S12 is your reference
21:45 moritz_ (pugs doesn't implement access control yet)
22:13 cj moritz_: is it possible to define ones own setter?
22:13 moritz_ cj: yes
22:29 TimToady pugs: 'A' .. '~'
22:29 exp_evalbot RESULT[("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")]
22:30 TimToady what's going on there is Z increments to AA, which is longer than the final string, so it quits
22:31 moritz_ and what should happen?
22:31 allbery_b S3 implies but doesn't explicitly say that range is dwimmy / uses magic increment
22:31 allbery_b someone questioned my comment on that earlier
22:32 allbery_b [14:50] <cj> allbery_b: I hadn't heard about that.  do you remember where you heard that vicious rumor?
22:33 TimToady sure, it uses magic autoincrement, but it also has to decide when to quit when the final value isn't in the natural sequence that will be produced
22:33 TimToady and then it just uses overflowing the length, just like Perl 5
22:41 cj moritz_: what does that look like?  Moose?
22:42 cj TimToady: is it broken that 'A' .. 'z' only goes from 'A' to 'Z'?
22:42 cj pugs: 'A' .. 'z'
22:42 exp_evalbot RESULT[("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")]
22:43 moritz_ cj: I don't know exactly.. you can just define a method that sets the value
22:44 moritz_ cj: if you want lvalue methods, you have to mess with rw proxies (or... something else? dunno)
22:49 TimToady no, it is not broken
22:50 TimToady it quits after Z for the same reason that this does:
22:50 TimToady pugs: 'A'..'_'
22:50 exp_evalbot RESULT[("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")]
22:51 Torment joined #perl6
22:51 mugwump joined #perl6
22:52 TimToady pugs: '00'..'zz'
22:52 exp_evalbot RESULT[("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47",
22:52 exp_evalbot .."48", "49", "50", "51", "52", "53", "54", "55", "56...
22:52 mugwump hey quick one, what's the name of those stack-local variables?
22:52 mugwump context variables innit?
22:52 TimToady yes
22:52 TimToady lexicals in the outer dynamic scope
22:52 TimToady pugs: ('00'..'zz').elems
22:53 exp_evalbot RESULT[100]
22:53 mugwump thanks :)
22:54 pugs_svn r19713 | particle++ | [rakudo] add directives to S29-num tests
22:56 cj TimToady: hurm.. what is that reason?  It's not entirely clear to me.
22:58 TimToady I already said it twice
22:59 TimToady see also the change I just checked in to S03
22:59 pugs_svn r19714 | particle++ | [rakudo] convert to pod6 and make hash init easier to parse
23:02 TimToady pugs: my $x = "Z"; $x++; say $x
23:02 exp_evalbot OUTPUT[AA␤]
23:02 moritz_ pugs: my $x = "AA"; $x--; say $x
23:02 exp_evalbot OUTPUT[-1␤]
23:03 TimToady pugs doesn't do magical decrement
23:03 TimToady please note that incrementing 'Z' does *not* produce 'a'
23:05 TimToady so 'A'..'z' can never reach 'z'
23:18 allbery_b I think he's asking the rationale for ranges using magic autoincrement
23:19 TimToady he's a p5 programmer; he should already be familiar with that...
23:20 BinGOs_ joined #perl6
23:30 TimToady @tell Auzon you can't say 'A' .. ^'Z'; it has to be 'A' ..^ 'Z' to keep ..^ as one token
23:30 lambdabot Consider it noted.
23:41 nothingmuch http://www.swa.hpi.uni-potsdam.de/s3/
23:41 lambdabot Title: Self-sustaining Systems 2008 (HPI)
23:50 mncharity joined #perl6
23:56 jferrero joined #perl6
23:59 pugs_svn r19715 | rhr++ | [Unicode.pm] Grapheme: IDs use NFC
23:59 pugs_svn r19715 | rhr++ | guess at how nf and encoding modules work
23:59 pugs_svn r19715 | rhr++ | start to define bytes/codepoints/graphemes modules
23:59 pugs_svn r19715 | rhr++ | samebase needs to use NFD (will need to be fixed again when other NF stuff is fixed)

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

Perl 6 | Reference Documentation | Rakudo