|
»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! | Rakudo Star Released! Set by moderator on 4 August 2010. |
|||
|
00:02
ruoso joined
|
|||
| pugssvn | r31947 | tcurtis++ | Replace cp -a with cp -pR for the sake of non-Linux-users. | 00:09 | |
| sorear | rakudo: say (:a :b).perl | 00:15 | |
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22» | ||
| sorear | std: say (:a :b).perl | ||
| p6eval | std 31912: OUTPUT«ok 00:01 113m» | ||
|
00:36
Holy_Cow joined
|
|||
| patch | greeting from boston.pm! | 00:37 | |
| hercynium | GO 'WAY! | ||
| patch | rakudo: say [+] ^10 | 00:38 | |
| p6eval | rakudo fcf4f3: OUTPUT«45» | ||
| patch | star: (<a b c> Z=> 1..3).perl.say | 00:40 | |
| p6eval | star 2010.07: OUTPUT«("a" => 1, "b" => 2, "c" => 3)» | ||
| PerlJam | rakudo is now "featured" on github.com (probably old news, but I thought I'd mention it anyway) | 00:41 | |
|
00:41
cono joined
|
|||
| sorear | yeah ever since star | 00:41 | |
| I wonder if it's a statistical thing | |||
| some of the github guys are perl folk | |||
| PerlJam | It wasn't featured yesterday (or at least I didn't see it) | ||
|
00:43
kid51 joined,
BillN1VUX joined
|
|||
| BillN1VUX | sorear: one of the github guys is visiting Boston.pm. patch just did demo on projector. | 00:44 | |
|
00:44
tylerni7 joined
|
|||
| hercynium | rakudo: say "You can pick your $_" for <friends clothes home nose>.pick(*) | 00:45 | |
| p6eval | rakudo fcf4f3: OUTPUT«You can pick your homeYou can pick your friendsYou can pick your noseYou can pick your clothes» | ||
| hercynium just felt inspired | |||
| BillN1VUX | sorear: Chacon featured the project when he saw talk at yapc::eu | 00:46 | |
|
00:49
dduncan joined,
dduncan left
|
|||
| BillN1VUX | then he flew straight to LinuxCon ... and dropped in on Boston.pm and patch's Acmeist p6 impl talk | 00:50 | |
| sorear | patch is implementing p6 too? | 00:56 | |
| BillN1VUX | sorear - patch is doing p6 impl of acmeist modules. | 00:58 | |
| not p6 itself | |||
| patch | rakudo: ( 8, * + 8 ... 64 ).perl.say | ||
| p6eval | rakudo fcf4f3: OUTPUT«(8, 16, 24, 32, 40, 48, 56, 64)» | ||
| tylercurtis | rakudo: (8, 16 ... 64).perl.say | 00:59 | |
| p6eval | rakudo fcf4f3: OUTPUT«(8, 16, 24, 32, 40, 48, 56, 64)» | ||
| hercynium | rakudo: say "You can pick your $_" for <friends clothes home nose>.pick(6) | 01:00 | |
| p6eval | rakudo fcf4f3: OUTPUT«You can pick your homeYou can pick your friendsYou can pick your clothesYou can pick your nose» | ||
| hercynium | rakudo: say "You can pick your $_" for <friends clothes home nose>.pick() | ||
| p6eval | rakudo fcf4f3: OUTPUT«You can pick your clothes» | ||
| hercynium | rakudo: say "You can pick your $_" for <friends clothes home nose>.pick(6, :replace) | ||
| p6eval | rakudo fcf4f3: OUTPUT«You can pick your homeYou can pick your homeYou can pick your homeYou can pick your clothesYou can pick your noseYou can pick your clothes» | 01:01 | |
| hercynium | rakudo: say "You can pick your $_" for <friends clothes home nose>.pick(6, replace => 1) | ||
| p6eval | rakudo fcf4f3: OUTPUT«You can pick your friendsYou can pick your noseYou can pick your homeYou can pick your homeYou can pick your noseYou can pick your friends» | 01:02 | |
|
01:08
ghyspran joined
|
|||
| dukeleto | Is there a Debian package for Rakudo* ? | 01:08 | |
|
01:09
masonkramer joined
01:11
cono joined
01:16
plobsing joined
01:22
[Coke] joined
|
|||
| tylercurtis | std: my regex foo ($s) { $s }; say 'a' ~~ / <&foo('a') > / | 01:36 | |
| p6eval | std 31912: OUTPUT«ok 00:01 124m» | ||
| tylercurtis | rakudo: my regex foo ($s) { $s }; say 'a' ~~ / <&foo('a') > / | ||
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===regex assertion not terminated by angle bracket at line 22, near "('a') > /"» | ||
| tylercurtis | Is this a case of NYI or a bug in my code? | 01:38 | |
|
01:39
spinclad joined
01:43
BillN1VUX joined
|
|||
| sorear | tylercurtis: Looks line NYI | 01:44 | |
| tylercurtis | sorear: alright. Can grammars have attributes? | 01:50 | |
| rakudo: grammar Fish { has $.species = 'salmon'; token TOP { $.species } }; Fish.parse('salmon').say; | 01:51 | ||
| p6eval | rakudo fcf4f3: OUTPUT«» | ||
| pmichaud | note that the type object won't have an initialized attribute. | ||
| rakudo: grammar Fish { our $species = 'salmon'; token TOP { $species } }; Fish.parse('salmon').say; | 01:52 | ||
| p6eval | rakudo fcf4f3: OUTPUT«salmon» | ||
| pmichaud | \\o/ | ||
| although it's arguable that when Fish creates an internal cursor that cursor should have the attribute | |||
| tylercurtis | rakudo: grammar Fish { has $.species = 'salmon'; token TOP { $.species } }; Fish.new.parse('salmon').say; | ||
| p6eval | rakudo fcf4f3: OUTPUT«» | 01:53 | |
| pmichaud | so I'd call that a rakudo bug. | ||
| not sure it's going to be fixed anytime soon, though. | |||
| tylercurtis | Alright. I will use an our variable, then. | 01:54 | |
| pmichaud | a my variable will work also. | ||
| oh, maybe not. | |||
| but why use a variable in the first place? How would it get set? | |||
| NQP knows how to do parameters on regexes, so it shouldn't be hard to add it for rakudo (if it's not really there) | 01:56 | ||
| tylercurtis | pmichaud: I'm attempting to write a YAML parser, and <foo('bar')> doesn't appear to work (actually, I did only check <&foo('bar')> so I should probably check <foo('bar')>), so I'm going to keep track of the indentation with an $INDENT variable. | 01:57 | |
| pmichaud | rakudo: my regex foo($s) { ... }; | 01:58 | |
| p6eval | rakudo fcf4f3: ( no output ) | ||
| pmichaud | rakudo: my regex foo($s) { $s }; | ||
| p6eval | rakudo fcf4f3: ( no output ) | ||
| tylercurtis | rakudo: grammar Some { token matchthis ($s) { $s }; token TOP { <matchthis('thing')> } }; Some.parse('thing').say; | ||
| p6eval | rakudo fcf4f3: OUTPUT«thing» | ||
| tylercurtis | That works. :) | ||
| pmichaud | rakudo: my regex foo($s) { $s }; say 'a' ~~ / <&foo('a')> / | ||
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===regex assertion not terminated by angle bracket at line 22, near "('a')> /"» | ||
| pmichaud | rakudo: my regex foo($s) { $s }; say 'a' ~~ / <foo('a')> / | ||
| p6eval | rakudo fcf4f3: OUTPUT«Method 'foo' not found for invocant of class 'Cursor' in <anon> at line 22:/tmp/1_T4OrYTpn in 'Cool::match' at line 2406:CORE.setting in 'Regex::ACCEPTS' at line 5676:CORE.setting in main program body at line 22:/tmp/1_T4OrYTpn» | 01:59 | |
| pmichaud | a-ha | ||
| it doesn't know how to parse circumfixes on variables | |||
| a-ha | |||
| because STD.pm parses an entire expression there | |||
| we might be able to handle that. | |||
| please file rakudobug if you get a chance. | 02:00 | ||
| afk, shopping | |||
| tylercurtis | pmichaud: will do. By the way, do you have a moment for a PCT question? | ||
| pmichaud | just a moment | ||
| (yes, I have only a moment :) | 02:01 | ||
| tylercurtis | pmichaud: Is :returns<Float> the correct way to say that a number should be a Float? | ||
| I'm working on constant-folding and I noticed that t/nqp/51-multis.t in NQP-rx test-suite has a $f.bar(43.5 - 0.5) that, with my constant-folding, is producing PAST::Op.new(:name<bar>, :pasttype<callmethod>, PAST::Var.new(:name<$f>), PAST::Val.new(:returns<Float>, :value(43))). | |||
| The PIR this generates is 'find_lex $P53, "$f"$P53."bar"(43)'. So, that goes to the wrong multi. | |||
| pmichaud | that does look like a PCT bug, yes. | 02:03 | |
| but I think there must be something else going on. | 02:04 | ||
| normally PCT is smart enough to be sure to generate 43.0 for floats | |||
| the code that handles that is PAST/Compiler.pir:2530 | 02:05 | ||
| oh, wait, that won't handle this case. | 02:08 | ||
| yes, it's a PAST::Compiler bug | 02:09 | ||
| is this blocking gsoc for you? | |||
| I have to run. I'll fix this tomorrow early-ish. | 02:10 | ||
| afk | 02:11 | ||
| tylercurtis | pmichaud: thanks. It would just block incorporating some of the optimizations into NQP or other compilers. | ||
|
02:28
CaptTofu joined
|
|||
| sorear | let it be known that I am not a fan of $*endsym | 02:34 | |
|
02:44
Bill_N1VUX joined
03:02
skytec joined
03:18
hercynium joined
03:24
CaptTofu joined
03:26
nimiezko joined
03:44
meinwald joined
|
|||
| tylercurtis | ingy: are you around? | 04:16 | |
|
04:17
molaf joined
04:18
xuser joined
|
|||
| dalek | ecza: a4cf2b8 | sorear++ | (3 files): Implement colon pairs |
04:27 | |
| ecza: 892d55e | sorear++ | (3 files): Implement fatarrows |
|||
| ecza: d616f47 | sorear++ | (8 files): %var automatically becomes a Hash |
|||
| ecza: e2d76bb | sorear++ | (3 files): pairs, %hashes live |
|||
| tylercurtis | phenny: ask ingy if he's aware that yaml-pm6 currently has no license. | 04:32 | |
| phenny | tylercurtis: I'll pass that on when ingy is around. | ||
|
04:35
hanekomu joined
04:36
Sarten-X joined
04:48
rhr joined
04:50
patrickas joined
05:15
kaare joined
05:18
HarryS joined
05:38
simcop2387 joined
|
|||
| szabgab | I wonder how people writing Perl modules are running their tests? | 05:44 | |
| I wrote a small script for myself called prove6 that would add lib/ to PERL6LIB and run the files in t/ using perl6 but is there a better way? | 05:45 | ||
| another solution I had is to just ad 'lib' to PERL6LIB in my .bashrc | 05:47 | ||
|
05:48
meteorjay joined
|
|||
| tylercurtis | szabgab: ufo-generated Makefiles have a test target that adds lib(and blib, which is where ufo Makefiles put compiled pir modules) to PERL6LIB and runs the files in t/ | 05:49 | |
|
05:51
wtw joined
05:56
uniejo joined
|
|||
| ingy | greetings | 05:57 | |
| phenny | ingy: 04:32Z <tylercurtis> ask ingy if he's aware that yaml-pm6 currently has no license. | ||
| ingy | tylercurtis: thanks. what's the standard? | 05:58 | |
| tylercurtis, szabgab: I did most of the recent work on the ufo Makefiles, so feel free to bug me | 05:59 | ||
| tylercurtis, szabgab: you can also run `make t/specific.t` | 06:00 | ||
| szabgab: ufo make test runs: prove -e perl6 ... | 06:01 | ||
| szabgab: so your prove6 is not needed :P | |||
|
06:04
lkk- joined
|
|||
| sorear | ingy: the usual license for perl6 stuff is AL2.0 | 06:08 | |
|
06:24
shade_ joined
06:28
Su-Shee joined
|
|||
| tylercurtis | ingy: I'm working on implementing YAML::load, by the way. No guarantees that I'll have it finished very soon, given that this is the last week of GSoC, though. | 06:29 | |
|
06:33
wamba joined
06:35
foodoo joined
07:10
Casan joined
|
|||
| ingy | sorear: where/how does one put the license declaration? | 07:16 | |
|
07:27
Mowah joined
|
|||
| moritz_ | typically in a LICENSE file | 07:28 | |
|
07:31
yves joined
07:37
AndreasX joined
07:38
TiMBuS joined,
Axius joined
07:39
AndreasX left
07:44
AndreasX joined
07:46
redicaps joined
07:55
Axius joined,
bakki joined
|
|||
| bakki | hello | 07:56 | |
| Hi | |||
| colomon | o/ | ||
| bakki | I would like to join in perl 6 community | ||
| I would like to do something in perl 6 | |||
| colomon | great! | ||
| bakki | I am build enginner, automation guys, uses perl for 4 yrs ... | 07:57 | |
| colomon | what sort of thing are you interested in doing? | 08:00 | |
| Su-Shee | wear some flowers in your hair! oh wait, that was the other community.. :) | 08:01 | |
|
08:02
patrickas joined
|
|||
| mathw | Welcome, bakki | 08:04 | |
|
08:06
cognominal joined
|
|||
| moritz_ | bakki: a good start is to pick a simple perl 5 module, and implement it in Perl 6 | 08:08 | |
| bakki: or join an existing effort to do that | 08:09 | ||
| szabgab | ingy: what is ufo? | ||
| moritz_ | an alien technology Makefile generator | 08:10 | |
| szabgab | svn.pugscode.org/pugs/v6/v6-mildew/lib/ < can someone please look at this and remove or rename one of the v V directories? | ||
| moritz_ | github.com/masak/ufo | ||
| szabgab | svn blows up on that on Windows | ||
| moritz_: ty | |||
| moritz_ | read that README - I loved it :-) | ||
| phenny: tell pmurias windows and some Mac file systems are case insensitive, so they can't check out svn.pugscode.org/pugs/v6/v6-mildew/lib/ | 08:11 | ||
| phenny | moritz_: I'll pass that on when pmurias is around. | ||
| szabgab | this SVN is so stupid | 08:12 | |
| it should skip the duplicates | |||
|
08:18
drbean joined
|
|||
| szabgab | ok, so I beamed down ufo from github, what's now? | 08:19 | |
| moritz_ | chdir to your module directory | 08:20 | |
| ufo && make | |||
| make test | 08:21 | ||
| profit! | |||
| szabgab | ufo is not in my path | ||
| and ufo has a Makefile | |||
| moritz_ | then put it into your path | ||
| I don't think you need the Makefile | |||
| szabgab | and I don't habe /usr/local/bin on this Windows 7 machine :) | ||
| moritz_ | ouch | 08:22 | |
| szabgab | moritz_: isn't it funny that I keep typing habe instead of have? | ||
| and I don't even mean to :) | |||
| moritz_ | szabgab: it's a bit German-ish :-) | ||
| szabgab | yep | ||
| but b/v are next to each other | 08:23 | ||
| I guess I'll need an ufo.bat that will run perl6 ufo | 08:24 | ||
| moritz_ | or a symlink with an extension that's registered to perl6 | ||
|
08:24
AndreasX joined
|
|||
| moritz_ | oh wait, this is windows... | 08:24 | |
|
08:25
dakkar joined
|
|||
| szabgab | yeah, I am alreday using alien technology | 08:25 | |
| sorear | How many exotic Rakudo features does ufo use? | 08:26 | |
|
08:26
AndreasX joined
|
|||
| sorear wonders if he could make a ufo.exe | 08:26 | ||
| moritz_ | MAIN sub | 08:27 | |
| .subst | |||
| $str.IO ~~ :e | |||
| szabgab | well, ufo blew up on my system | ||
|
08:27
hirschnase joined
08:28
mj41_ joined
|
|||
| szabgab | nopaste.gamedev.pl/?id=7847 | 08:29 | |
|
08:30
masak joined
|
|||
| masak | oh hai, #perl6! | 08:30 | |
| szabgab | masak: oh hai | ||
| this is for you: | |||
| nopaste.gamedev.pl/?id=7847 | |||
|
08:30
maja joined
|
|||
| szabgab | it seems ufo dislikes windows :( | 08:30 | |
|
08:31
meppl joined
|
|||
| masak | I'm not overly surprised. | 08:31 | |
| szabgab | as I can see there is a call to find | ||
| moritz_ | aye | ||
| masak | it's never really been written for Windows. | ||
| szabgab: if you'd like to adapt it for windows, I'd be happy to accept a patch that does that. | |||
|
08:31
mj41__ joined
|
|||
| szabgab | this is a runaway yak fight | 08:32 | |
|
08:32
Mowah joined
08:35
dduncan joined,
thebird joined
08:37
dduncan left
|
|||
| masak | szabgab: what is it that you want to do? | 08:38 | |
|
08:39
tadzik joined
|
|||
| tadzik | oh hi | 08:39 | |
| sorear | it looks like .NET has no support for querying properties of supplementary characters | ||
| szabgab | I think I'll try to outsource this to Alias, CSJewell or some other Windows expert | 08:40 | |
| I just wanted to run my tests and then was got directed to ufo | |||
| but I guess I'd better go back to my regular scheduled failurs | |||
| as ufo embeds a call to find in the Makefile and I have no idea how to replace that on Windows | 08:41 | ||
| masak | szabgab: probably easier to just run the tests manually. | 08:43 | |
| szabgab: I don't know anything about Windows, but I suspect it has prove. | |||
| baest | szabgab: use File::Find | ||
| sorear | masak: prove is part of the Perl5 Test::Harness distribution | ||
| moritz_ | prove -e perl6 -r t/ | ||
| sorear | it's not an OS tool | ||
| szabgab | masak: why did you decide to create a Makefile and not something written in Perl 6 ? | ||
| masak | and you'll need to have the PERL6LIB flag set, or have the module installed. | 08:44 | |
| szabgab: because the Makefile format abstracts away a lot of the things I don't want to write explicitly. and because I didn't want the build process to be dependent on a module I wrote. and speed. | |||
| moritz_ | rakudo: sub f(:x(:$y)) { }; ~say &f.signature.params[0].names | 08:48 | |
| p6eval | rakudo fcf4f3: OUTPUT«Method 'names' not found for invocant of class 'Parameter' in main program body at line 22:/tmp/yrVsMvvl8Y» | ||
| moritz_ | rakudo: sub f(:x(:$y)) { }; ~say &f.signature.params[0].^methods(:local) | 08:49 | |
| p6eval | rakudo fcf4f3: OUTPUT«parcelnamed_namesconstraintscopyrefreadonlynameinvocanttypenameddefaultoptionaltype_capturesrwmulti_invocantslurpysignaturecapture» | ||
| masak | probably the method is called .name, not .names :) | 08:53 | |
| moritz_ wants named_anmes | |||
| *names | |||
| masak | :) | ||
| moritz_ | rakudo: sub f(:x(:$y)) { }; say ~&f.signature.params[0].^methods(:local) | ||
| p6eval | rakudo fcf4f3: OUTPUT«signature capture parcel named_names constraints copy ref readonly name type invocant named default optional type_captures rw multi_invocant slurpy» | ||
|
08:54
redicaps left
|
|||
| moritz_ | phenny: tell patrickas if you want to hack a bit more on MAIN, you could try to implement short options, ie :foo(:$f) in a signature allows both --foo and -f options. $param.named_names should give you a list of all alias names | 08:55 | |
| phenny | moritz_: I'll pass that on when patrickas is around. | ||
| masak | ok, thinking out loud here. &pack returns a Buf, and takes different arguments, mostly numbers of different kinds. but this: | 08:58 | |
| a A string with arbitrary binary data, will be null padded. | |||
| this must be a Buf, right? | |||
| so pack('a', $some-buf) is a no-op. | |||
| hm, maybe that's 'a*' | 08:59 | ||
| moritz_ | must be buf, yes | ||
| masak | just checking. thanks. | ||
| I think I"ll just delete the current t/spec/S32-str/unpack.t | 09:00 | ||
| it has three tests, written by me a year or so ago. | |||
| they're all wrong. | |||
| moritz_ | wfm | ||
| pugssvn | r31948 | masak++ | [t/spec/S32-str/unpack.t] removed; too wrong | 09:01 | |
| r31949 | moritz++ | test for MAIN with name aliases | 09:03 | ||
| masak | Rakudo Perl is featured on GitHub today! twitter.com/zmughal/status/20871210524 | 09:11 | |
| \\o/ | |||
| tadzik | I don't see it | 09:12 | |
| moritz_ | github.com/blog has github.com/blog/692-perl-6-on-github but it's 6 days old | 09:13 | |
| masak | tadzik: I needed to log out and go to the main page to see it. | ||
| moritz_: no, that's another thing. | |||
| tadzik | oh, right | ||
| rakudo: i.WHAT | 09:14 | ||
| p6eval | rakudo fcf4f3: ( no output ) | ||
| tadzik | rakudo: i.WHAT.say | ||
| p6eval | rakudo fcf4f3: OUTPUT«Complex()» | ||
| imarcusthis | I heard some rumors that someone was working on non-blocking sockets for Rakduo. Anyone know the status of that? | ||
| masak | rakudo: subset Imaginary of Complex where { !.real }; say 4i ~~ Imaginary; say 2 + 4i ~~ Imaginary | 09:15 | |
| p6eval | rakudo fcf4f3: OUTPUT«Method 'real' not found for invocant of class 'Complex' in <anon> at line 22:/tmp/kiMogeIsya in 'Block::ACCEPTS' at line 5635:CORE.setting in 'infix:<~~>' at line 402:CORE.setting in <anon> at line 1:/tmp/kiMogeIsya in 'Block::ACCEPTS' at line 5635:CORE.setting in | ||
| ..'ACCE… | |||
| masak | rakudo: subset Imaginary of Complex where { !.re }; say 4i ~~ Imaginary; say 2 + 4i ~~ Imaginary | ||
| p6eval | rakudo fcf4f3: OUTPUT«10» | ||
| moritz_ | imarcusthis: you need to ask mberends when he's online | ||
| masak | \\o/ | ||
| imarcusthis | moritz_: He's the one working on it? | 09:16 | |
| moritz_ | imarcusthis: yes | ||
| tadzik | masak: !.re is 'has no $.re'? | 09:18 | |
| masak | tadzik: method call, boolification, negation. so yes. | ||
| moritz_ | !.re is short for !$_.re | ||
| masak | tadzik: 'has no' as in 'it's zero'. | 09:19 | |
| sorear | Does Perl 6 have anything like ctypes.h functionality? | ||
| masak | sorear: yes. these tests are inside of the regex sublanguage. | 09:20 | |
| sorear | masak: I was hoping for something I could use to implement regexes | 09:21 | |
| masak | the conversion functions are called .uc, .lc and .ucfirst | ||
| sorear: hah! been there, done that. :) | |||
| sorear: I cheated and used regexes. | |||
| might come back and do it Right sometime. | |||
| imarcusthis | seen mberends? | ||
| masak | as in, Big Honking Generated Table. | ||
| imarcusthis: all our seen bots are broken :/ | 09:22 | ||
| sorear | masak: pir::isctype | ||
| moritz_ | irclog.perlgeek.de/search.pl?channe...nds&q= | ||
| masak | sorear: that's an alternative. | ||
| imarcusthis | mberends is github.com/mberends ? | ||
| moritz_ | my 'seen' bot :-) | ||
| imarcusthis: yes | |||
| sorear can use his own trapdoors to access System.Char.GetUnicodeCategory | 09:23 | ||
| imarcusthis | moritz: Thanks | ||
| sorear | but I thought it would be neat to put a p6 veneer over it | ||
| moritz_ | +1 | ||
| sorear: just put something in the spec :-) | |||
| masak | class CTypes { ... } | 09:24 | |
| :) | |||
| moritz_ | www.perlmonks.org/?node_id=854283 | 09:26 | |
| windows users please come forth | |||
| imarcusthis | first ones up against the wall when the revolution comes... | 09:27 | |
| baest | big wall.... | 09:28 | |
| sorear | masak: What is the implementation level of GGE? | 09:29 | |
| dolmen | moritz_: could you tell him the modules are already installed: C:\\Rakudo\\lib\\parrot\\2.6.0\\... | 09:30 | |
| masak | sorear: I think it fails one test that PGE passes. | ||
| sorear: it passes a few that PGE fails. | |||
| sorear | masak: Erm. I thought GGE was an implementation of p6regex in p6? | 09:31 | |
| masak | it is. | ||
| sorear is not familiar with PGE | |||
| masak | PGE is what Rakudo used to run on. | ||
| it's written in PIR. | |||
| dolmen | moritz_: I've seen in the backlog you were talking about Str.subst(... :inplace) | ||
| moritz_: this is a bad idea | 09:32 | ||
| moritz_ | dolmen: why? | ||
| dolmen | moritz_: Str must stay immutable | ||
| moritz_ | it will | ||
| sorear | right now niecza supports literal characters, subrules, capturing subrules, the ? + * quantifiers, : backtrack control, and :ratchet | ||
| moritz_ | it will make the container mutable, not the string | ||
| dolmen: are the docs installed too? | |||
| sorear | I take it GGE is a good bit more complete | ||
| moritz_ | (with the R* .msi) | 09:33 | |
| dolmen | moritz_: no docs, except the book and the cheatsheet | ||
| masak | sorear: hard to quantify, but yes, probably a bit. | ||
| moritz_ | dolmen: where's the book installed to? | ||
| masak | sorear: you're welcome to have a look; it's on github. | ||
| sorear: github.com/masak/gge | |||
| dolmen | moritz_: C:\\Rakudo\\docs | ||
| moritz_ | dolmen: thanks | 09:34 | |
| sorear | PGE predated gimme5? really? | ||
| so gimme5 only *looks* like 1994 Perl code? ;) | |||
| masak | heh | 09:35 | |
| dolmen | moritz_: back to :inplace | ||
| moritz_ | it's pretty new, I think | ||
|
09:35
Mowah joined
|
|||
| moritz_ | but I'm not sure if TimToady has heard of Modern Perl :-) | 09:35 | |
| dolmen | moritz_: what do you mean by mutable container? | ||
| moritz_ | dolmen: my $x = 'foo'; # $x is mutable, 'foo' not. | ||
| dolmen | moritz_: ah, ok | 09:36 | |
| moritz_ | rakudo: my $x = 'foo'; $x ~~ s:g/o/a/; say $x | ||
| p6eval | rakudo fcf4f3: OUTPUT«faa» | ||
| masak | sorear: github.com/masak/gge/blob/master/STATUS is pretty accurate. I see that <before> and <after> are marked as NYI, but they are actually implemented already. | ||
| moritz_ | rakudo: 'foo' ~~ s:g/o/a/; | ||
| p6eval | rakudo fcf4f3: OUTPUT«Cannot modify readonly value in '&infix:<=>' at line 1 in main program body at line 22:/tmp/qPtzw7bnNd» | ||
| moritz_ | dolmen: subst(:inplace) would have the same behaviour | 09:37 | |
| dolmen | moritz_: but will it be still the same Str object? | ||
| moritz_ | dolmen: if it has been modified, it can't be the same Str object | 09:38 | |
| dolmen | moritz_: ok, that's fine | ||
| moritz_: but I agree with pmichaud ':inplace' would not be the right naming | 09:39 | ||
| moritz_ | why not? | ||
| it does modify inplace | |||
| point is we can't simply call $_.=subst(...) for implementing s/// | 09:40 | ||
| sorear | Why not? | ||
| dolmen | if that is not the same object, this is not "in place" | ||
| moritz_ | dolmen: with "place" I mean "variable", not "object" | ||
| sorear: because then s/// returns the modified string | |||
| sorear | aha. | 09:41 | |
| moritz_ | sorear: and that surprises people who come from p5, and think it will return something true if anything was changed | ||
| so we need some kind of different scheme | |||
| dolmen | moritz_: it surprised me when I arrived in the Perl5 world | ||
| moritz_ | and so far nobody suggested anything working, (except pmichaud, who proposed to implement .subst in terms of s///. Not sure I like that at all) | 09:42 | |
| dolmen | moritz_: I mean, many Perl5 things are functional (map, grep...), but s/// wasn't | ||
| moritz_ | dolmen: and there's the 'functional' alternative called subst() | 09:43 | |
| in p6 | |||
| masak | I'm not sure we should return something specific from s/// solely to avoid surprising p5 programmers. | ||
| to me, returning the result string sounds fine, at least to a first approximation. | |||
| dolmen | moritz_: so 'inplace' is not functional, so this what is strange for me | ||
| moritz_ | dolmen: that's because s/// is not functional | 09:44 | |
| dolmen: it's just a question of how to implement it | |||
| masak | dolmen: same here. I think that's what pmichaud felt was add about it too. | ||
| seems that :inplace and .= take up the same mental space. | |||
| moritz_ | if you don't want the side effect, you simply don't use :inplace | ||
| masak | which is a warning sign. | ||
| moritz_ | I see no problem with that approach | ||
| masak: fair point, if s/// does indeed return the result string | 09:45 | ||
| masak | I won't stand in the way. just noting my slight uncomfort with the idea of :inplace | ||
| if 'rough consensus' is what you're after, you barely have it in this case :) | 09:46 | ||
| moritz_ | I think I'll wait for an opinion from TimToady about what s/// should return | ||
| dolmen | P5 does s/// in place for performance reasons | 09:56 | |
| however in a world where strings are immutable you can't benefit from this | |||
| some VMs such as the JVM have immutable strings to be able to do some other optimizations | |||
| such as sharing data | 09:57 | ||
| moritz_ | parrot too | ||
| dolmen | Java has StringBuilder objects that are used for 'inplace' things | 09:59 | |
| download.oracle.com/javase/1.5.0/do...ilder.html | 10:00 | ||
| jnthn | oh hai, #perl6 | 10:02 | |
| phenny | jnthn: 10 Aug 09:32Z <moritz_> tell jnthn could you maybe take a look at www.perlmonks.org/?node_id=853113 ? seems to be an MSI installier issue | ||
| jnthn is back from vacations | |||
| sorear | \\o/ | 10:03 | |
| moritz_ | welcome back. Hope you enjoyed it | ||
| sorear | niecza: my %x; %x<x>[12] = 5; say +%x<x> | ||
| p6eval | niecza e2d76bb: OUTPUT«13» | ||
| jnthn | moritz_: Yes, very much so. :-) | ||
| masak | jnthn: welcome back! | 10:05 | |
| sorear | jnthn: welcome back! | ||
| jnthn | It's nice to be back, albeit I miss the Swiss alps already. :-) | ||
| ingy | szabgab: github.com/masak/ufo - it's our MakeMaker | 10:06 | |
| what's the shortest rule that will never match? | 10:07 | ||
| moritz_ | <!> | ||
| ingy | I beat dconway on this one for p5! | ||
| /$^/ | |||
| moritz_ | (?!) is what I typically use | 10:08 | |
| in p5 | |||
|
10:08
daxim joined
|
|||
| moritz_ | ingy: doesn't that match the empty string? | 10:08 | |
| sorear | (it will in p6) | ||
| ingy | no | ||
| moritz_ | curious... why not? | 10:09 | |
| ingy | anywho: thanks | ||
| sorear | stefan@stefans:~$ perl -E 'say "STDOUT_TOP" =~ /$^/' | ||
| 1 | |||
|
10:09
PZt joined
|
|||
| moritz_ | ingy lost :-) | 10:10 | |
| /a^/ | |||
| should work though | |||
| sorear | moritz_: because $^ matches a literal string which is (usually) not empty | ||
| ingy | moritz_: what do you mean? | ||
| moritz_ | ingy: you gave a wrong answer | ||
| 12:07 < ingy> I beat dconway on this one for p5! | 10:11 | ||
| 12:07 < ingy> /$^/ | |||
| ingy | did I? | ||
| moritz_ | ingy: do you ignore sorear? | ||
| ingy | sorry: I can't resist the urge to out golf the Damian. | 10:14 | |
| I can't find any input that matches: | |||
| /.^/ | |||
| that was it | |||
| moritz_ | that makes more sense | ||
| ingy | it was over a year ago and it's 3am | ||
| moritz_ | :-) | ||
|
10:15
x3nU joined
|
|||
| ingy | PS If you look at /.^/ at the proper angle, in the proper light, under the influence of the proper drugs, it kinda looks like an emoticon of a certain Aussie I know... :P | 10:15 | |
|
10:15
Trashlord joined
|
|||
| huf | it reminds me of a smirking guy with emo hair | 10:15 | |
| am i looking at it wrong? | 10:16 | ||
| sorear | it's the Phineas Gage smile emoticon? | ||
| ingy | moritz_: someone else in that thread offered /$^/ | 10:17 | |
| and I actually debunked it :P | |||
|
10:18
pmurias joined
|
|||
| pmurias | ruoso: hi | 10:18 | |
| phenny | pmurias: 10 Aug 22:51Z <tylercurtis> tell pmurias The existence of both v6/v6-mildew/lib/V6/ and v6/v6-mildew/lib/v6/ in pugs svn doesn't play nicely with non-case-sensitive filesystems (for example, HFS+). Would you mind renaming/moving one of them so that I can checkout the repo again? | ||
| pmurias: 08:11Z <moritz_> tell pmurias windows and some Mac file systems are case insensitive, so they can't check out svn.pugscode.org/pugs/v6/v6-mildew/lib/ | |||
| ingy | writing p6 grammars is painful compared to pegex :P | 10:20 | |
| moritz_ | what is pegex? | ||
| ingy | moritz_: pegex.org | 10:21 | |
| its my analog of p6rules to all other langs | |||
| huf | pegex is a bit perverted a name tho, no? | 10:22 | |
| ingy | peg + regex | ||
| which is what it is | |||
| moritz_ | ingy: doesn't look less painful to me | ||
| especially those (?:...) just suck. | |||
| ingy | not the syntax | ||
| moritz_ | I mean srsly wtf | 10:23 | |
| that's real cruft | |||
| ingy | um | ||
| I'll explain if you let me :) | |||
| everything between /.../ is real regex | 10:24 | ||
| so I can't control that cruft | |||
| but anyway, the syntax is about the same | |||
| it's just that I can't get actions where I need them in my p6 grammars | 10:25 | ||
| moritz_ | why not? | ||
| ingy | in pegex you can get actions before you try a rule | ||
| after it matches | |||
| and after it fails | |||
| I have to add always passing try_ rules to the p6 grammar | 10:26 | ||
| moritz_ | hm | ||
| ingy | that's basically what I meant | ||
| pegex is also very fast :P | 10:27 | ||
| I'm hoping to try to generate p6 rules from pegex | |||
| so I can have one testml grammar | |||
| or yaml grammar | |||
| or whatever | |||
| pmurias | ingy: you mean pegex gives you implicit hooks before and after the rule | 10:28 | |
| and on failure | |||
| ? | |||
| ingy | pmurias: try_rule1 got_rule1 not_rule1 and end_rule1 | ||
| in your receiver class | |||
| moritz_ | does that mix with LTM? | ||
| ingy | I don't support ltm yet | 10:29 | |
| I don't see the need for it outside p6 | |||
| mathw | really? | ||
| ingy | but I've been thinking on it | ||
| mathw: I read a good paper | 10:30 | ||
| I wish I could find it | |||
| pugssvn | r31950 | pmurias++ | [v6-mildew] rename files to work around insensitivity | ||
| mathw | I know it's not necessary, but I find things can be much more intuitive when you have LTM | ||
| ingy | but LTM is great when you have people changing grammars on the fly | ||
| but most grammars are static | 10:31 | ||
| perl6 ltm is critical | |||
| anyway, pegex is brand new | |||
| sorear | don't worry, we'll steal everything back | ||
| ingy | and I want to get pegex, testml, yaml and jsync ported to 6 langs by yapc asia :) | 10:32 | |
| sorear: I really hope so | |||
|
10:33
Mowah joined
|
|||
| ingy | as soon as rakudo gets p5 regexes back, I can port pegex immediately | 10:33 | |
| and then all my modules can be fast :P | |||
| moritz_ | lol | ||
| mathw | what makes you think rakudo's implementation of p5 regexes would be fast straight away? | 10:34 | |
| ingy | mathw: a binding to pcre is all I want | ||
| moritz_ | the previous p5 regex implementation used PGE as a backend | ||
| ingy | or a thompson nfa! | ||
| moritz_ | and p5 regex != pcre | ||
|
10:34
thebird joined
|
|||
| mathw | a pcre binding would not give you anything like proper p5 regex support | 10:35 | |
| ingy | moritz_: either is fine for pegex | ||
| mathw | but you could write one now if you like | ||
| ingy | mathw: a pcre binding? | ||
| mathw | sure | 10:36 | |
| ingy | yeah, someone offered to help me do that pretty soon | ||
| I forget who | |||
|
10:39
cdarke joined
|
|||
| ingy | mathw: perlgeek.de/en/article/mutable-gram...for-perl-6 | 10:41 | |
| ltm avoids confict when several forces are changing a grammar at once | 10:43 | ||
| that was my take away | |||
| and since nothing that I need pegex for currently needs ltm, I put it on the todo stack | 10:44 | ||
| sorear | it would be nice if I could run the 3 minute niecza test suite and have it actually work | 10:46 | |
| rather than have to fix typos TWICE | |||
| masak | why twice? | ||
| sorear | becuase I made two typos while integrating code | ||
| mathw | because you typo the fixes to your typos? I do that | 10:47 | |
| moritz_ too | |||
| sorear | mathw: well, that and STD.pm6 can't report more than one critical syntax error in a file | ||
| masak | that's what's great about tests. they never give up on you :) | ||
| sorear | add that on top of the fact that STD.pm6 takes a whole minute to parse my 1000 line setting... | 10:48 | |
| ingy | masak! | ||
| masak | ingy! | ||
| ingy | masak: we should work on yaml this week | ||
| masak | ingy: did we say this week? I'm still pretty tied up with GSoC... | ||
| next week would be much better. | 10:49 | ||
| sorear | niecza now supports :r/token and :s/rule | ||
| in addition to regex | |||
| masak | sorear: cool! | ||
| sorear | I think the next thing to work on is LTM and protoregexes | ||
| masak | GGE doesn't have the keywords yet. but I think it has :s. | ||
| ingy | masak: ok | ||
| masak: I'm traveling next week | 10:50 | ||
| masak | ingy: oh. | ||
| mathw | mmm protoregexes | ||
| ingy | but I'll let you know | ||
| masak | ingy: you wanted to work on a YAML parser, right? | ||
| sorear | native types are also on the agenda | ||
| masak: does PGE have a concept of ltm? | 10:51 | ||
| in particular 'cursor' will make efficient regex compilation work much better | |||
| masak | sorear: no. | ||
| sorear: and it's sufficiently fundamental that pmichaud++ decided to redo the whole thing with nqp-rx rather than "extend" PGE. | 10:52 | ||
| dalek | ecza: 624f995 | sorear++ | (3 files): Implement quantmods and ratcheting |
||
| ecza: ae16a8e | sorear++ | (4 files): implement sigspace |
|||
| ecza: 5d8b10e | sorear++ | (2 files): Ratcheting and sigspace now live |
|||
| sorear | I dropped my keyboard and suddenly a wall of text! | 10:53 | |
| masak .oO( sorear writes code by dropping his keyboard? wow ) | |||
| Casan | use Drop::Keyboard::Random::Snippet::ActionListener; | 10:56 | |
|
10:56
briang joined
10:57
briang left
|
|||
| Casan | btw.. concurrency/threads is needed before we can implement apps with EventListeners and such, n'est pas? | 10:57 | |
| mathw | depends how you do it | 10:58 | |
| Casan | so is there another way, when you want them running in the background without locking the process? using fork perhaps? | 11:00 | |
| ingy | This P6 Grammar fwd4.me/Iq2 is the same as this Pegex Grammar fwd4.me/Iq4 which compiles to this simple data structure fwd4.me/Iq5 which compiles further into this CPAN module: fwd4.me/IqN \\o/ | 11:01 | |
| masak: yeah, I want to write a pegex/p6rules yaml grammar with you | 11:02 | ||
| sorear | Casan: Where is EventListener specced? | 11:03 | |
| I'm pretty sure niecza can handle threads now, I just don't have a sane API for them | |||
| Casan | sorear: you got me. I'm not talking from spec. ok, not in spec, no need to ask. | ||
| sorear | Maybe I'll invent one. | ||
| Casan | niecza? | 11:04 | |
| ingy | sorear: can niecza do regular expressions? | ||
| sorear | ingy: yes | ||
| ingy | Casan: yap6 | ||
| sorear: so I could port pegex to it! | |||
| w00t | 11:05 | ||
| Casan | yep know its for CLR.. better just read up on some of sorear's blog posts. | ||
| sorear | ingy: it's using p6regex, though | ||
| ingy: unless you mean doing stuff at a much lower level | |||
| Casan: It would help if I had a blog. | |||
| Casan | I found the code on github.. I'll imagine from there what you've been thinking ;) | ||
| ingy | sorear: I thought "regular expression" meant // not <> | 11:06 | |
| doesn't s05 say something like that? | |||
| sorear | /ab*c/ and token foo { <bar> <baz> } are just degenerate cases of the same underlying syntax | 11:07 | |
| you can write /a<bar>*c/ if you want | |||
|
11:07
snearch joined
|
|||
| ingy | sorear: can you do /(?:a|b)/ ? | 11:08 | |
| sorear | no. that's p5 syntax | ||
| ingy | and pcre | ||
| sorear | the p6 way to write that is /[a||b]/, which I'll support in not too long | 11:09 | |
| ingy | sorear: can niecza do 0ld skøøl regular expressions? | ||
| sorear | m:P5/(?:a|b)/ is not yet supported, no | 11:10 | |
| ingy | anyway, pegex currently relies on the shared regex syntax of all the real world programming languages | ||
| sorear out. | 11:11 | ||
| ingy | but it's all a smop | ||
| night sorear | |||
| bbkr | can rt.perl.org/rt3/Ticket/Display.html?id=62528 be merged into rt.perl.org/rt3/Ticket/Display.html?id=77146 ? they both refer to what Match.keys should return | 11:15 | |
|
11:16
hanekomu_ joined
11:17
proller joined
11:18
Mowah joined
|
|||
| ingy | how do I "unset" an object property? | 11:19 | |
| star: class C { has p is rw }; use YAML; my $o = C.new; say dump($o); | 11:20 | ||
| p6eval | star 2010.07: OUTPUT«===SORRY!===Malformed has at line 22, near "p is rw };"» | ||
| ingy | star: class C { has $p is rw }; use YAML; my $o = C.new; say dump($o); | 11:21 | |
| p6eval | star 2010.07: OUTPUT«--- !Cp: ~...» | ||
| tadzik | ingy: you mean something like $obj = Nil; ? | ||
| ingy | tadzik: that'll work | ||
| star: class C { has $p is rw }; use YAML; my $o = C.new; $o.p = "hi"; say dump($o); | |||
| p6eval | star 2010.07: OUTPUT«Method 'p' not found for invocant of class 'C' in main program body at line 22:/tmp/HS2NjbryP4» | ||
| tadzik | I see many people trying $obj = undef, mainly in old code (oh wow, old Perl 6 code) | 11:22 | |
| ingy | star: class C { has $p is rw }; use YAML; my $o = C.new; $o.$p = "hi"; say dump($o); | ||
| p6eval | star 2010.07: OUTPUT«===SORRY!===Symbol '$p' not predeclared in <anonymous> (/tmp/X2CusFTrn2:22)» | ||
| tadzik | ingy: $.p | ||
| ingy | star: class C { has $p is rw }; use YAML; my $o = C.new; $.p = "hi"; say dump($o); | ||
| p6eval | star 2010.07: OUTPUT«Lexical 'self' not found in main program body at line 22:/tmp/SV0Izp2Are» | ||
| ingy | ? | ||
| star: class C { has $.p is rw }; use YAML; my $o = C.new; $o.p = "hi"; say dump($o); | |||
| p6eval | star 2010.07: OUTPUT«--- !Cp: hi...» | ||
| ingy | star: class C { has $.p is rw }; use YAML; my $o = C.new; $o.p = "hi"; $o.p = undef; say dump($o); | 11:23 | |
| p6eval | star 2010.07: OUTPUT«===SORRY!===Unsupported use of undef as a value; in Perl 6 please use something more specific: Mu (the "most undefined" type object), an undefined type object such as Int, Nil as an empty list, *.notdef as a matcher or method, Any:U as a type constraint | ||
| .. or fail() as a failur… | |||
| ingy | star: class C { has $.p is rw }; use YAML; my $o = C.new; $o.p = "hi"; $o.p = Nil; say dump($o); | ||
| p6eval | star 2010.07: OUTPUT«--- !Cp: ~...» | ||
| ingy | tadzik: thanks | ||
| tadzik | ingy: you're welcome | 11:24 | |
| Casan | I was looking for undef as well, so in p6 it is Nil? | ||
| tadzik | yep | ||
| Casan | thnx | ||
| tadzik | even warnings say so, iirc | ||
| hmm | |||
| or Mu | |||
| Nil is an empty list | |||
| masak | saying that undef is Nil in Perl 6 is missing a bit of the story, I think. | 11:26 | |
| rakudo: say undef | |||
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===Unsupported use of undef as a value; in Perl 6 please use something more specific: Mu (the "most undefined" type object), an undefined type object such as Int, Nil as an empty list, *.notdef as a matcher or method, Any:U as a type constraint | ||
| .. or fail() as a failur… | |||
| masak | furthermore, Nil is actually defined. | 11:27 | |
|
11:27
[1]Casan joined
|
|||
| masak | rakudo: say Nil.defined | 11:27 | |
| p6eval | rakudo fcf4f3: OUTPUT«1» | ||
| szabgab | can I loop over an array and make it easy to look at the previous and the next element as well or do I need to loop over the indexes for this? | 11:29 | |
| for @x.slider -> $prev, $curremt, $next { } | 11:35 | ||
| colomon | szabgab: I spent some time trying to figure that out a few months back, with no real elegant solution | 11:36 | |
| szabgab | for @x.threesome -> ... | 11:37 | |
| colomon | for @x.slider[0..(*-2)] Z @x.slider[1..(*-1)] Z @x.slider[2..*] -> $prev, $current, $next { } | ||
| gfldex | for @x.slider -> $element {} # $element will be an element of that list, but you dont want that. You want to get hold of the iterator itself. for wont help you there. | 11:38 | |
| colomon | but that's hardly elegant, and last time I checked there were at least two reasons it wouldn't work in Rakudo. | ||
| smart way to do it is probably to write a function | 11:39 | ||
| something like | |||
|
11:40
rgrau joined
|
|||
| szabgab | yah, Z currently works with two arrays | 11:41 | |
| not with 3 | |||
| ingy | anyone know how to call a method name that's it a variable. Like p5 $self->$method() | 11:42 | |
| colomon | star: sub past-current-next(@a) { my $two-back = @a.shift; my $one-back = @a.shift; gather { for @a -> $current { take ($two-back); take ($one-back); take ($current); $two-back = $one-back; $one-back = $current; }; }; }; say (past-current-next(1..10).perl | ||
| p6eval | star 2010.07: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22» | ||
| colomon | star: sub past-current-next(@a) { my $two-back = @a.shift; my $one-back = @a.shift; gather { for @a -> $current { take ($two-back); take ($one-back); take ($current); $two-back = $one-back; $one-back = $current; }; }; }; say (past-current-next(1..10)).perl | ||
| p6eval | star 2010.07: OUTPUT«Method 'shift' not found for invocant of class 'Range' in 'past-current-next' at line 22:/tmp/ABrzHhv79i in main program body at line 22:/tmp/ABrzHhv79i» | ||
| colomon | star: sub past-current-next(@a) { my $a = @a.list; my $two-back = $a.shift; my $one-back = $a.shift; gather { for $a -> $current { take ($two-back); take ($one-back); take ($current); $two-back = $one-back; $one-back = $current; }; }; }; say (past-current-next(1..10)).perl | 11:43 | |
| p6eval | star 2010.07: OUTPUT«(1, 2, (3, 4, 5, 6, 7, 8, 9, 10))» | ||
| colomon | star: sub past-current-next(@a) { my $a = @a.list; my $two-back = $a.shift; my $one-back = $a.shift; gather { while my $current = $a.shift { take ($two-back); take ($one-back); take ($current); $two-back = $one-back; $one-back = $current; }; }; }; say (past-current-next(1..10)).perl | ||
| p6eval | star 2010.07: OUTPUT«(1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 5, 6, 5, 6, 7, 6, 7, 8, 7, 8, 9, 8, 9, 10)» | ||
| ingy | star: Class C { method x() { say "xxxx" } }; my $o = C.new; $o.x() | 11:44 | |
| p6eval | star 2010.07: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespaceCould not find sub &C in main program body at line 22:/tmp/muocW53VD7» | ||
| colomon | star: class C { method x() { say "xxxx" } }; my $o = C.new; $o.x() | ||
| p6eval | star 2010.07: OUTPUT«xxxx» | ||
| ingy | star: class C { method x() { say "xxxx" } }; my $o = C.new; my $method = 'x'; $o.$method() | 11:46 | |
| p6eval | star 2010.07: OUTPUT«invoke() not implemented in class 'Perl6Str' in main program body at line 22:/tmp/U6JEmt_pLE» | ||
| colomon | star: class C { method x() { say "xxxx" } }; my $o = C.new; my $method = 'x'; $o."$method"() | ||
| p6eval | star 2010.07: OUTPUT«xxxx» | ||
| colomon | don't know if that's the best approach, though | ||
| ingy kisses colomon | |||
| I don't care | |||
| I just need tests to pass so I can sleep | 11:47 | ||
| masak | been there, done that. | 11:48 | |
|
11:49
wayland76 joined
|
|||
| jnthn | .oO( Insomnia Driven Development ) |
11:49 | |
| ingy | star: class C { method x($foo) { say $foo } }; my $o = C.new; my $method = 'x'; $o."$method"("che") | 11:51 | |
| p6eval | star 2010.07: OUTPUT«che» | ||
| ingy | did star change since THE BIG RELEASE? | 11:52 | |
|
11:52
Synn joined
|
|||
| tadzik | I don't think so | 11:52 | |
| moritz_ | no; I downloaded the release tarball, built in once, and left it alone ever since (on p6eval's server) | 11:53 | |
|
11:53
masonkramer joined
|
|||
| ingy | colomon: what's this: Non-declarative sigil is missing its name at line 38, near "$.\\"$method" | 11:53 | |
| hmm | |||
| colomon | ingy: no idea. | 11:54 | |
| ingy | I see | ||
| colomon | you do need to include the () after the call if you use "$method" | ||
| ingy | $."xxx" no worky | ||
| moritz_ | try self."$method" instead of $."$method" | ||
| ingy | self. yeah... | ||
| colomon | can you post the line in question | 11:55 | |
| ? | |||
| ingy | moritz_++ # correct | ||
| colomon | moritz_++ | ||
| ingy | already tried :) | ||
| masak | std: my $method = "foo"; class A { method foo { $."$method" } } | 11:56 | |
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mBogus statement at /tmp/P6fKGBTqVg line 1:------> [32m$method = "foo"; class A { method foo { [33m⏏[31m$."$method" } }[0mParse failedFAILED 00:01 116m» | ||
| masak | ingy: you expected $."$method" to work. I've never seen it spec'd or implied. | ||
| ingy: I'm not sure whether it's a brilliant generalisation or just insane. :) | 11:57 | ||
| bbkr | rakudo: my $a = 2;$a := $a; say $a | ||
| p6eval | rakudo fcf4f3: ( no output ) | ||
| masak | seems to me self."$method" is an appropriate punishment for now :) | ||
| yapsi: my $a = 2; $a := $a; say $a | 11:58 | ||
| p6eval | yapsi: OUTPUT«2» | ||
| masak | \\o/ | ||
| colomon | \\o/ | ||
| masak | I'll keep doing that until someone fixes Rakudo. :P | ||
| rcfox | rakudo: my @x = 1..4; for @x.rotate(-1) Z @x -> $a,$b { say "$a $b"; } | ||
| p6eval | rakudo fcf4f3: OUTPUT«4 11 22 33 4» | ||
| rcfox | Is Z supposed to work with more than two things? | 11:59 | |
| moritz_ | yes | ||
| and it's a known limitation that it doesn't | |||
| rcfox | Ah. | ||
| masak | ditto X. | ||
| rcfox | rakudo: my @x = 1..4; for @x.rotate(-1) Z @x Z @x.rotate(1) -> $a,$b,$c { say "$a $b $c"; } | 12:00 | |
| p6eval | rakudo fcf4f3: OUTPUT«No applicable candidates found to dispatch to for 'infix:<Z>'. Available candidates are::():(Any $lhs, Any $rhs) in main program body at line 22:/tmp/SdpsIL_yQF» | ||
| TiMBuS | what makes $.foo different to self.foo ? | ||
| rcfox | Otherwise, szabgab could do this ^ | ||
| moritz_ | TiMBuS: different syntax, and $ implies item context | ||
|
12:01
Sarten-X joined
|
|||
| TiMBuS | i just thought it was short for 'self', i don't think i've read about it in the spec | 12:01 | |
| rcfox | "$.foo(1,2,3); # calls self.foo under $ context" | 12:03 | |
| perlcabal.org/syn/S12.html#Attributes | |||
| TiMBuS | ooh ok. | 12:05 | |
| bbkr thinks that tickets in RT should have some status indicating that issue is resolved but tests are missing | 12:06 | ||
| rcfox | rakudo: class c { method foo {say "hi";}; method bar {$.foo;}}; my $a = c.new; $a.bar; | 12:07 | |
| p6eval | rakudo fcf4f3: OUTPUT«hi» | ||
| masak | moritz_: does it make sense to put 'our multi pack' in src/code/Buf.pm ? | 12:09 | |
| moritz_ | masak: yes | ||
|
12:09
envi^home joined
|
|||
| masak makes it so | 12:09 | ||
| bbkr | rakudo: say "/j #test" # just curious :))) | 12:10 | |
| p6eval | rakudo fcf4f3: OUTPUT«/j #test» | ||
|
12:11
TimToady joined
|
|||
| [Coke] | bbkr: that is "assigned to moritz" | 12:11 | |
| masak | std: role Parametric[::T] {}; constant PStr := Parametric[Str]; | ||
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mMalformed constant at /tmp/hcUEVrymJ0 line 1:------> [32mrole Parametric[::T] {}; constant PStr :[33m⏏[31m= Parametric[Str];[0m expecting any of: coloncircumfix signatureParse failedFAILED 00:01 114m» | ||
| [Coke] | bbkr: not the most intuitive status, I admit. | ||
|
12:11
arnsholt joined
|
|||
| bbkr | [Coke]: indeed :) | 12:12 | |
| rakudo: say "abc\\b\\bz" | |||
| p6eval | rakudo fcf4f3: OUTPUT«abcz» | ||
| takadonet | morning all | ||
|
12:13
stepnem joined
|
|||
| masak | takadonet: \\o | 12:13 | |
| takadonet | masak: how are u sir? | ||
| masak | takadonet: busy but in a good way. :) | ||
| takadonet: and u? | |||
| takadonet | masak: busy in both good and bad ways | 12:14 | |
| bbkr | rakudo: $0 | 12:16 | |
| p6eval | rakudo fcf4f3: ( no output ) | 12:17 | |
| moritz_ | rakudo: say $0.perl # /me expects Any | 12:19 | |
| p6eval | rakudo fcf4f3: OUTPUT«Any» | ||
| moritz_ | my oracle works :-) | ||
| bbkr | where to put tests for rt.perl.org/rt3/Ticket/Display.html?id=72956 ? t/spec/S05-match/capturing-contexts.t ? | ||
| gfldex | szabgab: gist.github.com/518895 | 12:20 | |
| ingy | star: say index 'Cat in hat', 'hat' | ||
| p6eval | star 2010.07: OUTPUT«7» | ||
| ingy | star: say index 'Cat in hat', 'hatx' | ||
| p6eval | star 2010.07: ( no output ) | ||
| ingy | huh? | ||
| gfldex | gfldex: as soon as $it <== @list works, that shift magic wont be needed anymore | ||
| szabgab: as soon as $it <== @list works, that shift magic wont be needed anymore | |||
| ingy | star: say 'Cat in hat'.index('hatx') | 12:21 | |
| p6eval | star 2010.07: ( no output ) | ||
| ingy | star: say 'Cat in hat'.index('hat') | ||
| p6eval | star 2010.07: OUTPUT«7» | ||
| szabgab | gfldex: reading | ||
| frettled | star: say index 'Cat in hat', 'fnorblegnark' | ||
| p6eval | star 2010.07: ( no output ) | ||
| masak | frettled: :) | ||
| moritz_ | bbkr: S05-match/capturing-contexts.t works for me | ||
| ingy | star: say Mu | ||
| p6eval | star 2010.07: OUTPUT«Mu()» | 12:22 | |
| frettled | masak \\o/ | ||
| masak | it shouldn't output nothing in those situations. | ||
| ingy | star: if not 'Cat in hat'.index('hatx') { say "ok" } | ||
| p6eval | star 2010.07: OUTPUT«ok» | ||
| masak | but p6eval is known to be a bit of a sissy. | ||
| bbkr | moritz_: thanks | 12:23 | |
| masak | ingy: use 'not defined', please. | ||
| szabgab | gfldex: nice | ||
| masak | ingy: just 'not' will give false positives for matches on position 0. | ||
| gfldex | szabgab: that "last if !$current;" is ... dangerouse, but without proper iterators we can't really solve that right now | ||
| ingy | masak: sure, but that wasn't my concern | ||
| masak | perhaps it should be :) | ||
| szabgab | last if !@foo.elems | ||
| ingy | masak: it's not a production eval :P | 12:24 | |
| masak | er. but people might read your code for idioms, etc... | ||
| besides, why would you want to write suboptimal code just to save one word? | |||
| moritz_ | straw poll: should string-eval catch expressions? [ ] yes [ ] no [ ] huh? [ ] don't care | 12:25 | |
| masak | 'catch expressions'? | ||
| what kind of expressions? | |||
| moritz_ | s/expression/exceptions/ | ||
| moritz_ should wake up | |||
| masak | oh. :) | ||
|
12:26
drbean joined
|
|||
| moritz_ | straw poll: should string-eval catch exceptions? [ ] yes [ ] no [ ] huh? [ ] don't care | 12:26 | |
| now with sense :-) | |||
| masak | moritz_: and you're excepting "die"-type exceptions, right? those are a no-brainer. | ||
| moritz_ | masak: any kind of run-time or compile-time error | ||
| colomon | szabgab: last if ?@foo | 12:27 | |
| better than !@foo.elems | |||
| masak | moritz_: [X] yes | ||
| moritz_ | you can leave out the ? entirely | ||
| dolmen | rakudo: my @a = 1, 2, 3; say (@a-1) | ||
| p6eval | rakudo fcf4f3: OUTPUT«2» | ||
| moritz_ notes a "yes" vote | |||
| szabgab | colomon: what is ? ? | ||
| moritz_ | boolean context | ||
| colomon | what moritz_ said | ||
| masak | moritz_: [X] yes # trying to game the system :) | ||
| colomon | and if you use it on an @array, it returns True if there are elements left, without counting them. | 12:28 | |
| szabgab | then ?@foo is not good | ||
| moritz_ notes -1 "yes" votes | |||
| szabgab | maybe !?foo ? | ||
| masak | moritz_: :P | ||
| colomon | last unless ?@foo | ||
|
12:28
rgrau joined
|
|||
| colomon | (sorry) | 12:28 | |
| szabgab | I hate unless | ||
| I always have to DeMorgan it | |||
| moritz_ | last if !@foo | 12:29 | |
|
12:29
mysterious_stran joined
|
|||
| mysterious_stran | moritz_: [X] yes | 12:29 | |
| colomon | moritz_++ again | ||
| moritz_ records 0.01 'yes' votes :-) | |||
| masak notes that freenode's webchat has an upper nick length limit | 12:30 | ||
| frettled | masak: is it different from that of IRC? | ||
| masak | frettled: there's one for IRC? | ||
| moritz_ | anybody else want to vote? | ||
| frettled | masak: yes. | ||
| tadzik | [X] huh? | ||
| ingy | star: say Bool::Tru | ||
| p6eval | star 2010.07: OUTPUT«Can not find sub Bool::Tru in main program body at line 1» | ||
| ingy | star: say Bool::True | ||
| p6eval | star 2010.07: OUTPUT«1» | ||
| pugssvn | r31951 | bbkr++ | [t/spec] tests for # RT #72956 $0 when $/ is undefined causes Rakudo to give an error | 12:31 | |
| tadzik | moritz_: You mean if 'eval "foobar()"; given $! { bla bla }' should work? | ||
| frettled | masak: originally 9 characters, but extended to 16 or something like that in recent years. | ||
| masak: well, originally nicks didn't exist, only numbers, but that's long ago. | |||
| masak | wow. numbers. | ||
| moritz_ | tadzik: I think that eval "foobar()" should throw an excpetion if foobar() throws one | 12:32 | |
| and I want to know if people generally agree | |||
| dolmen | rakudo: my @a = 0..8; for map { (@a[$_-1], @a[$_], @a[$_+1]) }, 1..(@a-1) -> $prv, $cur, $nxt { ($prv, $cur, $nxt).perl.say } | 12:33 | |
| p6eval | rakudo fcf4f3: OUTPUT«(0, 1, 2)(1, 2, 3)(2, 3, 4)(3, 4, 5)(4, 5, 6)(5, 6, 7)(6, 7, 8)(7, 8, Any)» | ||
| moritz_ | currently eval '...' catches all exceptions, which seems like an old-perl anachronism | ||
| tadzik | moritz_: so eval "foobar()" would no longer silence die() line in Perl 5? | ||
| masak | moritz_: I'd say one thing in favour of that: it would make people abuse abuse &eval as a try { ... } less. | ||
| dolmen | my @a = 0..8; for map { (@a[$_-1], @a[$_], @a[$_+1]) }, 1..(@a-2) -> $prv, $cur, $nxt { ($prv, $cur, $nxt).perl.say } | ||
| moritz_ | tadzik: correct | ||
| dolmen | rakudo: my @a = 0..8; for map { (@a[$_-1], @a[$_], @a[$_+1]) }, 1..(@a-2) -> $prv, $cur, $nxt { ($prv, $cur, $nxt).perl.say } | 12:34 | |
| p6eval | rakudo fcf4f3: OUTPUT«(0, 1, 2)(1, 2, 3)(2, 3, 4)(3, 4, 5)(4, 5, 6)(5, 6, 7)(6, 7, 8)» | ||
| tadzik | moritz_: [X] don't care then | ||
| moritz_ records another vote | |||
| gfldex | gfldex.post('http://gfldex.wordpre...-value/'); | ||
| dolmen | szabgab: see above | ||
| masak | moritz_: but I fear it'd make people write try { eval "..." } until they cursed the originator of that separation. | ||
| gfldex | gfldex.blog++; | ||
| tadzik | .oO( isn't that vote a no-op? ) |
||
| masak | tadzik: no, of course not :) | ||
| bbkr | rakudo: class Boo { method new() { } }; say Boo.new.WHAT; # #72836 | ||
| p6eval | rakudo fcf4f3: OUTPUT«Parcel()» | ||
| tadzik | *relief* | 12:35 | |
| masak | bbkr: I see no bug there. | ||
| frettled | masak: My guess is that the current extended nick length limit came with UTF-8 support, first appearing around 2002 or so. | ||
| szabgab | dolmen: looking but not understanding | ||
| bbkr | masak: indeed, I was just reconfirming on current build before committing tests | ||
| masak | bbkr: ah, I see now. keep up the good work. :) | 12:36 | |
| moritz_ | pmichaud++ fixed all the Null PMC accesses from empty statement lists | ||
| dolmen | szabgab: you asked " can I loop over an array and make it easy to look at the previous and the next element as well or do I need to loop over the indexes for this?" | ||
| frettled | masak: Ah, Freenode's limit is 16 chars. | ||
| szabgab | gfldex: you can fix the !$current | ||
| by replaceing it by !@foo as we discussed | 12:37 | ||
| ingy | star say '' ?? 'x' !! 'y' | ||
| szabgab | dolmen: I am not yet understanding how does it do it :) | ||
| ingy | star: say '' ?? 'x' !! 'y' | ||
| p6eval | star 2010.07: OUTPUT«y» | ||
| dolmen | szabgab: ah, ok | ||
| szabgab: 1..(@a-2) is all the indexes except the first one and the last one | 12:38 | ||
| ingy | moritz_: who maintains Test.pm? | ||
| moritz_ | ingy: the Rakudo developers | ||
| ingy | I found a small bug | ||
| :P | |||
| tadzik | it's hiding under the bed | 12:39 | |
| moritz_ | ingy: mailto:rakudobug@perl.org | ||
| tadzik looks for a shoe | |||
| moritz_ | ingy: of course you're welcome to discuss it here too | ||
| ingy | star: use Test; ok('foo') | ||
| p6eval | star 2010.07: OUTPUT«ok 1 - » | ||
| dolmen | szabgab: the map extracts the 3 values (prev, current, next) from the array for each index | ||
| szabgab | dolmen: oh yes a map and a for | ||
| ingy | with no label parameter, ok(1) should output "ok 1\\n" | 12:40 | |
| not "ok 1 - \\n" | |||
| moritz_ | does the TAP spec say that? | ||
| ingy | that's p5 output | ||
| moritz_ | does the TAP spec say that? | ||
| masak | :) | ||
| tadzik | that's shotgun debugging | 12:41 | |
| gfldex | szabgab: that doesn't work because you skip the last iteration | ||
| masak | fwiw, regardless of what it says, I think ingy's suggestion looks nicer. | ||
| tadzik | .oO( I added a labels to avoid this ugly 'ok x - ' a few times) |
||
|
12:41
oha joined
|
|||
| ingy | moritz_: we recently made changes to p6 Test.pm to exactly replicate p5 output | 12:41 | |
| moritz_ | agreed. But it's only a bug if the TAP specs requires it be Ok 1\\n | ||
| ingy | ok, screw it | ||
| I really don't care | 12:42 | ||
| I just noticed in my tests | |||
| tadzik | maybe this is to encourage writing labels | ||
| moritz_ | it's probably more in the spirit to keep Test.pm simple | ||
| ingy | tadzik: no, it's a poor port | ||
| moritz_ | we currently route all tests through proclaim() | 12:43 | |
| tadzik | well, it won't bring much complication to Test.pm imho | ||
| moritz_ | I won't reject patches for it :-) | ||
| tadzik | but not sure I must say | ||
| ingy | I'll fix it later | ||
| with meh new comitz bitz | 12:44 | ||
| Casan | tadzik: following the conversation before about 'resetting' object data, I was wondering, would Nil also help to undeclare a declared object and thus render it into nothing, and freeing up the memory, or is this over in the DESTROY department? | ||
| szabgab | gfldex: so make it : last if !@foo and !$current; | 12:45 | |
| that fails only if the last element is Any(), I think | |||
| TiMBuS | why is my font so huge on the rt? :/ | 12:46 | |
| moritz_ | TiMBuS: because you pressed Ctrl +? | 12:47 | |
| TiMBuS | it looks like i am yelling | ||
| moritz_ | or ctrl + mousewheel | ||
| gfldex | rakudo: sub foo(){ return (1,2,undef) }; say foo(); | ||
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===Unsupported use of undef as a value; in Perl 6 please use something more specific: Mu (the "most undefined" type object), an undefined type object such as Int, Nil as an empty list, *.notdef as a matcher or method, Any:U as a type constraint | ||
| .. or fail() as a failur… | |||
| moritz_ | rakudo++ | ||
| TiMBuS | no moritz_, just my replies | ||
| gfldex | how do i return a list that contains an undefined value? | ||
| moritz_ | just return an undefined value | 12:48 | |
| like Int | |||
| or Any | |||
| TiMBuS | rt.perl.org/rt3/Ticket/Display.html?id=77038 for example, | ||
| dolmen | rakudo: say (,).perl | 12:49 | |
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22» | ||
| moritz_ | TiMBuS: looks only a bit above average to me | ||
| takadonet | what server is #perl5 on? | 12:51 | |
| TiMBuS | is there a font tag or something im misusing? | 12:52 | |
| tadzik | Casan: ask ingy, he wanted that | ||
| moritz_ | takadonet: there's a #perl on both freenode and irc.perl.org | ||
| gfldex | szabgab: updated: gist.github.com/518895 | ||
| takadonet | moritz_: thanks | ||
| pugssvn | r31952 | bbkr++ | [t/spec] tests for # RT #72836 Null PMC access when using value from empty routine | ||
| dolmen | masak: is ufo yet another ExtUtils::MakeMaker ? | ||
| masak | dolmen: I don't know, because I don't know that module. | 12:53 | |
| dolmen | masak: with the same reliance on 'make'? | ||
| tadzik | dolmen: ufo creates Makefile | ||
| masak | dolmen: but it's strictly for developers, not for users of the module. | ||
| tadzik | which can build, test and install the module | ||
| dolmen | masak: schwern.dreamhosters.com/talks/Make...de005.html | 12:56 | |
| masak | dolmen: understood. | 12:58 | |
| ingy | ALL TESTS PASS! \\o/ and zzzzzzzzzzzzzzzzzz | ||
| masak | dolmen: and I actually buy that premise. | ||
| tadzik | then I guess we should remove ufo from module installed to be fashionable | ||
| * installers | |||
| pugssvn | r31953 | moritz++ | [t/spec] correct and re-fudge ignorecase.t for rakudo | ||
| moritz_ | tadzik: I don't think so | ||
| masak | dolmen: please write an all-Perl6 tool that does what ufo does, and I'll happily refer to it. | ||
| dolmen | :) | 12:59 | |
| moritz_ | tadzik: it's the best we have for now | ||
| tadzik | moritz_: me neither :) | ||
| it's just my comment | |||
| masak: can ufo install bin/? | |||
| masak | tadzik: don't think so. | 13:00 | |
| tadzik | masak: actually, that was an encouragement to think about implementing this :) | ||
| masak | tadzik: excellent idea. I accept patches 24/7. | ||
| tadzik | as long as module installers use ufo as a backend | ||
| masak: sure thing, I can't promise anything though | |||
| oha | hello! | ||
| masak | right. that's how it works :) | 13:01 | |
| tadzik | :) | ||
| masak | o hai oha! | ||
| tadzik | oha: o/ | ||
| oha | masak, any news on Buf? | ||
| masak | oha: yes, I have a &pack function running locally now. | ||
| dolmen: I want to reiterate that ufo is not meant to build/install things on the user side of things. so it's not an analogue to MakeMaker. | 13:02 | ||
| oha | masak++ | ||
| bbkr | std: my $a = "oh hai"; say $a .= "uc"() | ||
| p6eval | std 31912: OUTPUT«Potential difficulties: Useless use of quotes at /tmp/T6fz4pm_PO line 1:------> [32mmy $a = "oh hai"; say $a .= "uc"[33m⏏[31m()[0m Unsupported use of .= as append operator; in Perl 6 please use ~= at /tmp/T6fz4pm_PO line 1:------> [32mmy $a = "oh hai"; say $a | ||
| ...=[33m⏏[3… | |||
| bbkr | rakudo: my $a = "oh hai"; say $a .= "uc"() | 13:03 | |
| p6eval | rakudo fcf4f3: OUTPUT«OH HAI» | ||
| masak | oha: I have H* so far. any directives in particular I should focus on for you? | ||
| oha | masak, H* ? | ||
| masak | oha: in the template string. | ||
| oha: H* is "as many hex digits as you have into bytes" | 13:04 | ||
| (most significant digit first) | |||
| moritz_ | S05 says that :c/:continue defaults to $/.to | ||
| at what level does this default apply? action methods? | |||
| oha | masak, i must see it to say. have you seen the Buf_hack.pm i've sent you? | ||
| masak | moritz_: not sure I understand the question. | ||
| dolmen | rakudo: say :(Int).perl | 13:05 | |
| p6eval | rakudo fcf4f3: OUTPUT«:(Int )» | ||
| masak | oha: yes, but I think I must look at it again. | ||
| dolmen | rakudo: say :(Array of Int).perl | ||
| p6eval | rakudo fcf4f3: OUTPUT«Method '!select' not found for invocant of class '' in main program body at line 22:/tmp/xd_KNx9eAa» | ||
| masak | dolmen: new bug? | ||
| moritz_ | masak: right now :c produces the same as c => True | ||
| masak: and not c => $/.to | |||
| masak | moritz_: nod | ||
| moritz_ | so, there must be some magic | ||
| masak | right. | ||
| moritz_ | where does this magic happen? | ||
| dolmen | masak: don't know. Just experimenting with Signatures | ||
| masak | moritz_: oh! | 13:06 | |
| masak submits rakudobug | |||
| moritz_ | waitwaitwait | ||
| masak | (the Array of Int one) | ||
| moritz_ | ok | ||
| I thought you meant :c :-) | |||
| masak | many people talking at once :) | ||
| dolmen | rakudo: my Array of Int @a = 1, 2, 3; | 13:07 | |
| p6eval | rakudo fcf4f3: OUTPUT«Method '!select' not found for invocant of class '' in main program body at line 22:/tmp/OgwZuMC6ng» | ||
| dolmen | rakudo: my Array Int @a = 1, 2, 3; | ||
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===In "my" declaration, typename Array must be predeclared (or marked as declarative with :: prefix) at line 22, near " Int @a = "» | ||
| dolmen | rakudo: my Int @a = 1, 2, 3; | ||
| p6eval | rakudo fcf4f3: ( no output ) | ||
| pugssvn | r31954 | moritz++ | [t/spec] correct continue.t | ||
| dolmen | masak: is "of" a keyword? | 13:08 | |
| moritz_ | dolmen: it's a trait | ||
| afaict | |||
| dolmen | rakudo: my Array Int $a = 1, 2, 3; | 13:10 | |
| bbkr | rakudo: say try { die } | ||
| p6eval | rakudo fcf4f3: OUTPUT«===SORRY!===In "my" declaration, typename Array must be predeclared (or marked as declarative with :: prefix) at line 22, near " Int $a = "» | ||
| rakudo fcf4f3: OUTPUT«Null PMC access in type() in main program body at line 22:/tmp/9blziL7Eek» | |||
| tadzik | rakudo: say ((5i - 5) * (5i + 5)).perl | 13:11 | |
| p6eval | rakudo fcf4f3: OUTPUT«Complex.new(-50, 0)» | ||
| tadzik | Couldn't it end up as Int? | ||
| dolmen | std: my Array of Int @a = 1, 2, 3; | 13:12 | |
| p6eval | std 31912: OUTPUT«ok 00:01 116m» | ||
| dolmen | std: say :(Array of Int).perl | ||
| p6eval | std 31912: OUTPUT«ok 00:02 115m» | ||
| moritz_ | rakudo: say 'foo'.samecase('HE') | 13:13 | |
| p6eval | rakudo fcf4f3: OUTPUT«FOO» | ||
| tadzik | oh | ||
| rakudo: say 'foobar'.samecase('AaAaAaAa') | |||
| p6eval | rakudo fcf4f3: OUTPUT«FoObAr» | ||
| tadzik | rakudo: say 'foobar'.samecase('Aa') | ||
| p6eval | rakudo fcf4f3: OUTPUT«Foobar» | ||
| dolmen | rakudo: sub x(Array of Int $x) { $x } | 13:14 | |
| p6eval | rakudo fcf4f3: ( no output ) | ||
| dolmen | looks like signatures are not completely parsed outside sub declarations | 13:15 | |
|
13:16
xuser left
|
|||
| tadzik | pugs/docs/talk is open for talks in any language? | 13:18 | |
| (talks) | |||
| moritz_ | yes | ||
| tadzik | mind me pushing "What's going on in Perl 6" in Polish and Catalan version? | 13:19 | |
| moritz_ | feel free | ||
| oha | i was thinking on some enanchement on Buf | ||
| i was writing a Gearman::Client module here | 13:21 | ||
| masak | tadzik: I'd love to read that. yes, please push them. | ||
| oha | and after arranging IO::Socket::INET and adding some methods on Buf i was able to make it work | ||
| masak | oha has been helping me in my thinking around Buf and pack in the last few days. | ||
| oha++ | |||
| oha | ty masak | ||
| here is my idea | |||
| tadzik | masak: sure thing | ||
| oha | Buf may be considered a FIFO | ||
| so i could, for example: $buf = $sock.recv(12); # get 12 bytes | 13:22 | ||
| then my $type = $buf.poll(network-int); | 13:23 | ||
| or when i must write: | |||
|
13:23
Holy_Cow joined
|
|||
| oha | $buf.append($int); $sock.send($buf); | 13:23 | |
| moritz_ | rakudo: say "abc def" ~~ m:s/abc def/ | ||
| oha | the append/poll/peek could be simple methods like: .pollNetworkInt(); | 13:24 | |
| p6eval | rakudo fcf4f3: OUTPUT«abc def» | ||
| moritz_ | rakudo: say "abc\\ndef" ~~ m:s/abc def/ | ||
| p6eval | rakudo fcf4f3: OUTPUT«abcdef» | ||
|
13:24
ruoso joined
|
|||
| oha | or using a pack-like grammar | 13:24 | |
| masak | I believe that oha's suggestions about FIFO Buf might make a cute module. | ||
| the pack-like grammar would make another one. | |||
| one that I'd really really like to use :) | |||
| oha | my ($i0, $i1, $s0) = $buff.poll("IIS"); | ||
| or using a grammar | 13:25 | ||
| $buff.poll("<nint>**2 <nullstring(ascii)>" | |||
| dalek | kudo: a9912e1 | moritz++ | src/Perl6/Actions.pm: bind $/ in m// calls, by advise from pmichaud++ |
13:26 | |
| kudo: 656170d | moritz++ | src/Perl6/Actions.pm: disable non-working modifiders on m// for now |
|||
| kudo: a389b27 | moritz++ | t/spectest.data: run ignorecase.t and ii.t test files |
|||
| oha | that could also be implemented (for the unpack) using regex, just allowing them to "switch" encoding | 13:27 | |
|
13:28
bluescreen joined
|
|||
| masak | afk | 13:28 | |
| pugssvn | r31955 | tadzik++ | Added "What's going on in Perl 6" talks, in Polish and Catalan version | 13:30 | |
| tadzik | masak: ↑ | ||
| yay, it works | 13:31 | ||
| pugssvn | r31956 | moritz++ | [t/spec] fudge ii.t for rakudo | 13:34 | |
| r31957 | moritz++ | [t/spec] fudge sigspace.t for rakudo | 13:35 | ||
|
13:35
AndreasX joined
13:37
_ilbot2 joined
|
|||
| moderator | »ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! | Rakudo Star Released! | ||
|
Guest23195 joined
|
|||
| bbkr | rakudo: "abc".samecase(Failure).say # error message seems to be LTA, should I report? | 13:40 | |
| p6eval | rakudo fcf4f3: OUTPUT«Method 'comb' not found for invocant of class '' in 'Cool::samecase' at line 2152:CORE.setting in main program body at line 22:/tmp/uMCuvp7JIr» | ||
| moritz_ | bbkr: no, I can fix that easily | ||
| bbkr | moritz++ | 13:41 | |
| moritz_ | I have a fix, spectesting it now | 13:42 | |
|
13:43
rgrau joined
13:45
dju joined
13:46
dju joined
|
|||
| tadzik | pb.rbfh.de/654PCSnXqh1D # how do I read bytes from a file? | 13:47 | |
| moritz_ | have you tried open('file').read(16)? | 13:48 | |
| tadzik | yeah, I should have opened it first. That works, yep. moritz_ | 13:49 | |
| moritz_++ | |||
|
13:49
molaf joined
13:57
tom_tsuruhara joined
14:03
Guest53301 joined
14:08
rgrau joined
14:18
Axius joined
14:25
krunen joined
|
|||
| pmichaud | good morning, #perl6 | 14:26 | |
| tadzik | good $localtime pmichaud | ||
| moritz_ | good morning pmichaud | ||
| pmichaud: fancy another regex+modifiers discussion? :-) | |||
| pmichaud | moritz_: sure | 14:27 | |
| moritz_ | pmichaud: S05 says that :continue and :pos default to $/.to | ||
| pmichaud: where should the logic for those defaults go? | |||
| pmichaud | I think nqp-rx already has it. | ||
| colomon | pmichaud: o/ | ||
| oha | i've tried to summarize my ideas about Buf in a pod: register.oha.it/buf.pod | 14:28 | |
| moritz_ | pmichaud: and it knows which $/ to take? | ||
| oha | pmichaud, hi | ||
| moritz_ | and how do I trigger it? | ||
| I mean, what value do I pass in so that it picks up the default? | |||
| pmichaud | simply :pos or :continue as true values, I think. | ||
| moritz_ | rakudo: 'abc' ~~ /./; say 'abc' ~~ m:continue/./ | 14:29 | |
| p6eval | rakudo fcf4f3: OUTPUT«b» | ||
| moritz_ | rakudo: 'abc' ~~ /../; say 'abc' ~~ m:continue/./ | ||
| p6eval | rakudo fcf4f3: OUTPUT«b» | ||
| pmichaud | I think nqp only knows :c and :p at the moment. | 14:30 | |
| moritz_ | seems like it uses the 1 (which is the true value) as position | ||
| rakudo: 'abc' ~~ /../; say 'abc' ~~ m:c/./ | |||
| p6eval | rakudo fcf4f3: OUTPUT«b» | ||
| pmichaud | and you're correct, it's always using 1 | ||
| so that logic needs to be changed to check for true | |||
| moritz_ | we do need to support :c($integer) though | ||
| pmichaud | actually, for now it would probably be better to do :c(ontinue) in rakudo than nqp, then. | 14:31 | |
| so, the short answer is that :continue should translate into :c(Int) | |||
| moritz_ | currently the easist approach would be to do it at the syntax level | ||
| pmichaud | right | ||
| that's fine | |||
| moritz_ | ok | ||
| pmichaud | I don't think nqp can be looking at $/, because there might not be one | 14:32 | |
|
14:32
alester joined
|
|||
| pmichaud | so it needs to happen at the rakudo level (for now at least) | 14:32 | |
| moritz_ | I kinda feared you wouldn't think so, because it requires some special-casing | ||
| rakudo: say 'abcdef' ~~ m:continue(3)/./ | |||
| p6eval | rakudo fcf4f3: OUTPUT«d» | ||
| moritz_ | rakudo: say 'abcdef' ~~ m:c(3)/./ | ||
| p6eval | rakudo fcf4f3: OUTPUT«d» | 14:33 | |
| moritz_ | so far regex modifiers look pretty good in rakudo | ||
| pmichaud | yes. | ||
| masak | tadzik: thanks; will look. | ||
| tadzik | masak: out of curiosity, do you happen to know any of those languages? :) | 14:34 | |
| moritz_ | the only thing that makes my head ache is a match returning more than one value | ||
| masak | tadzik: not to any greater extent, no. but I expect to understand much of the Catalan one. | ||
| moritz_ | rakudo: 'abc' ~~ /(.)+/; .say for $/.list | ||
| p6eval | rakudo fcf4f3: OUTPUT«abc» | 14:35 | |
| tadzik | still haven't caght alexm++ to ask how did the preseting go | ||
| moritz_ | pmichaud: btw that's the Match bug I told you about at YAPC | ||
| moritz_ reports | |||
|
14:36
nadim_ joined
|
|||
| moritz_ | rakudo: 'abc' ~~ /(.)+/; say $0 | 14:36 | |
| p6eval | rakudo fcf4f3: OUTPUT«abc» | ||
| moritz_ | rakudo: 'abc' ~~ /(.)+/; say ~$0 | 14:37 | |
| p6eval | rakudo fcf4f3: OUTPUT«a b c» | ||
| pmichaud | I don't see the bug. | ||
| moritz_ | $0 is an array | ||
| $/.list should return $0 | |||
| pmichaud | oh, it should be an itemized array | 14:38 | |
| masak | that's by spec. | ||
| pmichaud | rakudo: 'abc' ~~ /(.)+/; say $0.WHAT | ||
| p6eval | rakudo fcf4f3: OUTPUT«Array()» | ||
| pmichaud | right | ||
| moritz_ | so only $0.flat should flatten it out | ||
| pmichaud | okay, no problem. | ||
| let me get my compile configuration up and running again | 14:39 | ||
| travel and conferences and new tools tend to muck up my build environment :) | |||
| moritz_ | git reset --hard origin/master # don't do that unless you know what you're doing :-) | ||
| pmichaud | actually, I'll let you try the fix :) | 14:40 | |
| in src/builtins/Cursor.pir, change | |||
| .sub 'new_array' :method $P0 = new ['Array'] .return ($P0) | 14:41 | ||
| .end | |||
| to | |||
| .sub 'new_array' :method | |||
| $P0 = get_hll_global 'Array' | |||
| $P0 = $P0.'new'() | |||
| $P0 = $P0.'item'() | |||
| .return ($P0) | |||
| .end | |||
| moritz_ tries | |||
| pmichaud | that brings new_array into creating "real" Rakudo Arrays | 14:42 | |
| afk for a bit, tutoring | |||
| dalek | kudo: 21b3c7c | moritz++ | t/spectest.data: run another test file |
||
| kudo: 43f00da | moritz++ | src/core/Cool-str.pm: type-constraint samecase() pattern to Cool |
|||
| nadim_ | Hi guys, I was looking in perlbuzz.com/2010/08/diving-into-perl-6.html and one thing caught my eye. Since typing is more prevalent in P6, I expected type inference to be an intrisic part of the interpreter. example: | 14:45 | |
| my Int @candidates; ... push @candidates, $n.Int; | |||
| later I read for @candidates -> Int $x { ... | |||
| tadzik | is it possible to declare mkdir taking one obligatory and one optional parameter, without breaking original mkdir? | ||
| moritz_ | rakudo: say &mkdir.signature.perl | 14:46 | |
| p6eval | rakudo fcf4f3: OUTPUT«get_attr_str() not implemented in class 'Perl6MultiSub' in main program body at line 1» | ||
| moritz_ | rakudo: say &mkdir.candidates[0].signature.perl | ||
| p6eval | rakudo fcf4f3: OUTPUT«:(Any $path, Any $mode = { ... })» | ||
| nadim_ | Extracting the .Int part and putting anything into 4x is "obviously" to be of Int type since @candidates is just that | ||
| moritz_ | it's already defined like this | ||
| nadim_ | that'ts auite a lot of code that need to be qwriten for something that can be infered. How does it work in reality? | 14:47 | |
| pugssvn | r31958 | patrickas++ | series with one scalar containing Code on the LHS | 14:48 | |
| tadzik | moritz_: so as long as I'm declaring multis taking something else than 2 obligaory parameters everything should be ok? | ||
| moritz_ | nadim_: in rakudo, typed arrays suck. In Perl 6 too. | ||
| alester | Why do they suck, moritz_ ? | 14:49 | |
| Should I not have done it like that/ | |||
| nadim_ | alester: hi | ||
| alester | nadim_: (That post on perlbuzz was mine) | ||
| squeeky | pmichaud: ping | ||
| moritz_ | tadzik: the existing multi has one mandatory and one optional parameter. If you do the same, you'll get conflicts | ||
| nadim_ | I don't mind it being sucky in rakudo, I wonder what p6 intention is | ||
| tadzik | oh, righ | 14:50 | |
| moritz_ | rakudo: sub f(Int @a) { say @a.perl }; f([1, 2, 3]) | ||
| p6eval | rakudo fcf4f3: OUTPUT«(timeout)» | ||
|
14:50
patrickas joined
|
|||
| tadzik | moritz_: but if it wouldn't be multi, it will just hide the original mkdir? | 14:50 | |
| moritz_ | rakudo: sub f(Int @a) { say @a.perl }; f([1, 2, 3]); say "alive" | ||
| patrickas | moritz_: sure I want to! | ||
| phenny | patrickas: 08:55Z <moritz_> tell patrickas if you want to hack a bit more on MAIN, you could try to implement short options, ie :foo(:$f) in a signature allows both --foo and -f options. $param.named_names should give you a list of all alias names | ||
| p6eval | rakudo fcf4f3: OUTPUT«Nominal type check failed for parameter '@a'; expected Positional[Int] but got Array instead in 'f' at line 22:/tmp/HeTHuGZ42T in main program body at line 22:/tmp/HeTHuGZ42T» | ||
| moritz_ | tadzik: right | ||
| alester | How do you mean "sucky"? | ||
|
14:50
jaldhar joined
|
|||
| moritz_ | alester: that's what I mean | 14:50 | |
| alester | It seems to me that "my Int @candidates" would be swell. | ||
|
14:51
spq1 joined
|
|||
| nadim_ | alester: moritz_ said it sucked | 14:51 | |
| alester | Right, I don't get what is sucky. I'm missing something. | ||
| patrickas | does anyone object to this patch to rakudo ? :-) github.com/patrickas/rakudo/commit/...9e538b57c0 | ||
| moritz_ | alester: if you declare something as Int @a, you also have to declare things that are bound or assigned to it as Array[Int] | ||
| alester | What's wrong with that? | 14:52 | |
| nadim_ | alester: forget about the adjective it was meant for the p6 typed array not your code | ||
| moritz_ | alester: it's just not convenient | ||
| alester | nadim_: No, I understand, i wasn't insulted. :-) | ||
|
14:52
TiMBuS joined
|
|||
| moritz_ | and it surprises people | 14:52 | |
| nadim_ | alester: I knew you wouldn't | ||
| alester | Meaning you can't say "my @b = @a" without making @b explicitly Int first? | ||
| moritz_ | if you're fine with that, there's no problem (except implementation problems) | ||
| alester: right | |||
| alester | Yeah I would expect that @b would get the Intness for free. | 14:53 | |
| nadim_ | moritz_: it is more than surprising, it is a bit embarassing | ||
| moritz_ | whereas my Foo $x = $b; works if $b contains a Foo, it doesn't need to be declared as such | ||
| tadzik | hmm, undef == Any()? | ||
| moritz_ | Any is one of the many undefs | ||
| nadim_: I did say it sucked, no? :-) | |||
| [Coke] | (many undefs) definitely need an article on that. | 14:54 | |
| nadim_ | moritz_: is $x = $b supposed to transfer type information to $x so the right optimization can be applied? | ||
| moritz_ | nadim_: you have to be a bit more precise | 14:55 | |
| nadim_: a value has type information, and a container can has type constraints | |||
| $x = $b preserves the type information of the value, and leaves the type constraint of the container unchanged | |||
| nadim_ | declaring something to be of a certain type is for a certain purpose (I don't mind which) is that purpose transfered to $x? | 14:57 | |
| moritz_ | the programming language knows nothinga about purpose. Only the programmer does. | ||
| nadim_ | IE Int was used, I guess, to use real hardware ints, will the $x also use HW ints although it was not declared as Int? | 14:58 | |
|
14:59
risou joined
|
|||
| moritz_ | Int is an bignum type | 14:59 | |
| there are lower-case int32, int63 "native" types, which have special rules | |||
| oha | moritz_, are there implemented in rakudo? | 15:00 | |
| colomon | (Int is hardware int at the moment in Rakudo, of course.) | ||
| moritz_ | oha: no | ||
| colomon | oha: no | ||
| moritz_ | colomon: so it fails at both ends (speed and auto-upgrading) :-) | ||
| colomon | moritz_: yup | ||
| moritz_ | otoh, my Int $x; can hold an undefined value, which a native type couldn't | 15:01 | |
| nadim_ | it doesn't matter what it is in reality. I am more interrested in the knowing if the optimization associated with a type is also assigned to an untyped scalar assigned from a typed scalar | ||
| moritz_ | and mix-ins | ||
| colomon | but you wouldn't say my int32 $x = 10 to get a hardware int, anyway. | ||
| moritz_ | nadim_: for assignment, it's not. For binding, it is | ||
| at least the type-check part | 15:02 | ||
| nadim_ | any special reason why assignment doesn't? | ||
| moritz_ | the optimization part always depends on how much can be statically known about the container at compile time | ||
| nadim_ | I think I'm going to reread RFC 4 seriously | ||
| moritz_ | nadim_: yes. We want my $x = 3; $x = 'foo'; to not throw an error | 15:03 | |
| if my $x = 3; type-check $x to Int, the subsequent assignment would fail | |||
| s/check/checked/ | |||
| nadim_ | that has nothing to do with getting the optimisation to $x | ||
| moritz_ | it has | ||
| nadim_ | Sorry, it doesn't | 15:04 | |
| moritz_ | maybe not in your ideal world | ||
| but in the real world of a compiler, it does | |||
| nadim_ | while containing an Int, $x can profit of all optimisations | ||
| moritz_ | if we know that at compile time, yes | ||
| but that requires constant folding and control flow analysis | |||
| nadim_ | right | 15:05 | |
| moritz_ | and is only doable in certain cases | ||
| nadim_ | and also the optimization can (I am not saying it is fast, right, must) be done at run time too | ||
| moritz_ | wheras it's much easier to always know the constraint type at compile time | ||
| szabgab | masak: could you please take a look atmy html-template fork and integrate it if possible? | ||
| moritz_ | nadim_: yes, but the run-time optimization is the job of the JIT compiler, not of the HLL compiler | 15:06 | |
| masak | szabgab: sure. possibly not today, though. I don't want to context-switch right now. | ||
| nadim_ | moritz_: and I guess that ywould be implementation specific, not specified in p6 | ||
| moritz_ | nadim_: correct | ||
| masak | moritz_: allow me to take exception to your 'typed arrays suck in Perl 6' statement. I think we're in a sort of sweet spot where we are right now. | 15:07 | |
| moritz_ | nadim_: in general the p6 spec allows lot of optimization, and requires little | ||
| nadim_ | I'll be bold and say that it should be specified or the mistaked done by the C language are going to be repeated. | 15:08 | |
| moritz_ | what exactly should be specified? | ||
| nadim_ | moritz_: thank you for your answers, great job with Rakudo. | ||
| moritz_ bows | |||
| masak | moritz_: more precisely, Int @foo in a parameter list needs to accept only Int @bar from the outside, because of the possibility of lazy infinite lists. | 15:09 | |
| nadim_ | moritz_: great job with Rakudo. (nadim thinks he found a "bow button") | ||
| oha | i've updated the pod, i'll be really interested about what all you think: register.oha.it/buf.pod | ||
| masak | seems people are trying to hack moritz_++ today :) | 15:10 | |
| moritz_ has a built-in repetition preventer - at least for some things | |||
| what should ('abc' ~~ / (.) ** 2 (.)/).caps return? | 15:11 | ||
| 0 => 'a', 0 => 'b', 1 => 'c' ? | |||
| oha | moritz_, i would expect ((a,b),c) | ||
| moritz_ | oha: have you read the spec for .caps? | 15:12 | |
| oha | nope :) | ||
| you are right | |||
| i just probably get confused by P::RD here | |||
| masak | moritz_: 0 => <a b>, 1 => 'c', p'haps? | 15:13 | |
| moritz_ | masak: that would work for .caps, but would fail to extend to .chunks | 15:15 | |
| masak | hm, guess so. | 15:16 | |
| moritz_ | 'a b c' ~~ /[(\\S) \\s] ** 2 (.)/ -> $/.chunks | ||
| squeeky | Most likey tonight western US time rakudo star will be available for mac homebrew people. \\o/ | ||
| moritz_ | \\o/ | ||
|
15:17
ashleydev joined
|
|||
| masak | I haven't used either .caps or .chunks enough to be familiar/condifent with them. | 15:17 | |
| squeeky: yay | |||
| squeeky | I still find it completely ironic that it's Ruby running Perl 5 to install Perl 6. | 15:19 | |
| patrickas | can I send a pull request for one commit from github ? or will the pull request be for my whole fork? | 15:20 | |
| moritz_ | I guess it will be for the whole fork | ||
| masak | squeeky: that's not irony. that's pragmatics. | 15:21 | |
| moritz_ | better if you submit to RT, and include the link to the specific commit | ||
| patrickas | moritz_ ok thanks | ||
| squeeky | true. | ||
|
15:21
flatwhatson joined
|
|||
| patrickas | the thing is it does not solve any bug .... but i am dyiiiing to submit it :-) at least for review :-) | 15:22 | |
| masak | then RT sounds fine. | 15:23 | |
| wow, 670 new/open/stalled tickets on RT! \\o/ | 15:25 | ||
| rakudo: enum A::B <a b c>; say b; say "alive" | 15:27 | ||
| p6eval | rakudo a389b2: OUTPUT«alive» | ||
| masak | :( | ||
| patrickas | ok i then rt it is | 15:28 | |
| masak | rt.perl.org/rt3/Ticket/Display.html?id=71460 doesn't Null PMC any more, but the fact that it doesn't print "1\\n" is... worrying. | ||
| how can output just disappear like that? | |||
| moritz_ | there are some cases of misguided excpetions that just tear down say() statements | 15:29 | |
| masak | does that imply that there's an exception-catching mechanism within &say? | 15:30 | |
| moritz_ | maybe the execution terminates silently, could also be the case | 15:32 | |
|
15:33
Axius joined
|
|||
| masak | no; see 'say "alive"' above. | 15:34 | |
| oha | rakudo: enum T(a=>2); say a; say 'E'; | 15:35 | |
| p6eval | rakudo a389b2: OUTPUT«2E» | ||
| pmichaud | rakudo: enum ABC <a b c>; say b; | ||
| p6eval | rakudo a389b2: OUTPUT«1» | ||
| pmichaud | rakudo: enum ABC::DEF <a b c>; say b; | 15:36 | |
| p6eval | rakudo a389b2: ( no output ) | ||
| pmichaud | .oO( clue ) |
||
| moritz_ | oha++ told me in private message about a small Match dumper he has written, which shows the structure of a match tree much terser than $/.perl | 15:37 | |
| oha | moritz_, i can share it, just 3 loc | ||
| pmichaud | how do we make it less private? ;-) | ||
| moritz_ | should we have something like that in core? or in an extra module? | ||
| patrickas | oha++ indeed! | ||
| pmichaud | I'd need to see it before knowing how to answer. | 15:38 | |
| patrickas | i got RT# 77162 for me review request :-) (Sorry for the spam) | ||
| jnthn back again | |||
| oha | augment class Match { | ||
| method dump ($d=0) { | |||
| my $s = ' 'x$d; | |||
| my @caps = self.caps; | |||
| return "=> $(self)\\n" unless @caps; | |||
| return (@caps[0].key//'?') ~ " " ~ @caps[0].value.dump($d) if @caps == 1; | |||
| moritz_ | pmichaud: I kinda assumed it was the "I don't want to spam the world" private, and not the "It's sekrit" private :-) | ||
| oha | return "\\n" ~ @caps.map({ | ||
| "$s " ~ ($_.key||'?') ~ " " ~ $_.value.dump($d+1); | |||
| }).join; | |||
| }; | |||
| [particle] points oha at nopaste | |||
| patrickas | welcome back again jnthn | ||
| colomon | I've been thinking of doing something like a Utils::List module (name??) which contains simple implementations of handy tools not spec'd and lots of tests. Seems like oha might want to start something similar for Match? | ||
| jnthn | o/ pmichaud - hope you had a safe journey back :-) | ||
| o/ patrickas | 15:39 | ||
| rcfox | oha: That's more than 3 lines of code. | ||
| pmichaud | jnthn: journey was fine | ||
| long, but fine :) | |||
| hope your journey was enjoyable :) | |||
| moritz_ | colomon: maybe that's a good idea | ||
| rcfox | oha: Also, what about putting it in a role so that you don't have to augment the class? | ||
| pmichaud | in general, I'd like to see .perl be able to do nicer formatting | 15:40 | |
|
15:40
ghyspran joined,
alc joined
|
|||
| pmichaud | (also, I have a few qualms about .perl's specification as well, especially as it relates to item/list handling) | 15:40 | |
| jnthn | pmichaud: Yes, I had a very relaxing few days break (well, in the sense of different rather than just sitting around :-)) | ||
| moritz_ | pmichaud: one of the problems of Match.perl is that it includes the original string within each submatch | 15:41 | |
| we could emit this instead: | |||
| do { my $*O = "abc\\ndef"; Match.new(orig => $*O, from => 0, to => 1) } | 15:42 | ||
| and re-use $*O for all inner Match object | |||
| oha | pmichaud, also, the dump is not something which can be interpreted as perl, but just a very compact output for big trees: nopaste.snit.ch/22694 | ||
| moritz_ | but the fact remains that dumping a Match for human inspection is a very different goal than for re-eval()ing | ||
| oha | moritz_, it would be very difficult to know what has been matched this way | 15:43 | |
| moritz_, indeed | |||
| pmichaud | oha: sure -- I'm just thinking it'd be nice if .perl could also be more human-friendly | ||
| moritz_ | maybe we should have a .human along with .perl :-) | ||
| oha | a sort of .perl(:human) ? :) | ||
| pmichaud | yes, I was just thinking that ".dump" isn't the right name :) | ||
| maybe .fmt ? ;-) | 15:44 | ||
| moritz_ | .fmt is taken | ||
| .structure | |||
| .overview | |||
| oha | .human isn't that bad | ||
| moritz_ | .human | ||
| right :-) | |||
| oha | it is like .perl but not for perl, but for humans :) | ||
| squeeky | .fml ? | ||
| moritz_ | exactly | ||
| .fmh "for mere humans" :-) | |||
| oha | .perl is parseable by perl, .human is pareable by human :) | ||
| pmichaud | in general, I suppose .human could default to .perl | 15:45 | |
| moritz_ | agreed | ||
| colomon | +1 | ||
| pmichaud | I'm not opposed to adding .human into rakudo for now, to experiment with the idea | ||
| then see if it gets adopted as spec | 15:46 | ||
| moritz_ | +1 | ||
| pmichaud | it could also be a module to begin with | ||
| oha | pmichaud, could default to .perl iff then .perl can know it then have to call .human on the childs | ||
| tadzik | maybe something like perl.pretty? | ||
| but that'd be a string method then | |||
| pmichaud | .pretty | ||
| tadzik | .pretty is nice too | ||
| pugssvn | r31959 | moritz++ | [t/spec] adjust some Match.caps and Match.chunks tests to my new understanding of nested match objects. Also fixes an unrelated plan | 15:47 | |
| pmichaud | oha: I would not expect .perl to ever call .human (nor should it need to) | ||
| in general we'd only call .perl for simple data structures | |||
| oha | pmichaud, i can see your point | ||
| moritz_, regarding .caps, does the fix on nqp (flickering caps) got in rakudo now? | 15:48 | ||
| pmichaud | although this does somewhat argue that we'd like to have .dump(:pretty) and .dump(:perl) | ||
| moritz_ | oha: yes | ||
| pmichaud | so that a .dump could take advantage of mmd | ||
| tadzik | that's a lot of typing | ||
| pmichaud | .perl would default to .dump(:perl) | ||
| but this also allows .dump to take other useful options, like indentation level | 15:49 | ||
| .human could default to .dump(:pretty) | |||
| oha | pmichaud, and if there is no "human" flavour, it may use perl, but the childs will again be invoked "human" and eventually fallback | ||
| pmichaud | oha: exactly. | ||
| oha | pmichaud, which is what i was trying to say above :) | ||
| pmichaud | oha: right | 15:50 | |
| moritz_ | the idea is nice, but might suffer from having too many objects in Mu/Any | ||
| pmichaud | but it's not .perl that makes the decision -- it's the .dump that does | ||
| i.e., a .dump that doesn't know how to :pretty or :perl can just do whatever it thinks is correct. | |||
| oha | pmichaud++ | ||
| pmichaud | but it still passes the options on to any .dump's that it calls. | ||
| oha | pmichaud, that seems to me a big rewriting anyway. alot of .perl() are around | 15:51 | |
| pmichaud | oha: oh, it's not nearly so big. | ||
| .perl is easy to write. | |||
| oha | but if you had a .dump() on Mu which call .perl() | ||
| pmichaud | oha: I still claim that's backwards. | 15:52 | |
| oha | i think this would be a start | ||
| pmichaud | .perl should call .dump, not the other way around. | ||
| oha | then .perl() must just be rewritten to call .dump | ||
| exactly | |||
| dalek | kudo: a47c455 | moritz++ | src/builtins/Cursor.pir: [Match] return itemized arrays for quantified positional captures |
||
| pmichaud | moritz_: did it work? | ||
| moritz_ | pmichaud: like a charm | 15:53 | |
| $ ./perl6 -e '.say for ("abc" ~~ /(.)+/).list' | |||
| a b c | |||
| pmichaud | excellent. we'll see if we take much of a speed hit... but this is definitely more correct. | ||
| I can think of a couple of other nqp-rx refactors we'll need to do, now that rakudo's assignment model is more in place. | 15:54 | ||
| okay, afk again for more tutoring | 15:55 | ||
| moritz_ | as an extra bonus, $/.caps now distinguishes (.)**2 from (.)(.) | ||
| moritz_ -> afk, decommuting | |||
| masak | perl5 queue on RT: the first screenful of newest new/open tickets show to four weeks ago. perl6 queue on RT: eight days ago. :) | 15:56 | |
| not exclusively a source of pride, of course. but still pretty cool. | |||
| the rate of Perl 6 bugs reported is basically 4x that of Perl 5 bugs. | 15:57 | ||
| jnthn | Accumulating bug reports. An example of something Rakudo *can* do faster than Perl 5! | 15:58 | |
| colomon | \\o/ | ||
| patrickas submitted his first bug today :-) was always relying on other people submitting things I found | 15:59 | ||
| hopefully it's not a dupe | |||
|
15:59
skangas joined
|
|||
| patrickas | Is there a feed for rakudo bugs ? might be a good idea to subscribe to find things one can work on! | 16:02 | |
| takadonet | I would use that feed | ||
|
16:04
Intensity joined
16:06
isBEKaml joined,
javs joined
|
|||
| masak | I just get them into my email folders. | 16:08 | |
| that's sort of a feed, right? :) | |||
| patrickas | i guess ... | 16:09 | |
| oha | bbl | 16:10 | |
| daxim | needs more atom | 16:13 | |
| patrickas | takadonet here is the feed courtesy of masak++ www.nntp.perl.org/group/perl.perl6..../posts.xml | 16:16 | |
|
16:16
risou_ joined
16:17
tadzik joined
|
|||
| tadzik | masak: I added bin/ support for ufo in my fork. Also it needs no Makefile now, it can bootstrap one | 16:18 | |
| masak: github.com/tadzik/ufo | |||
| masak | tadzik: thanks. remind me tomorrow, and I'll merge it. | 16:19 | |
| patrickas | rakudo: say (1, + * ... *).munch(10).perl; #This is correct behaviour right ? | ||
| p6eval | rakudo a389b2: OUTPUT«(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)» | ||
| tadzik | masak: I'll send you a pull request | ||
| I'm fleeing now, see you later #perl6 | 16:20 | ||
| moritz_ | patrickas: yes | ||
| isBEKaml | rakudo: (1,1 + * ... *).munch(10).perl.say | ||
| patrickas | then I guess we can close rt.perl.org/rt3/Ticket/Display.html?id=74606 | ||
| p6eval | rakudo a389b2: OUTPUT«(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)» | ||
| patrickas | and by we i mean someone with enough privs :-) | 16:21 | |
| moritz_ | patrickas: do we have test coverage? | ||
| isBEKaml | rakudo: (1,-1 + * ... *).munch(10).perl.say | ||
| p6eval | rakudo a389b2: OUTPUT«(1, 0, -1, -2, -3, -4, -5, -6, -7, -8)» | ||
| isBEKaml | I'm still trying to come to grips with * as a form of a closure. :) | 16:22 | |
| pugssvn | r31960 | moritz++ | [t/spec] test for RT #74609, 1, +* ... * series just repeats 1s | 16:24 | |
| moritz_ | just think of every * as a formal parameter... except when they are in the argument list of a routine | ||
| * + 5 => { $^a + 5 } | |||
| *.uc => { $^a.uc } | |||
| * + * => { $^a + $^b } | 16:25 | ||
| isBEKaml | I just thought of them as a place holder but then, we have twigils. | ||
| masak | they are that. | ||
| just shorter :) | |||
| isBEKaml | :) | 16:26 | |
| masak | placeholder parameters are "I'm too lazy to make a signature" | ||
| * is "I'm too lazy to even name my parameters" ! | |||
| moritz_ | and * is "I'm too lazy for the curlies" | ||
| masak | that, too :) | ||
| isBEKaml | or "I'm too lazy to even see parameters " ! | ||
| rakudo: (1, (-1 + *) ... *).munch(10).perl.say | 16:27 | ||
| p6eval | rakudo a389b2: OUTPUT«(1, 0, -1, -2, -3, -4, -5, -6, -7, -8)» | 16:28 | |
| isBEKaml | rakudo++ | ||
| rakudo: (1,-1 ... *).munch(10).perl.say | |||
| p6eval | rakudo a389b2: OUTPUT«(1, -1, -3, -5, -7, -9, -11, -13, -15, -17)» | ||
| patrickas | moritz_ I went in and added the test locallty to reply "we have a test now" and got a conflict on commit :-) | ||
| slavik | I'm too lazy to write code, so I am working on STAR | ||
| moritz_ | patrickas: don't bother, I was faster :-) | 16:29 | |
| takadonet | patrickas: thanks for the feed :) | ||
| isBEKaml | is the -1 passed above to p6eval a step num? | ||
| rakudo: (1,-1 ... *).munch(10).perl.say; # What does the -1 mean here? | 16:30 | ||
| p6eval | rakudo a389b2: OUTPUT«(1, -1, -3, -5, -7, -9, -11, -13, -15, -17)» | ||
| isBEKaml | rakudo: (1,1 ... *).munch(10).perl.say; | ||
| p6eval | rakudo a389b2: OUTPUT«(1, 1, 1, 1, 1, 1, 1, 1, 1, 1)» | ||
| PerlJam | it's the next number in the series. | ||
| to get from 1 to -1, you had to subtract 2, so the series goes 1, -1, -3, etc. subtracting 2 each time | 16:31 | ||
| isBEKaml | Oh, I see. shoulda' seen that! :/ | ||
| patrickas | moritz_ that's why I go tthe conflict ... because you had already added the test at the same line | ||
|
16:33
justatheory joined
|
|||
| moritz_ | patrickas: btw spectesting your patch now... looks good so far | 16:34 | |
| patrickas | moritz_ thanks :-) If it works it'd be my best patch ever 17 lines deleted 0 lines modified 0 lines added :-) | 16:35 | |
| isBEKaml | slackbuilds.org/repository/13.1/dev...nt/parrot/ | ||
| \\o/ | |||
| patrickas | moritz_ also rt.perl.org/rt3/Public/Bug/Display.html?id=75674 can be closed it has passing tests already | ||
| isBEKaml | But rakudo didn't make it, it's still in the pending queue. :( | ||
| patrickas: people love deletion patches! :) | 16:38 | ||
|
16:40
cognominal joined
16:42
Axius joined
16:43
_macdaddy joined
|
|||
| patrickas | rakudo: my $foo = &prefix:<!>;say $foo.signature; | 16:50 | |
| p6eval | rakudo a47c45: OUTPUT«get_attr_str() not implemented in class 'Perl6MultiSub' in main program body at line 1» | 16:51 | |
| pmichaud | that could probably be added if we know what the output should look like. | 16:52 | |
| afk again | 16:53 | ||
|
16:53
flatwhatson joined
16:54
stkowski joined
|
|||
| patrickas | I have no idea ... I was trying ot golf #RT 76046 | 16:56 | |
|
16:57
elmex left
|
|||
| gfldex | does List.sort() relies on infix:<<=>> ? | 16:59 | |
| PerlJam | gfldex: cmp | 17:05 | |
| <=> is numeric, leg is stringy, cmp is ... smart ;) | 17:06 | ||
| rcfox | rakudo: class foo { method postfix:<+> {say "hi";}}; my $a = foo.new; $a+; | ||
| p6eval | rakudo a47c45: OUTPUT«===SORRY!===Confused at line 22, near "$a+;"» | ||
| rcfox | Are there constraints for what can be postfix operators? | 17:07 | |
| gfldex | std: class foo { method postfix:<+> {say "hi";}}; my $a = foo.new; $a+; | 17:08 | |
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mBogus term at /tmp/k20IObdpox line 1:------> [32m:<+> {say "hi";}}; my $a = foo.new; $a+[33m⏏[31m;[0mParse failedFAILED 00:01 116m» | ||
| PerlJam | rcfox: I don't think so. Though, if you're going to overload existing operators, you have to deal with their other uses. | ||
| rcfox | std: class foo { method postfix:<-<--<> {say "hi";}}; my $O = foo.new; $O-<--<; | 17:09 | |
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mUnable to parse quote words at /tmp/uIG6RSCCgo line 1:------> [32mclass foo { method postfix:[33m⏏[31m<-<--<> {say "hi";}}; my $O = foo.new; $[0mCouldn't find final '>'; gave up at /tmp/uIG6RSCCgo line 1 (EOF):------> [32m {say "hi";}}; my $O | ||
| ..… | |||
| avuserow | std: class foo { method postfix:'-<--<' {say "hi";}}; my $O = foo.new; $O-<--<; | ||
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mMalformed block at /tmp/IL1z9yHwVx line 1:------> [32mclass foo { method postfix:[33m⏏[31m'-<--<' {say "hi";}}; my $O = foo.new; $[0m expecting any of: coloncircumfix signatureParse failedFAILED 00:01 112m» | ||
| avuserow | std: class foo { method postfix:<<-<--<>> {say "hi";}}; my $O = foo.new; $O-<--<; | 17:10 | |
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mUnable to parse quote words at /tmp/H_mgaBX5q8 line 1:------> [32m--<>> {say "hi";}}; my $O = foo.new; $O-[33m⏏[31m<--<;[0mCouldn't find final '>'; gave up at /tmp/H_mgaBX5q8 line 1 (EOF):------> [32m {say "hi";}}; my $O = foo.new; | ||
| ..$O-<--<;[3… | |||
| avuserow | std: class foo { method postfix:<< -<--< >> {say "hi";}}; my $O = foo.new; $O-<--<; | ||
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mUnable to parse quote words at /tmp/gDELyZV53i line 1:------> [32m-< >> {say "hi";}}; my $O = foo.new; $O-[33m⏏[31m<--<;[0mCouldn't find final '>'; gave up at /tmp/gDELyZV53i line 1 (EOF):------> [32m {say "hi";}}; my $O = foo.new; | ||
| ..$O-<--<;[3… | |||
|
17:10
synth joined
|
|||
| avuserow | that's an awkward operator to try to define. | 17:10 | |
| rcfox | Well, I'm just playing around anyway. I don't intend to make a -<--< operator. :P | ||
| gfldex | < anystuffhere > is syntax, not operator | ||
| if you want to do that you have to tell the parser | 17:11 | ||
| by extending the perl6 grammar | |||
| rcfox | :\\ | ||
| I don't think it'd make it into the spec. | |||
| gfldex | sounds harder then it is :) | ||
| jnthn | rakudo: sub postfix:<< -<--< >> ($x) { }; say "ok" | 17:13 | |
| p6eval | rakudo a47c45: OUTPUT«ok» | ||
| jnthn | rakudo: sub postfix:<< -<--< >> ($x) { }; 42-<--< | 17:14 | |
| p6eval | rakudo a47c45: OUTPUT«===SORRY!===Confused at line 22, near "42-<--<"» | ||
| jnthn | rakudo: sub postfix:<< -<--< >> ($x) { }; 42\\-<--< | ||
| p6eval | rakudo a47c45: OUTPUT«===SORRY!===Confused at line 22, near "42\\\\-<--<"» | ||
| jnthn | rakudo: sub postfix:<< <--< >> ($x) { }; 42<--< | ||
| p6eval | rakudo a47c45: OUTPUT«===SORRY!===Confused at line 22, near "42<--<"» | ||
| jnthn | Yeah, think that one ain't really going to work out. | 17:15 | |
|
17:16
risou joined
17:22
pmurias joined
|
|||
| pmurias | ruoso: how should the smop module which initalizes everything and creates an interpreter be called? | 17:23 | |
| dalek | kudo: 6b318ea | (Patrick Abi Salloum)++ | src/core/operators.pm: removed a bunch of hopefully unneeded code |
17:26 | |
| rokoteko | std: sub postfix:['<--<'] () { say "hi." }; 42<--< | ||
| p6eval | std 31912: OUTPUT«ok 00:03 119m» | ||
| TiMBuS | rokoteko.. that code managed to hang rakudo | 17:30 | |
| rokoteko | std: sub postfix:['-<--<'] is tighter:<-> () { say "hi." }; 42-<--< | 17:31 | |
| p6eval | std 31912: OUTPUT«ok 00:01 119m» | ||
| rcfox | rokoteko: Nice. | 17:37 | |
| avuserow | :D awesome, rokoteko++ | 17:39 | |
|
17:41
dwierenga joined
17:45
Italian_Plumber joined
17:49
pyrimidine joined
17:51
Axius joined
17:53
ashleydev joined
17:54
Axius_ joined
17:55
AndreasX joined
17:56
Axius__ joined
17:58
justatheory joined
17:59
Axius joined
18:17
ashleydev joined
|
|||
| rcfox | Gah, I accidentally left perl6 running with the stickman. | 18:17 | |
| Now my laptop is hot, and unhappy. | 18:18 | ||
| cognominal | rcfox, what is a stickman? | 18:21 | |
| rcfox | sub postfix:['-<--<'] () {}; 0-<--< | 18:22 | |
| STD parses it, but Rakudo just hangs. | |||
| I forgot to kill it before I went grocery shopping. | 18:23 | ||
|
18:25
mtve joined
18:28
Axius_ joined,
Axius___ joined
18:33
Axius joined
|
|||
| cognominal | in the Perl6 shell, should not one be able to redefine anything in the current scope. UNIT? | 18:34 | |
| [Coke] | colomon: ping. | 18:35 | |
| colomon | pong | ||
| [Coke] | colomon: where is your frabujous joy? | ||
| colomon | [Coke]: has thou slain the Jabberwock? | 18:37 | |
|
18:37
Axius_ joined
|
|||
| [Coke] | colomon: RT #75768 | 18:38 | |
| I just found the body. | |||
| colomon | oh, nice! | 18:40 | |
| star: say (1...10)[2...4] | |||
| p6eval | star 2010.07: OUTPUT«345» | ||
| colomon | star: say (1...10)[2..4] | ||
| p6eval | star 2010.07: OUTPUT«345» | ||
| colomon | oh, sure, it was one of *those* bugs. :) | 18:41 | |
| pmichaud slew the Jabberwock a couple of weeks ago, then. | |||
|
18:44
astrojp joined
|
|||
| jasonmay | star: (1,2,4,8 ... 64)[3..5] | 18:44 | |
| p6eval | star 2010.07: ( no output ) | ||
| colomon | star: say (1,2,4,8 ... 64)[3..5] | 18:46 | |
| p6eval | star 2010.07: OUTPUT«81632» | ||
| colomon | star: say ~(1,2,4,8 ... 64)[3..5] | ||
| p6eval | star 2010.07: OUTPUT«8 16 32» | ||
|
18:56
Axius joined
18:59
erichk joined
|
|||
| gfldex | std: class A {}; class B is A {}; class C is A {}; my $b = B.new(); my $c = C.new(); my A @l; @l.push(B.new(), C.new()); @l.sort; | 19:06 | |
| p6eval | std 31912: OUTPUT«ok 00:01 117m» | ||
|
19:06
c0nspiracy_ joined,
cono joined
|
|||
| gfldex | rakudo: class A {}; class B is A {}; class C is A {}; my $b = B.new(); my $c = C.new(); my A @l; @l.push(B.new(), C.new()); @l.sort; | 19:06 | |
| p6eval | rakudo 6b318e: OUTPUT«maximum recursion depth exceeded in 'at_pos' at line 5:CORE.setting in 'at_pos' at line 7:CORE.setting in 'Any::postcircumfix:<[ ]>' at line 1658:CORE.setting in 'at_pos' at line 5:CORE.setting in 'at_pos' at line 7:CORE.setting in 'Any::postcircumfix:<[ ]>' at | 19:07 | |
| ..line 165… | |||
| gfldex | rakudo: class A {}; class B is A {}; class C is A {}; my $b = B.new(); my $c = C.new(); my @l; @l.push(B.new(), C.new()); @l.sort; | ||
| p6eval | rakudo 6b318e: ( no output ) | ||
| gfldex | i is bugcat, i makes bugs | ||
|
19:12
vcrini joined
19:15
Axius joined,
erik_ joined
19:19
rindolf joined
|
|||
| rindolf | Hi all. | 19:20 | |
|
19:20
nimiezko joined
|
|||
| colomon | o/ | 19:20 | |
| rindolf | colomon: what's up? | 19:21 | |
| colomon: do you only have one hand? | |||
| colomon | I'm working on $work at the moment. | ||
| I only wave one hand at a time. | |||
| rindolf | colomon: ah. | ||
| colomon | unless I'm excited: \\o/ | 19:22 | |
| PerlJam | colomon: then you have no hands? | 19:23 | |
| gfldex | he is waving so fast that his hands blur out | ||
|
19:23
hugo_ joined
|
|||
| hugo_ | hi | 19:24 | |
| takadonet | hugo_: hey | 19:25 | |
|
19:25
uniejo joined
|
|||
| gfldex | rakudo: class A { has $.b }; my @l; @l.push(A.new(:b('peng'))); say *.b for @l; | 19:25 | |
| p6eval | rakudo 6b318e: OUTPUT«_block148» | ||
| gfldex | std: class A { has $.b }; my @l; @l.push(A.new(:b('peng'))); say *.b for @l; | ||
| p6eval | std 31912: OUTPUT«ok 00:01 115m» | ||
| gfldex | should that work? | ||
| colomon | I don't think so. | 19:26 | |
| gfldex | rakudo: class A { has $.b }; my @l; @l.push(A.new(:b('peng'))); *.b.say for @l; | ||
| p6eval | rakudo 6b318e: ( no output ) | ||
| gfldex | rakudo: class A { has $.b }; my @l; @l.push(A.new(:b('peng'))); .b.say for @l; | ||
| p6eval | rakudo 6b318e: OUTPUT«peng» | ||
| gfldex | bit odd that *.b.say doesnt work | 19:27 | |
| colomon | rakudo: class A { has $.b }; my @l; @l.push(A.new(:b('peng'))); say (*.b)($_) for @l; | ||
| p6eval | rakudo 6b318e: OUTPUT«peng» | ||
| colomon | It's not odd. *.b creates a closure which takes one object and applies .b to it. | ||
| it's like -> $a { $a.b } | 19:28 | ||
|
19:28
vcrini joined
|
|||
| gfldex | i c | 19:28 | |
| should the compiler warn in that case? | |||
| colomon | it's a little more obvious if you think of it using map | 19:29 | |
| pmurias | ruoso: 'use v6-mildew' in modules works | ||
| colomon | because @l.map(*.b) applies .b to each element but doesn't say it. | ||
| whereas @l.map({ say *.b }) just says the closure once for each element of @l. (thus "_block148") | 19:30 | ||
| gfldex | i agree on what it does and why, but it's going to the noob-FAQ for sure :) | ||
| ruoso | pmurias, that's awesome... and I think that fills up the gsoc requirements | ||
| rcfox | What is v6-mildew? | 19:32 | |
|
19:33
Axius joined
|
|||
| pmurias | ruoso: i added a main module to smop which supplies a smop_main_get_interpreter function | 19:33 | |
|
19:33
awwaiid_web joined
|
|||
| gfldex | if i want to provide a custom sort(ing), do i have to overload infix:<cmp> ? | 19:34 | |
| awwaiid_web | Greetings! I expected "7 leg 62" to give the same thing as "7 <=> 62" but it does not (in rakudo* release). Am I wrong or is Rakudo? | ||
| colomon | gfldex: no, you can pass a comparison function to sort | ||
| awwaiid_web: you're wrong | 19:35 | ||
| gfldex | colomon: that's what i don't want to do | ||
| pmurias | rcfox: it's a module which allows you to put 'use v6-mildew' on top of your perl5 files to have mildew run them | ||
| colomon | 7 leg 62 is effectively "7" leg "62" | ||
| awwaiid_web | I thought lexographic meant numeric+alphabetical? | 19:36 | |
| colomon | awwaiid_web: leg is string comparison | ||
| it converts both arguments to strings, then compares them. | |||
|
19:36
astinus joined
|
|||
| colomon | gfldex: then I completely fail to understand your question. | 19:37 | |
| sjohnson | leggo my eggo | ||
| awwaiid_web | so <13 23 42 67 7>.sort doesn't do what I want on purpose then | ||
| gfldex | colomon: point of operator overloading is (AFAIUI) that even the core part is then going to use those operators | ||
| colomon: if sort is ignoring those operators it's ... kinda odd | 19:38 | ||
| or do i have to overload that sort function to work with my custom type? | |||
| colomon | awwaiid_web: that might be sort of a bug (there are fancy rules for constructs that are like <2 423 34>, NYI in rakudo), but no, it's not. | 19:39 | |
|
19:39
jfried joined
|
|||
| colomon | gfldex: if you want to provide default sorting for a new type, then yes, overloading infix:<cmp> is the way to do it. | 19:39 | |
| gfldex | colomon: as a method in that type or as a sub outside of it (c++ -stype) | 19:40 | |
| colomon | awwaiid_web: (13, 23, 42, 67, 7).sort will do a numeric sort, though | ||
| gfldex: sub inside of it might be the best way to do it at the moment. | 19:41 | ||
| star: <13 23 42 67 7>.sort.perl.say | |||
| p6eval | star 2010.07: OUTPUT«("13", "23", "42", "67", "7")» | ||
| sorear | good * #perl6 | ||
| colomon | star: (13, 23, 42, 67, 7).sort.perl.say | ||
| p6eval | star 2010.07: OUTPUT«(7, 13, 23, 42, 67)» | ||
| awwaiid_web | what sort op does sort use internally? I for some reason thought it was leg | ||
| colomon | awwaiid_web: it uses cmp. | 19:42 | |
| awwaiid_web | star: (13, 23, 42, 67, 7).sort({ $^a cmp $^b}).perl.say | ||
| p6eval | star 2010.07: OUTPUT«(7, 13, 23, 42, 67)» | ||
| awwaiid_web | sweet | ||
| ok, many thanks | |||
| gfldex | colomon: seams not to work for me, could you have a look pls? gist.github.com/519598 | 19:43 | |
| colomon | gfldex: even if defined in a class, subs do not have a self. | ||
| awwaiid_web | colomon++ # sorting sorting | ||
| colomon | your first infix:<cmp> should look a lot more like your second. | 19:44 | |
|
19:44
tylercurtis joined
|
|||
| colomon | star: (13, 23, 42, 67, 7).sort({ $^a leg $^b}).perl.say | 19:44 | |
| p6eval | star 2010.07: OUTPUT«(13, 23, 42, 67, 7)» | ||
|
19:47
[1]Casan joined
|
|||
| astrojp | I'm building Rakudo *. After it's finished I'd like to read some introductory stuff on it, like how to create variable, functions, loops, conditionals. And more importantly, how to create classes, objects, class methods...etc...I need beginner stuff. I know nothing about Perl 5. | 19:47 | |
| gfldex | astrojp: perlgeek.de/en/article/5-to-6 | 19:48 | |
| moritz_ | astrojp: did you try to read the book that's shipped with R*? | ||
| gfldex | astrojp: www.perl6.org/documentation/ | ||
| astrojp | gfldex, moritz_: no, i haven't tried reading the book that's shipped with it. I'll start there and see how it goes. I'll try the www.perl6.org/documentation as well. Thanks. | 19:51 | |
|
19:54
araujo joined
19:56
ashleydev joined
19:57
araujo joined
20:06
PhatEddy joined
|
|||
| PhatEddy | rakudo: my @a; @a //= (3); @a.perl.say | 20:06 | |
| p6eval | rakudo 6b318e: OUTPUT«maximum recursion depth exceeded in 'Block::count' at line 5609:CORE.setting in 'Block::count' at line 5613:CORE.setting in 'Any::join' at line 1 in 'Array::perl' at line 2821:CORE.setting in <anon> at line 2821:CORE.setting in 'Any::join' at line 1 in | ||
| ..'Array::perl' a… | |||
| PhatEddy | rakudo: my @a; @a ||= (3); @a.perl.say | ||
| p6eval | rakudo 6b318e: OUTPUT«[3]» | 20:07 | |
| astrojp | moritz_: Cool, the .pdf that comes along with the install "Using Perl 6" is pretty neat, looks like it has all I need to get started. Thanks again. | ||
|
20:08
[Coke] joined
|
|||
| slavik | the question is: how do I install Perl6 into my brain? | 20:08 | |
| PerlJam | slavik: osmosis | ||
| slavik: and lots of practice | |||
| gfldex | colomon: updated: gist.github.com/519598 | 20:09 | |
| colomon: i have to do @fruits.sort(&infix:<cmp>); or it wont call the user defined operator | |||
| colomon: is that a bug? | |||
| PhatEddy | I think my critter may be new - any objection to reporting it? I searched perlbug for "// perl6" and didn't find a match. | 20:10 | |
|
20:10
Mowah joined
20:11
masak joined
|
|||
| masak | ahoy! | 20:11 | |
| gfldex | o/ | 20:12 | |
| jnthn | ako sa masak? | 20:13 | |
| masak | :P | 20:14 | |
| that's punderful. | |||
| colomon | gfldex: I think I know why it's happening, and I'd definitely say it's a bug. | 20:16 | |
| gfldex | our multi method sort(&by = &infix:<cmp>) { self.list.sort(&by); } | ||
| that's from Any-list.pm | |||
| when is that &by = evaluated? | |||
|
20:16
skangas joined
|
|||
| colomon | gfldex: I dunno. | 20:17 | |
|
20:17
skangas joined
|
|||
| colomon | but I think what's happening is that sort gets infix:<cmp> before your infix:<cmp> is defined. | 20:17 | |
| gfldex | anyway, that bug has to come from the dispatcher somehow | ||
| where did bugcat went to? | 20:18 | ||
| kitty kitty kitty | |||
| colomon | actually, that is (in general) the desired behavior, I'm told. | ||
|
20:18
Su-Shee left
|
|||
| colomon | but I think sort is an example where it shouldn't work that way. | 20:18 | |
| there's supposed to be a keyword to deal with it, but it's NYI in rakudo so far as I know. | |||
| jnthn | It should be evaluated once per time we bind the signature | 20:19 | |
| gfldex | what keyword would that be? | ||
| tylercurtis | lift? | ||
| jnthn | But it's going to look for a cmp in the lexical scope of the setting. | ||
|
20:19
c0nspiracy_ joined
|
|||
| colomon | lift, I think | 20:19 | |
| jnthn | Yes, lift is meant to deal with this issue, in theory. | ||
| colomon | jnthn++ # for knowing what is going on better... | ||
| gfldex | it's very undwimmy to require a keyword for that | ||
| all c++ dudes and dudettes will be very confused :) | 20:20 | ||
| jnthn | gfldex: It's just a natural result of lexical scoping. :-) | ||
| gfldex | if i overwrite an operator i want it to be called, or i don't need to overwrite it | ||
| colomon | jnthn: Do you agree with my intuition that sort should be doing the lift automatically? | ||
| masak refrains from gossiping about mst banning pudge from #perl :) | 20:21 | ||
| gfldex | if it doesn't ppl will overwrite sort instead | ||
| [Coke] | masak: that was bizarro. | ||
| jnthn | colomon: It sounds kinda sane, I'd have to re-read the spec for lift. | ||
| masak | [Coke]: if you ask me, pudge's blog post and the comments he made don't speak in his favour. use.perl.org/~pudge/journal/40492 | 20:22 | |
| jnthn | masak: Refrainataion fail. :P | ||
| masak | jnthn: that's the thing about gossip. it doesn't work if you don't not refrain. :P | ||
| gfldex | masak: so, now tell us the story then | 20:23 | |
| masak | gfldex: pudge was kicked by mst. that's all I know. | ||
| plus the blog post I linked above. plus this: twitter.com/shadowcat_mst/status/20901428800 | 20:24 | ||
| colomon | jnthn: I dunno if the spec mentions lift explicitly, but the idea that sort shouldn't Do The Right Thing by default for user-defined classes seems very wrong. | ||
| PerlJam | Hmm. | ||
| masak | in order to rationalize my mentioning it here, consider it all from a community perspective. | ||
| colomon | jnthn: but then, requiring lift for operators in general seems like a horrible kludge in p6 to me. | 20:25 | |
| masak | how far can/should we go to preserve the atmosphere of a channel? | ||
| colomon: how do you mean? | |||
| gfldex | i was kicked from channel a few times to and i consider it the right thing to do at those times :) | ||
| masak | colomon: I think it seems like a very pretty solution. something that would have required a nasty workaround if lift weren't there. | ||
| PhatEddy | rakudo: my @a //= (); @a.perl.say | 20:26 | |
| p6eval | rakudo 6b318e: OUTPUT«maximum recursion depth exceeded in 'Block::count' at line 5609:CORE.setting in 'Block::count' at line 5613:CORE.setting in 'Any::join' at line 1 in 'Array::perl' at line 2821:CORE.setting in <anon> at line 2821:CORE.setting in 'Any::join' at line 1 in | ||
| ..'Array::perl' a… | |||
| colomon | masak: my problem is that I have a hard time understanding why you might have a case where you do not want to use lift. | ||
| jnthn | lift is kinda the fallout we get for going lexical. OTOH, if we didn't go lexical we'd have no lift, just fallout everywhere. :-) | ||
| masak | PhatEddy: groovy error! | ||
| PhatEddy: is it from RT, or did you find it? | |||
| jnthn: :) | 20:27 | ||
| colomon | for the programming I've done, have lift be default and a new keyword for no-lift seems much more intuitive. | ||
| PhatEddy | masak: I just commented on that about 15 minutes ago and have now submitted it ... | ||
| masak | I for one would really like a simple blog post about how lift works, and when to use it. someome pls write it. :) | ||
| gfldex | the point about operator overloading is that you get some very cheap generic programming | ||
| masak | PhatEddy++ | ||
| tylercurtis | jnthn: if I understand correctly, does that mean that specific variants of multis are lexical? | 20:28 | |
| [Coke] | masak: I don't see anything there there is really anti-pudge other than the sentiment of the current ops. | ||
| tylercurtis | Or just multi operators? | ||
| masak | [Coke]: maybe not. I'm kind curious what pudge actually wrote to get banned. | 20:29 | |
| tylercurtis | Or do I totally misunderstand why that code doesn't do what gfldex means? | ||
| colomon | tylercurtis: specific variants are lexical, right. | 20:30 | |
| masak | [Coke]: but reacting to a ban by writing 'is insane' and 'irrational dick' in public isn't what I'd call mature. even if there were absolutely no good reason whatsoever to ban pudge, which I suspect there might've been. | ||
| [Coke] | masak: absolutely nothing that I could see. | ||
| masak: you're clearly not in #perl. | |||
| masak | oh, you were there? | ||
| no, I'm not. | |||
| [Coke] | that is something you'd say to your grandmother in that channel. | ||
| -> $DAYJOBBING | 20:31 | ||
| (not any more. the constant trash talk is hard to keep up with.) | |||
| (but was there for the ban, yes.) | |||
| masak | ok. | ||
| PhatEddy | rakudo: my @a ||= (); @a.perl.say | ||
| jnthn | tylercurtis: Yes; additional variants are lexically scoped. | ||
| p6eval | rakudo 6b318e: OUTPUT«[]» | ||
| tylercurtis | Interesting. | 20:32 | |
| pmurias | tylercurtis: hi | ||
| tylercurtis: is the repo still broken for you? | |||
| jnthn | rakudo: multi foo() { say 1 }; { multi foo($x) { say 2 }; foo(); foo('lol'); }; foo(); foo('lol'); | 20:33 | |
| p6eval | rakudo 6b318e: OUTPUT«121No applicable candidates found to dispatch to for 'foo'. Available candidates are::() in main program body at line 22:/tmp/6bosqyPPvM» | ||
| jnthn | tylercurtis: ^^ Short example. | ||
| masak | tylercurtis: and it works similarly with methods and inheritance. | 20:36 | |
| colomon | and it makes perfect sense there. it's the other way around where it gets weird. | 20:37 | |
| wolverian | lift? we have monads in perl6 now? *reads* oh... | ||
| tylercurtis | pmurias: Yes. Looking at svn.pugscode.org/pugs/v6/v6-mildew/lib/, it appears as though the v6/v6-mildew/lib/V6/ dir is still around, but empty. | ||
| pmurias | :( | 20:39 | |
| git-svn doesn't remove dirs | |||
| tylercurtis: can you delete it by supplying the URL to svn? | 20:40 | ||
| tylercurtis | pmurias: I'll try. | 20:41 | |
| pugssvn | r31961 | tcurtis++ | pmurias++ moved the contents of this. Deleting it so we HFS users can co. | 20:43 | |
| pmurias | ruoso: i'm uploading new Mildew,SMOP,Mildew-Setting-SMOP to CPAN | 20:44 | |
| ruoso: so i should now focus on cleaning up stuff/adding more tests/docs to things | |||
| and checking if everything works on a fresh perl | 20:45 | ||
| jdv79 | jnthn: is there a copy of your MOP grant proposal online? | 20:46 | |
| jnthn | jdv79: Was posted on news.perlfoundation.org | 20:50 | |
|
20:50
Italian_Plumber joined
|
|||
| jnthn | jdv79: news.perlfoundation.org/2010/07/hag...eta-m.html | 20:52 | |
| gfldex | if parametric roles would be used (whatever generic stuff would fit) for implementing sort, would lift still be needed? | 20:53 | |
| tylercurtis | pmurias: "Checked out revision 31961." URL-based deleting worked. Thanks. | ||
| jdv79 | missed it somehow. thanks. | ||
|
20:54
ashleydev_ joined
|
|||
| sorear | jnthn: hi | 20:57 | |
| jnthn | o/ sorear | ||
| sorear | jnthn: I hear you want to work on a Perl 6 metamodel for the Common Type System | 20:58 | |
| jnthn | sorear: Well, I want to work on a Perl 6 meta-model design that I can put on Parrot, the CLR, the JVM, etc. to ease Rakudo porting to 'em all. :-) | ||
| masak | it's interesting how both the Perl 6 regexes and the Perl 6 meta-model form bootstrapping strange loops at the bottom of Perl 6. | 21:00 | |
| jdv79 | i get the feeling the full "promise" of parrot is being abandoned in favor of a more reality based approach. | 21:01 | |
| nice | 21:02 | ||
| jnthn | masak: I read a paper on the train yesterday that suggested we could do a strange helix instead. :P | 21:03 | |
| (OK, OK, that's not *quite* what it said... :-)) | 21:04 | ||
| masak | jnthn: that sounds interesting. what did the paper in fact say? | 21:05 | |
| PerlJam | wow... I was just looking through some old IRC logs from 1999 and say this: <purl> oh, the famous "it doesn't work" bug. or fixed in perl6 | ||
| that's from March 30, 1999 | |||
| s/say/found/ | |||
| (another weird mis-word) | |||
| masak | PerlJam: wow, that's pretty early. considering the perl6 effort was announced 16 months later. | 21:06 | |
| PerlJam | Indeed. | ||
| though Topaz happened in 1998 or so, so the idea of "perl 6" was around before the coffee mug incident | 21:07 | ||
| jdv79 | who remembers topaz? | ||
| PerlJam | apparently I do :) | ||
| jnthn | masak: www2.parc.com/csl/groups/sda/public...or-web.pdf | ||
| masak | PerlJam: oh, that's true. | ||
| jnthn | masak: Should add that one to my papers list. :-) | ||
| masak reads | 21:08 | ||
|
21:08
simon__ joined
|
|||
| masak | or skims, as it were. | 21:08 | |
| 'Avoiding Confusion in Metacircularity: The Meta-Helix' | |||
| I already like this paper. | |||
| jnthn | masak: Yes, it took me two reads of it to realize what implementing the idea it suggests would look like. | 21:09 | |
| (Basically, nothing that we can't do with Perl 6 as already spec'd.) | |||
| masak | woot | ||
| jnthn | It's worth reading for the exploration of meta-circularity. | ||
| masak | 'The intuition behind the meta-helix is that even though the extended and non-extended languages may be very similar, the fact that one is used to implement the other makes it important to reify them as distinct entities.' -- sounds like nqp and Perl 6 to me. | 21:10 | |
| jnthn | May be a little relevant. | ||
| jdv79 | everything new is old again? | 21:11 | |
| unique ideas are rare i think these days | |||
| sorear | Wow, a CS paper I haven't read | ||
| masak | it would be interesting to hear what the "Metaobject Protocol" people would say about this paper. | ||
| sorear fixes | 21:12 | ||
| masak | sorear: I like your attitude. it's not humble, it's the other thing. :P | ||
| I like that. | |||
| jnthn | jdv79: Aye, the paper basically boils down to class MyMetaClass { has $!inner-meta-class handles *; method add_method($obj, $name, $meth) { ...; $!inner-meta-class.add_method(...); } } # or some other methods you care to override | ||
| tylercurtis | masak: as in, the "The Art of the Metaobject Protocol" people? | ||
| masak | tylercurtis: right. those. | 21:13 | |
| tylercurtis | masak: because one of them appears to have been one of the writers. | ||
| masak | oh :) | ||
| tylercurtis++ # meta-research | |||
| not only one of the authors of the book, but the main author. at least if they're listed by importance. | 21:17 | ||
| jdv79 | nice synopsis | 21:18 | |
|
21:19
meinwald joined
21:20
whiteknight joined
21:24
mj41 joined
21:26
Guest23195 left
|
|||
| masak | 'night, #perl6. | 21:26 | |
|
21:27
mtve joined
21:37
ashleydev joined
|
|||
| pmurias | jnthn: could you show me your papers list? | 21:40 | |
| ruoso | pmurias, yes... now it's just closure... make sure everything is cleaned up and tested | 21:41 | |
| jnthn | pmurias: It's only 2 papers long so far...but growing at 6guts.wordpress.com/interesting-papers/ | 21:42 | |
| (got more to add, just not yet got around to it) | |||
| Early night for me today... o/ | 21:43 | ||
|
21:43
Woody2143 joined
21:49
Casan joined
21:50
fod joined
21:51
astrojp left
22:01
ashleydev_ joined
22:02
Psyche^ joined,
drbean joined
|
|||
| gfldex | std: my @a = <a bb>; @a.sort:*.bytes; | 22:07 | |
| p6eval | std 31912: OUTPUT«[31m===[0mSORRY![31m===[0mConfused at /tmp/XaAnHwow3r line 1:------> [32mmy @a = <a bb>; @a.sort:[33m⏏[31m*.bytes;[0m expecting any of: coloncircumfix signatureParse failedFAILED 00:01 116m» | ||
| gfldex | std: my @a = <a bb>; @a.sort: *.bytes; | ||
| p6eval | std 31912: OUTPUT«ok 00:01 116m» | ||
|
22:16
meppl joined
22:29
ashleydev joined
22:35
Packetknife joined
22:41
c0nspiracy joined
22:49
tom_tsuruhara joined
23:19
IllvilJa joined
23:28
revolve left
23:43
ashleydev_ joined
23:46
_dolmen_ joined
23:52
tylercurtis joined
|
|||