perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/
Set by mncharity on 25 March 2009.
ruoso wayland76, hi 00:04
wayland76 Question: Should IO::Listening be merged into IO::Socket?
(I'm in the middle of revision the S32/IO stuff) 00:05
ruoso well... it certainly is Socket specificc
wayland76 Can't be used by pipes as well? 00:06
Or are pipes handled by the Socket interface?
ruoso not at all...
wayland76 ok
I'll merge it into IO::Socket then
ruoso pipes are most fundamental than socket
00:07 Kisu left 00:08 Kisu joined 00:12 hercynium joined 00:15 M_o_C left 00:18 wknight8111 left 00:22 DemoFreak left 00:26 FurnaceBoy left
pugs_svn r26030 | wayland++ | S32/IO: 00:30
r26030 | wayland++ | - Merged IO::Listening into IO::Socket
r26030 | wayland++ | - Made IO::Socket implement IO::Closeable
r26030 | wayland++ | - Added a $.Listening attribute to IO::Socket.
wayland76 I'll also make all sockets do Streamable, right? 00:34
00:36 lumi_ joined 00:47 lumi left, lumi_ is now known as lumi
pugs_svn r26031 | wayland++ | S32/IO: Expanded IO::Socket, mostly at the expense of IO::Socket::INET. 00:48
00:53 Sepheebear joined 01:10 cognominal left 01:41 c9s_ joined 01:42 r00t_byte joined 01:45 c9s left 01:52 c9s joined 01:53 agentzh left 01:54 agentzh joined
s1n frioux ping 01:54
frioux s1n: pong
01:56 Student joined 02:00 kimtaro left 02:01 cognominal joined, c9s_ left 02:03 Student left
dalek kudo: c015556 | pmichaud++ | (6 files):
Bring Rakudo up-to-date with recent PGE and compiler tools

accurately reflect recent changes in S05).
02:08
Tene pmichaud: talked with jnthn yet about leave?
02:09 kimtaro joined 02:13 mncharity joined
mncharity did a "Perl 6 - it's a new Common Lisp" sub-lightning talk at this evenings boston-lisp. went over pretty well. :) 02:15
wayland76 Great :) 02:18
02:18 r00t_byte left
s1n mncharity: common lisp, seems like an insult 02:18
mncharity basically starts as a "Common Lisp is unique" talk. "has a set of language features no other language has". shows the names of lots of languages scattered across the slide. for feature X, fade out languages which don't have it (usually most). finally, "combining these all, CL is unique"... fades to CL in 02:19
one corner, Perl 6 in another. "err, well, how to rescue this hypothesis..." next slide, "Perl 6 - it's a new Common Lisp".
s1n: to CL or p6? 02:20
s1n comparing anything to CL
sounds like a death kiss 02:21
wayland76 Not at a boston-lisp talk, presumably :)
I kind of wonder, though, how we appeal to the PHP/python crowd :) 02:22
mncharity that's easy... { use Python; ... }
s1n i suspect not at all
perl6 is significantly heavier on the twigils/operators/etc than perl5, and that was the source of lots complaints about perl5 02:23
(from non-perl developers anyways) 02:24
mncharity on the infinite todo (short one) for elf, is getting some other languages working as language-X-to-p6 translators, to vastly increase the body of p6 tests. javascript before python though (at least if I do it). probably ruby too.
js is actually not hard. there's a one-day hack at it somewhere in the pugs tree.
02:24 SamB left
wayland76 s1n: is it possible to avoid a fair amount of the twigils/operators if you don't like them? 02:26
mncharity s1n: there's no reason $ perl6 foo.py shouldn't work just fine. don't have to care about twigils one never sees.
wayland76 (ie. when writing your own code)
mncharity pypy has done all the hard work.
s/all/almost all/ 02:27
still need a p6 implementation though. that's the real hard part.
02:27 SamB joined
mncharity $ perl6 -MLanguage::Friendly foo.py perhaps 02:28
02:28 PZt left
mncharity $ perl6 -MLanguage::Friendly foo.py bar.rb hee.php 02:29
though someone other than me would have to do hee.
but anyway, p6 and CL are actually very close in concept and design philosophy. aside from a slight disagreement on what's sane syntax. "P6 - it's a metastasized reader macro". 02:31
"P6 - the only way python will ever get non-toy multiple-dispatch" 02:33
literal s1n: the only possibly bad thing I can think about Perl 5 sigils have been fixed in Perl 6, in my opinion 02:35
mncharity wayland76: s1n: thanks for the comments anyway. :) I feared #perl6 dead air.
literal that would be the variant sigil thing (@array -> $array[1]), which confuses some, and the sometimes hairy dereferencing syntax 02:36
mncharity literal: how about, sigils exist? /me expects a { use Sigiless; ...} module as soon as the grammar and its surround support that. Probably quite popular in some circles.
literal no sigils? but I want interpolation :) 02:37
mncharity :)
literal and a separate namespace from subs
mncharity ah. I'm thinking foo parses as $foo . but feel free to use "a$foo". though "a{foo}b" is close. re subs, perhaps trailing parens distinguish. 02:38
atleast from folks coming from a language which uses them. making ml'ers/haskellers happy is more of a challenge perhaps. 02:39
maybe typing.
literal it's not just subs though, some other keywords as well
mncharity ? 02:40
don't use a variable named next ?
literal or for, or last, or if...
mncharity most langauges live with that. one gets use to it. 02:41
frioux rakudo: say 'foo'
p6eval rakudo c01555: OUTPUTĀ«fooā¤Ā»
mncharity though I note you are making a CL-like argument... "lisp-2 is better than lisp-1" :)
P6: "but if lisp-2 is better than lisp-1, think how great lisp-7 will be!" 02:42
for some value of 7. it's been a while since I've counted the p6 namespaces, don't remember how it turned out (12?), and has probably changed.
to save folks the google: CL is a lisp-2, functions and variables are in different namespaces. in (x x) , x and x refer to different things. the symbol x is like a glob, with separate "function" and "value" slots. in scheme, a lisp-1, x and x are the same. in p5, a lisp-5+ (?), you can have f($f,@f,%f,...). 02:45
02:50 dKingston left, PZt joined
mncharity notes the irclog.perlgeek.de is creating broken links for S32, namely perlcabal.org/syn/S32.html . 02:52
wayland76 @tell moritz_ mncharity notes the irclog.perlgeek.de is creating broken links for S32, namely perlcabal.org/syn/S32.html . 02:53
lambdabot Consider it noted.
mncharity :) 02:54
wayland76 It's not what you know, it's who you know :)
(well, maybe :) )
mncharity lol
at boston-lisp, someone clueful actually made the argument that CL's lack of standardized posixy things like chmod() wasn't a problem. sigh. standardized chmod++. 02:55
wayland76 Well, I don't like them, but I agree we have to have them :) 02:56
mncharity :) not like? 02:57
02:57 mikehh joined
wayland76 Well, I don't like chmod because it ties us to a particular permissions model 02:58
If we had a more ACL-based model, people would be happier about adding new filesystem attributes 02:59
mncharity yeah
wayland76 But OTOH, I think people need to be able to call chmod at least as a legacy interface
mncharity hmm, instead of chmod LIST , why isn't that chmod PERM, FILES 03:00
then chmod can multi dispatch on PERM.
oh, LIST context? err. hmm. /me puzzled. 03:01
03:01 hudnix left
mncharity but anyway, should be able to multi-dispatch on the permissions argument. 03:01
wayland76 Well, according to the spec at the moment, .chmod is only applicable to IO::FSNode::Unix
And then ACLs are the "standard" interface, to be used with the knowledge that some OSs/filesystems will support more stuff than others 03:02
To be fair, though, it's a draft spec :) 03:03
diakopter well, a new group can be created for any ACL you want
under-the-covers
(I'm [perhaps wrongly] assuming groups can be members of groups) 03:04
presuming
mncharity chmod 'user_r:user_t:s0' foo; multi chmod (Str $acl, *@files) { ... } ? 03:05
wayland76 diakopter: I don't understand your first statement
mncharity though obviously probably want to objectify that user_r:user_t:s0 . 03:06
(example from SELinux) 03:07
wayland76 mncharity: Did you see ruoso's example on #november-wiki yesterday? 03:08
multi uri($uri where /^http:/)
03:08 hudnix joined
mncharity hadn't. neat. instance-types++ 03:08
wayland76 O
mncharity another similarity with common lisp. ;)
meppl good night 03:09
mncharity err, "predicate types" (not "instance types")
03:09 orafu left
wayland76 I'd been arguing in favour of a global variable, but when I saw that, I said "Can we do that? Lets do that then!" 03:09
mncharity g'night meppl :)
meppl ;)
03:09 c9s_ joined
wayland76 'night 03:09
03:09 OuLouFu joined
meppl ;) 03:09
03:10 meppl left
mncharity traditional problem is that predicate dispatch is kind of expensive. but... that's "fast language"'s concept of expensive, not "scripting language"-expensive. 03:11
diakopter wayland76: nm; I was making faulty presumptions about the *n*x group membership system
mncharity one joy of p6 vs CL is arguments of the form "nice language feature idea, but we don't know how to compile it efficiently" ends with "but we don't care! let's have it anyway! :)". 03:12
vis haslkel too.
"that'd be nice to have... but we can't type it"..."don't care! let's have it anyway!" 03:13
wayland76 diakopter: Yeah, I knew that, but I wondered if you might still have a point anyway :) 03:15
mncharity wonders what the current state of the art in p5 multi-dispatch is...
i thought there was a #moose channel... ;-/ 03:16
wayland76 think multi-dispatch is where you say "Duh, if youse don't talk, I'll knock both yers heads off"
There is now, but I'm the only one there, and I don't know anything :) 03:17
mncharity #moose on irc.perl.org
wayland76 bacek: are you the one doing the sockets? 03:18
diakopter Class::C3...?
oh wait, :(
diakopter shuts up
03:19 ChanServ sets mode: +o diakopter, diakopter was kicked by diakopter (diakopter))
mncharity C3++ 03:24
nice to see #moose active... :/ 03:25
p5 has a triple down red arrow rating in this month's TIOBE. which is subtitled "All time high for JavaScript, all time low for Perl". 03:27
www.tiobe.com/index.php/content/pap...index.html
03:27 c9s left
wayland76 TIOBE = The Importance of Being Ernest? 03:27
literal haha 03:28
mncharity :)
wayland76 I note we also had the biggest drop of anything except VB 03:30
I wonder if the 3rd great depression (aka the Global Financial Crisis which is just starting) is having any effect on that
03:33 c9s_ is now known as c9s
wayland76 It also appears that the only big gains were C, C plus plus, and javascript 03:33
mncharity if one has there operational flexibility to choose what language to use, few would currently choose p5 over py in general, or niche rb, clojure/groovy/jruby/etc on java.
wayland76 I'd choose PHP over python :) 03:34
03:34 hercynium left
mncharity from the graph, the C++ gain looks like noise 03:35
bacek_ wayland76: (sockets) I just resurrected them 03:39
mncharity wayland76: re PHP over python, shudder. 03:40
;) 03:41
no commits to src/perl6/ since the 24th? hmm 03:42
wayland76 bacek: ok. 03:43
mncharity: Admittedly, I've not had to do much python
frioux rakudo: 1 < 1|3 < 3 03:44
p6eval rakudo c01555: RESULTĀ«any(Bool::True, Bool::False)Ā»
mncharity huh?
03:44 Alias_ left
bacek_ wayland76: btw, I personally dislike your last changes in S32... 03:44
mncharity oh, i get it.
wayland76 bacek: In what way?
bacek_ using internal "$.isListening" for changing behavior 03:45
wayland76 Well, it should only change the behaviour of the .new() and .open() calls
Did you have another better way to achieve the same thing?
(and I'd happily agree that $.isListening is a bad name for it) 03:46
03:46 agentzh left
wayland76 Ooh, maybe $.isListener (unless we can think of a better way to do it) 03:46
bacek_ wayland76: something like search.cpan.org/~chrmue/Socket-Clas...2/Class.pm 03:47
wayland76 Which specific part do you like? The way 'listen' gets passed as a parameter to .new() ? 03:49
03:50 nacho joined
mncharity reads www.perlfoundation.org/perl6/index....katon_2009 03:55
bacek_ wayland76: clear distinguish "local_addr" and "remote_addr"
wayland76: because sockets has both
wayland76: (for established connections) 03:56
wayland76 I agree 03:57
It just means we probably need to move more stuff from IO::Socket::INET to IO::Socket 03:58
No, I'm wrong 03:59
It means that the roles/classes that implement IO::Socket need to format up the address properly 04:00
mncharity maybe do an elf Q1 report this week. see if there's any interest until Oslo ends. then mothball elf if not.
g'night all & 04:02
04:02 mncharity left
wayland76 'night 04:03
bacek: Does that make sense?
04:04 dukeleto left
wayland76 Another question; is IPv6 backwards compatible? 04:04
ie. if I listen on port 80 with an IPv6 connection, will it hear IPv4 connections? 04:05
skids There's an address prefix for IPV4 addresses within the IPV6 space, if that's what you are asking.
No, you won't because it is a different proto id. 04:06
wayland76 Oh, that makes sense. Thanks 04:07
skids (on the level of GRE, etc.)
wayland76 /etc/protocols :)
skids Erm, I mean on the layer 2 level. It'll be a different frame type.
(as well, usually) 04:09
04:12 agentzh joined 04:17 c9s_ joined 04:22 c9s__ joined
pugs_svn r26032 | wayland++ | S32/IO: Made calls to .new() a bit more consistent with each other. 04:22
04:23 alester joined 04:25 c9s_ left
pugs_svn r26033 | wayland++ | S32/IO: Added a .new() method to IO::Socket::Unix 04:29
wayland76 bacek: Is that better?
( or bacek_ even :) ) 04:31
04:34 c9s left
bacek_ wayland76: no... "method open" is redundant and harmful. 04:37
wayland76 In what way? 04:38
bacek_ wayland76: technically each Socket holds pair of Sockaddr - local and remote. So, when you create Socket you specify one of them.
wayland76 Yes 04:39
bacek_ and the call to proper "listen" or "connect"
wayland76 I'd like to see a more consistent interface across the IO objects
bacek_ wayland76: imagine you writing simple httpd server. 04:40
wayland76 Ok, imagining... :)
bacek_ And want to log remote IPs.
wayland76 Yes
bacek_ you have to have ability to fetch both "remote" and "local" prt from socket.
parts
wayland76 yes
As specified in IO::Socket::INET (btw, are you working from r26033?) 04:41
Ie. assume we've created the listening socket, in $lsock 04:42
bacek_ so, I prefer to have "class Socket { has Sockaddr $.local; has Sockaddr $.remote };
skids for that matter, udp, you don't even have a connection, and you can have a socket that accepts all src addresses (or one that doesn't)
04:42 c9s joined, araujo left
wayland76 $newsock = $lsock.accept(); log($newsock.RemoteAddr); 04:42
bacek_ and "new" will just accept one of this attributes
my $newsock = Socket.new(local => Sockaddr("localhost", 80)); my $conn = $newsock.accept() 04:43
Sockaddr.new rather 04:44
wayland76 You don't appear to have specified in any way that you want it to listen 04:45
Or are you assuming that Local = listening and Remote = connecting? 04:46
bacek_ yes 04:48
wayland76 The equivalent in the syntax I suggested would be something like my $newsock = IO::Socket::INET.new(LocalHost => 'localhost', LocalPort => 80, Listener => MAXSOCKWHATEVER);
What about the occasions where you want to specify both local and remote contact details?
bacek_ is bluetooth Socket::INET?
skids How do you differentiate listen from connect when you specify both src and dst? 04:49
wayland76 Exactly my question :)
bacek_ local => sockaddr(...), remote => sockaddr(...)
or LocalAddr => ..., RemoteAddr => ...
04:50 nacho left
wayland76 But how do we know then whether it's listening or connecting? 04:50
bacek_ we dont.
id depends on "connect" or "listen" call.
it depends.
so, "open" is redundant and harmful :) 04:51
wayland76 Well, but that's what I'm trying to get rid of :)
Or connect and listen are :)
I agree the default should be changed, though, so that not specifying remote contact details defaults to a listen as well 04:52
Then the only conditions under which you'd have to specify $Listener is if you're specifying both local and remote addresses 04:53
bacek_ why defaults to listen???
skids you can't connect without saying what to. 04:54
wayland76 Well, your point above was that, if people specify local contact details but not remote ones, then they probably want a listening socket
bacek_ it's explicitly specified
wayland76 Now I'm confused about what bacek_ is saying 04:55
What is explicitly specified? 04:56
skids I think bacek is too :-)
Allow me to summarize:
bacek_ whet you pass "LocalAddr" you explicitly specifying that you want "Listen" on this port.
skids bacek suggested ditching open for new; accept;
then wayland asked how do we know when to listen 04:57
bacek_ new/listen :)
skids Ah but you said new accept
wayland76 bacek_: No, I think when you don't specify RemoteAddr, *that* when you want to listen
04:57 c9s__ left
skids and thereby, the confusion ;-) 04:57
bacek_ wayland76: 50/50. So, only one way to distinguish - call "listen" or "connect" 04:58
wayland76 bacek_: I think we should call the appropriate one by default, and only require people to specify something when we can't figure it out 04:59
Anyway, I'll modify the spec again, and then you can argue with the improved version 05:02
skids I think a one-shot call might have merit, but still people will want explicit control -- maybe keep open as a one-shot call, but specify it is only for simple use.
wayland76 And thanks to both of you for helping with this :)
skids I don't think automatically calling listen or connect will be appreciated by some users, so it should not happen on new() 05:05
wayland76 skids: a one-shot call of what?
Well, then they can pass the NoOpen parameter in :)
skids one-shot as in create a socket and listen/connect
So I have no real problem with open = create and listen or connect, new = setup but wait for user to listen/connect. But I'm not necessarily saying that would be the best way. 05:06
pugs_svn r26034 | wayland++ | S32/IO: Based on some suggestions of bacek++ and skids++, I refined the initialisation of 05:07
r26034 | wayland++ | the $.Listening attribute. This may need more discussion though.
wayland76 Anyway, I'm being called for food, but please feel free to continue this; I should be back in 20 minutes or so, and will backlog 05:08
(I hope r26034 is a little more to your taste) 05:09
05:17 dukeleto joined
wayland76 Actually, I've just realised that, while I'm back now, I'm going to have to leave in about 5 minutes 05:23
Feel free to e-mail problems with IO.pod to p6l :) 05:26
Ok, looks like I don't need to go away 05:38
05:38 alester left 05:39 zostay_ joined 05:43 zostay left 05:58 mjk joined
moritz_ good morning 06:14
lambdabot moritz_: You have 1 new message. '/msg lambdabot @messages' to read it.
moritz_ I'll fix the links to the S32-* synopsis as soons as there's a HTML version of them
06:15 c9s_ joined 06:26 c9s left 06:27 c9s_ is now known as c9s 06:47 zostay joined, zostay_ left 06:49 justatheory left 06:52 REPLeffect left
wayland76 moritz_: Ok, I'll try to remember to get to that 06:57
06:59 REPLeffect joined 07:02 ejs joined
moritz_ wayland76: good 07:10
07:11 c9s left 07:13 ejs left 07:16 c9s joined
Matt-W Morning 07:22
07:23 goksie joined
mikehh moritz_: hi - everything ok on Kubuntu Intrepid i386 - everything PASSes, unlike Ubuntu Intrepid Amd64 07:38
07:42 |mjk| joined 07:51 DemoFreak joined 07:59 mjk left 08:08 ejs joined 08:09 bacek_ left 08:11 |mjk| left 08:13 ejs left 08:14 ejs joined 08:15 masak joined
masak good early afternoon, Camelians. 08:16
moritz_ afternoon? :-) 08:18
you're not in europe, are you?
masak hm. 08:20
meant late morning, actually.
masak hopes that puts him back in Europe
ruoso: ping 08:22
Matt-W it's 0922 in the UK
so the rest of europe can't really be much further ahead
masak @ask ruoso what did you mean yesterday that roles should not be used for stateful things, like Closeable?
lambdabot Consider it noted.
wayland76 masak: I can answer that :) 08:26
masak ok.
wayland76 He meant that it's entirely possible for a readonly object to compose IO::Writeable
That's why IO::Writeable has an isWriteable attribute 08:27
Does that make sense?
masak not really, I'm afraid.
wayland76 (sorry, a readonly IO file)
masak it doesn't feel very elegant. 08:28
wayland76 Well, say you have a file that you have readonly permission to
eternaleye Are you saying the object is readonly, but the backend it's attached to is writable?
wayland76 And you access it through an IO::File
08:28 alexn_org joined
wayland76 IO::File *always* composes IO::Writeable, even though you may not be able to write to the file 08:28
eternaleye nvm, I type slowly
wayland76 So if you ask whether an IO::File object does IO::Writeable, the answer is yes 08:29
But if you write to a readonly file, it will throw an error
That's why you do something like if($fileio.isWriteable) {...} 08:30
Matt-W Doesn't that kind of defeat the object of having IO::Writeable as a role?
wayland76 No
Now we're getting beyond questions that I can answer well, though. Ask ruoso that one
(although maybe it should be IO::ReadWriteable or something) 08:31
eternaleye It souds like IO::Writable is anything that is /capable/ of being written to in at least one circumstance, but does not necessarily mean that writing is permitted in the current circumstance. Necessary, but not sufficient for writing. 08:34
masak in other words, IO::Writable means that things are _possibly_ writeable. 08:35
08:35 M_o_C joined
masak it all makes more sense now. 08:35
wayland76 eternaleye: You got it (Travelling WIlburys)
And ruoso no doubt reminded me because I keep forgetting :) 08:36
eternaleye Perhaps a simplified way to explain it in the future is that IO::Writable defines "Can I write?" while isWritable defines "May I write?" - This should make it really easy for grammarians 08:40
wayland76 Ooh. Perl already had magic, now it has grammarye 08:41
Matt-W hahaha
wayland++
eternaleye All we need is a chicken and two goats.
masak @tell ruoso nvm, wayland76++ clarified satisfactorily. 08:42
lambdabot Consider it noted.
08:44 c9s_ joined 08:46 c9s left 08:47 kimtaro_ joined 08:48 alexn_org left 09:00 cognominal left, M_o_C left 09:02 c9s_ left 09:04 c9s joined, kimtaro left 09:24 cognominal joined 09:26 renormalist joined 09:29 araujo joined 09:31 PZt left 09:34 amoc joined 09:38 kimtaro joined 09:44 payload left 09:46 renormalist left 09:56 kimtaro_ left 10:01 c9s_ joined 10:05 c9s left 10:07 amoc left 10:26 finanalyst joined
finanalyst ruoso: ping 10:26
pmurias: ping 10:27
10:27 grwi joined, grwi left, kimtaro left 10:37 xinming_ is now known as xinming 10:55 kimtaro joined 10:57 pmurias joined
ruoso finanalyst, pong 11:11
lambdabot ruoso: You have 2 new messages. '/msg lambdabot @messages' to read them.
pmurias ruoso: hi 11:12
pugs_svn r26035 | pmurias++ | [mildew] added a snapshot of STD in perl6-snapshot 11:13
ruoso hi pmurias 11:18
pmurias ruoso: i'm wondering if a have native and s1p in Perl 6 scheme would work if we had a simplified version of p6opaque and a way to use C functions with a Inline-style interfacee 11:20
11:20 goksie left, goksie joined
ruoso pmurias, well... a simplified version of p6opaque is a C structure (since you're generating code...) 11:21
pmurias that what i was thinking about
ruoso but the inline-style C interface is doubtless interesting...
I'm not sure how to make STD support it tho
pmurias STD parses =begin DATA 11:22
ruoso hmmm... I was expecting something more on the line of a quote modifier... but if that works 11:24
pmurias wouldn't a quote modifer suggest quasi-quoting C? 11:25
ruoso but you don't need to actually parse the C code
pmurias we could even use use Inline C => '...' 11:26
ruoso you can simply look for the closing brace
pmurias ruoso: i can parse the C code with some haskell thing
ruoso but the point is that you don't need to
pmurias so that it gets signatures generated for it
ruoso Ah... you mean having a different grammar for the entire file 11:27
hmm.... 11:28
pmurias i'm more thing of it like mildew recognising use Inline C => 'code' and exposing all the function there to Perl 6 code
ruoso you mean... 11:29
method foo($a,$b,$c) { use Inline C => '...' } ?
pmurias yes
ruoso the pod directive seems a better idea 11:30
pmurias we could alternativly keep the C code in a different file 11:31
ruoso you know... there isn't really many files written in C+mold 11:35
maybe just adding signature support to the RI DSL already saves a great deal of work 11:36
11:36 wayland76 left, wayland76 joined
pmurias ruoso: maybe you're right, we should consider it seperatly from the refactoring anyway 11:41
ruoso probably a sane idea 11:42
let's just finish this refactoring, then we think on the next refactoring
pugs_svn r26036 | pmurias++ | [re-smop] moved over lowdoc/02_interpreter.pod 11:47
pmurias ruoso: do we need native uint in re-smop? 11:48
ruoso well... the spec defines it... 11:49
pmurias as well as 14 other int types 11:50
perl6: say 1.new; 11:53
p6eval elf 26036: OUTPUTĀ«Can't locate object method "Str" via package "1" at ./elf_h line 752.ā¤ at ./elf_h line 5881ā¤Ā»
..pugs: OUTPUTĀ«<obj:Int>ā¤Ā»
..rakudo c01555: OUTPUTĀ«0ā¤Ā»
pmurias perl6: say 1.new("7");
p6eval elf 26036: OUTPUTĀ«Odd number of elements in anonymous hash at ./elf_h line 19.ā¤Can't locate object method "Str" via package "1" at ./elf_h line 752.ā¤ at ./elf_h line 5881ā¤Ā»
..pugs: OUTPUTĀ«*** Must only use named arguments to new() constructorā¤ Be sure to use bareword keys.ā¤ at /tmp/JY4oV2Mazv line 1, column 5-15ā¤Ā»
..rakudo c01555: OUTPUTĀ«0ā¤Ā»
pmurias perl6: say 1.new(7);
p6eval elf 26036: OUTPUTĀ«Odd number of elements in anonymous hash at ./elf_h line 19.ā¤Can't locate object method "Str" via package "1" at ./elf_h line 752.ā¤ at ./elf_h line 5881ā¤Ā»
..rakudo c01555: OUTPUTĀ«0ā¤Ā»
..pugs: OUTPUTĀ«*** Must only use named arguments to new() constructorā¤ Be sure to use bareword keys.ā¤ at /tmp/qMMQKPTTti line 1, column 5-13ā¤Ā»
11:57 jogla joined
ruoso pmurias, beware that by using 1.new, yuo're kinda autoboxing to the Int type, and calling new on it instead... 11:58
12:00 c9s_ is now known as c9s 12:09 msmatsko_ left
pmurias ruoso: i'm removing .new from int 12:09
ruoso right... it seems a bit pointless
eventually we make it delegate the method calls to Int 12:10
pmurias do we still seperate *_mold_init and *_mold_destr from *_init and *_destr? 12:12
ruoso hmmm
I hope we have solved the dependency issues 12:13
so, in theory, there should be no need to make them separated
12:16 OuLouFu left
pmurias walk& 12:16
12:17 Guest50274 left 12:18 dKingston joined
pugs_svn r26037 | ruoso++ | [re-smop] update lowdoc/02_interpreter.pod according to the refactoring, basically fixing nomenclature. 12:27
12:28 skids left 12:33 smtms left 12:37 mberends joined 12:40 orafu joined 12:46 alester joined, alester left
masak misuses $^param variables in subs 12:48
Matt-W gasps in horror 12:49
moritz_ rakudo sub f { say $^x }, f(3) 12:50
rakudo: sub f { say $^x }, f(3)
p6eval rakudo c01555: OUTPUTĀ«3ā¤Ā»
masak rakudo: sub foo { my $a = 5; say $^a }; foo(7)
moritz_ that shouldn't work
p6eval rakudo c01555: OUTPUTĀ«5ā¤Ā»
masak that shouldn't either, I think.
moritz_ only blocks should have implict parameters, no?
masak so what do I do now? submit two rakudobugs?
moritz_: a sub has a block. 12:51
moritz_ masak: but it has a signature on its own
anyway, not sure
masak p6l?
moritz_ maybe look it up in the synopsis first :-)
masak looks
ruoso moritz_, I'm not sure that's entirely true
moritz_, sub foo { } has an implied signature
but having $^a there might imply a different 12:52
masak man, coding Perl 6 is so much better than working.
moritz_ masak: indeed
masak I've learned to like the uncertainness surrounding many constructs in Perl 6. 12:53
trying out new things means that the synopses shift a little.
in a sense, I wish all languages worked like that. :P 12:54
masak discovers that placeholder variables can be written with a colon
wtf! when did this happen? :)
ah, they are named placeholders. 12:55
"Placeholders may also be used in method bodies that have no formal signature." 12:56
(from S06)
moritz_ ah, ok
masak one might argue that excepting subs would then be a strange exception.
moritz_ rakudo: sub f() { $^a.say }; f(2) 12:57
p6eval rakudo c01555: OUTPUTĀ«Cannot use placeholder var in block with signature. at line 1, near ".say }; f("ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
moritz_ rakudo++
and masak++ for investigating
masak still, what about my last one-liner?
the one where I used $a first and then $^a?
moritz_ that looks... wrong
masak aye.
bug reporting time. 12:58
moritz_ it seems that initialization happens at the wrong time (which we also found in another block involving eval)
rakudo: eval 'say $f'; my $x = 3;
p6eval rakudo c01555: RESULTĀ«3Ā»
moritz_ that's wrong, it should first run the eval, then do the assignment 12:59
so it should print an undef really
(but we have a ticket for that already)
masak aye. 13:00
moritz_: I'm very mystified by that behavior. 13:01
ah.
the 3 comes from the last assignment.
that explains it.
nvm.
moritz_ never minds
masak rakudo: eval 'say $x'; my $x = 3; say "OH HAI" 13:02
p6eval rakudo c01555: OUTPUTĀ«OH HAIā¤Ā»
masak moritz_: I think that ticket is bogus.
do you have its number?
moritz_ no idea
masak goes looking
moritz_ why do you think it's bogus?
it was TimToady who said it's wrong :-) 13:03
Matt-W that eval shouldn't compile!
moritz_ it should
masak moritz_: because I try to reproduce it above, and I don't succeed.
Matt-W there's no $x for it to use
13:03 Khisanth joined
masak let me just find the bug ticket... 13:03
moritz_ Matt-W: yes, but the declaration of $x happens at compile time...
Matt-W so it can see the $x that's declared *after* it when it comes to runtime?
moritz_ Matt-W: and at run time the eval only asks if there is an $x declared in the current block
Matt-W ouch 13:04
masak #64010.
moritz_ it's actually a very sane behaviour
masak yup, it's bogus.
Matt-W how is that sane?
moritz_ otherwise eval would have to track its caller's position in the source file
masak you're all being misled by p6eval's behavior when you don't print something to STDOUT.
moritz_ omg 13:05
masak marking ticket as bogus.
moritz_ masak++
masak moritz_: IMO, turn off that behavior on p6eval.
Matt-W I'm not interested in implementation requirements
masak it's only confusing.
Matt-W I'm interested in why it's a good thing in the language
moritz_ masak: I should, yes
moritz_ notes it on his todo 13:06
for tonight, that is
masak great.
I liked the old behaviour better, when it said "you oughta print something, DUH" 13:07
or equiv.
Matt-W <<No output.>>
masak that works too.
Matt-W It's slightly less insulting :) 13:09
masak aye. 13:10
13:11 meppl joined
masak moritz_: so, you have Perl 6 time planned for tonight? me too. I plan to hack on November. 13:13
moritz_ perl 6 spoiled me. Now I want to write obj.method_without_args.other_method in C++ as well :-)
Matt-W Me too
moritz_ masak: actually I have some time planned to implement an april's fool joke for the 80+ machines I'm administrating
literal you can still do it in Ruby :P 13:14
Matt-W is hoping to do a bit of Form, but has a recorder lesson
13:15 smtms joined 13:21 jan_ joined
moritz_ just sped up a program from 7 min 35s to 35s 13:22
masak optimized away the '7 min' part? :P 13:23
moritz_ right
git commit -m 'it can be faster, you suckers' :-) 13:24
Matt-W did you find the line that said "sleep" and take it out? 13:25
moritz_ I found out how to solve an equation system only for non-zero rows :-)
Matt-W :)
masak ah, those non-zero rows. 13:26
I should have thought of that.
Matt-W Maths-based optimisation ftw 13:27
moritz_ you should indeed, and you have told me so in the first place :-)
13:29 Khisanth left 13:31 skids joined 13:36 Schmidt left
pugs_svn r26038 | pmurias++ | [re-smop] ported over native int 13:39
13:39 ivantis joined
krunen ls 13:39
argh! 13:40
ivantis zomg perl6 doesnt have $ ?
pmurias perl6 has sigils 13:41
ivantis in #perl someone just asked if we would lose $ @ and %
they mean different things?
perl6 is a scary language
moritz_ they are slightly different 13:44
13:44 rgs left
pmurias ivantis: $foo->{'foo'} turned into $foo{'foo'} and $foo{'bar'} turned into %foo{'bar'} 13:44
moritz_ if you have an array @a, you access a single item with @a[0], not with $a[0] as in Perl 5
masak ivantis: I agree that Perl 6 is a scary language. that doesn't stop me from liking it a lot, though. 13:45
pmurias ivantis: btw $foo<foo> is an other way to write $foo{'foo'} in Perl 6
ivantis this sounds more like perl to php, not perl next version
masak ivantis: why?
moritz_ php doesn't have % and @ as sigils at all 13:46
rakudo: my @a = <foo bar baz>; say @a[1];
ivantis yeah, but so different
p6eval rakudo c01555: OUTPUTĀ«barā¤Ā»
masak right. PHP kept the $ sigil, but forgot about its meaning.
moritz_ that more perlish than PHPish to me :-)
ivantis oh arent you guys cool, got your own evalbot
masak ivantis: I think that if Perl 6 turned to PHP, many of us would have noticed. :)
ivantis: yah, neat, innit? :) 13:47
ivantis so instead of using $ for arrays and hashes, @ and % are used, even for individual references?
kind of makes sense
moritz_ the sigils are now tied to the variable, not to the return value 13:48
masak ivantis: aye. same as in Perl 5, except even more consistent.
moritz_ it confused a great many perl 5 beginners, for sure :-)
masak it's a nice idea gramatically...
moritz_ including me, that is :-)
masak ...but maybe it doesn't carry its own weight. 13:49
Matt-W It confused us all to start with
But it's minor next to the really awesome stuff in Perl 6 :)
masak I don't think I've ever been confused by it. just annoyed at times.
Matt-W Well let's just say it took me a while to get my head around it
But then I read Programming Perl
13:50 goksie left
ivantis is there a new system binary for perl6 on linux and stuff? 13:50
Matt-W All the current implementations are new programs, so yes
There may at some point be one that can handle Perl 5 and Perl 6, but we don't have one at the moment 13:51
ivantis why not just an option, like -v 6 on the shebang line? 13:52
skids Cause we gots us some plans for that there commandline :-)
Matt-W Because the Perl 6 runtime is completely different
masak ivantis: Perl 6 is in parts the next version, in parts a whole new language. 13:53
13:53 goksie joined
moritz_ ivantis: the idea is that a binary called 'perl' (without version number) defaults to perl 5, and switches to Perl 6 as soon as it sees 'use v6' or 'class' or 'module' 13:53
PerlJam masak: I like what is I think Larry's analogy: If I have my face reconstructed (say I was in a bad wreck), am I not the same person? 13:54
masak ivantis: if you'd like to give Perl 6 a try on your computer, I'd recommend downloading Rakudo. rakudo.org/
literal moritz_: what about "grammar" did they add that one as well?
masak PerlJam: indeed.
Matt-W Perl 6 has a thing called grammars
moritz_ literal: don't remember
jnthn OH HAI I haz return from trip. 13:55
masak Matt-W: that wasn't the question. :)
Matt-W OH HAI jnthn
masak jnthn: OH HAI
moritz_ OH HAY jnthn welcome back :-)
Matt-W masak: yes I just realised I misread
masak: give me some slack, I'm trying to have this conversation at the same time as reviewing some C++
masak Matt-W: no slack for you! get in the back of the line. :) 13:56
13:56 exodist joined
Matt-W literal: I think 'grammar' does trigger perl 6 since it's really just a kind of class... 13:56
PerlJam misreads and gives Matt-W some flak instead
;-)
literal Matt-W: yeah, it should
Matt-W jnthn: Was it a good trip? 13:57
literal: if it doesn't, we should demand a good reason :)
jnthn Matt-W: Yes, seeing some family and also some friends from uni who live in a similar area of the UK.
Managed to eat substantial amounts of curry.
Matt-W Hurrah 13:58
You weren't in Birmingham, by any chance?
Has a reputation for curry it seems
jnthn Matt-W: Not in Birmingham, but not far off. 13:59
Nottingham first, and then Dudley area.
Matt-W Although come to think of it, the one time I went there I ate no curry at all
Aaah right
Matt-W lives in Nottingham
jnthn I have had great curry in Birmingham too, however.
OH RLY?
Matt-W yes rly :)
Came to uni and neglected to leave 14:00
14:01 ron_ joined, kimtaro left
ron_ rakudo: say 102030405.split(0).perl; 14:02
p6eval rakudo c01555: OUTPUTĀ«["1", "2", "3", "4", "5"]ā¤Ā»
masak rakudo: say reverse ~ [*] 1..4 14:03
p6eval rakudo c01555: OUTPUTĀ«42ā¤Ā»
masak rakudo: say reverse [*] 1..4
jnthn Matt-W: Next time I'm visiting similar folks, we should try and catch a beer or whatever $beverage you prefer. :-)
p6eval rakudo c01555: OUTPUTĀ«Parameter type check failed for $delimiter in call to splitā¤current instr.: 'die' pc 15621 (src/builtins/control.pir:204)ā¤Ā»
masak doesn't know whether that last one is a bug
jnthn It's...not too dwimmy.
Matt-W jnthn: Absolutely
ron_ Looking at rt (59184 rt.perl.org/rt3/Public/Bug/Display....?id=59184) and the current tests in t/spec/S32-str/split-simple.t and wondering why the ticket is still open.
masak jnthn: my thought exactly.
ron_: I'll close it. thanks. 14:04
jnthn spots that Padre now has the ability to write plug-ins in Perl 6. That's cool. 14:05
masak ron_: there are likely many other open tickets in RT right now which could be closed or merged. thanks for spotting this one. 14:07
ron_++
ron_ Is there anything different to be done at this point if someone comes across one? 14:09
masak ron_: in my opinion, only those tickets that are still valid should be open. does that answer your question?
ron_ gooe enough :) 14:10
s/gooe/good/
finanalyst ruoso: ping 14:11
ruoso finanalyst, pong
finanalyst ruoso: still trying to get smop to work
ruoso right...
have an svn update 14:12
pmurias had put a working snapshot of STD inside mildew source
finanalyst will get new copy 14:14
ruoso by new copy you mean make a svn update
right?
14:18 ron_ left
finanalyst ruoso: right 14:21
just updated, but problems again
after make in smop, a failed test is reported 14:22
going to ../mildrew and perl ./mildew example/sdl.pl indicates I dont have STD 14:23
14:25 brunoV joined
ruoso rm -rf lex CORE.pad.store 14:25
hmm... 14:26
pmurias, example/sdl.pl doesn't seem to be working...
14:29 dKingston left 14:31 justatheory joined 14:34 dKingston joined 14:35 ron_ joined
pugs_svn r26039 | pmurias++ | [mildew] updated example/sdl.pl 14:40
pasteling "finanalyst" at 193.110.4.137 pasted "getting SMOP running" (45 lines, 2.5K) at sial.org/pbot/35779 14:42
finanalyst ruoso: could you look at the nopaste
masak I tell you, with tests I discover bugs that I couldn't even dream was in my codebase. and I'm not even doing TDD -- most of the code is already written. 14:45
dalek kudo: 5374f73 | pmichaud++ | docs/spectest-progress.csv:
spectest-progress.csv update: 339 files, 8039 passing, 0 failing
pmurias finanalyst: run make in perl6-snapshot 14:49
14:49 Tene_ joined 14:51 mberends left
jnthn Over 8,000?! 14:54
[particle] yep, day 2 at 8000+ 14:55
finanalyst pmurias: is perl6-snapshot going to be permanent? 14:56
jnthn More Perl 5 regex support?
pmichaud moritz++ found quite a bit of passing tests in the spectest suite, I think. 14:57
jnthn Nice
moritz++ :-)
masak jnthn: is there a Rakudo day this week? 14:58
jnthn pmichaud: Any preferences when I do Rakudo day or anything particularly you want me to look at this week?
pmichaud jnthn: no preferences -- all days are about equal here
jnthn OK
Maybe will make it Thursday.
pmichaud Tene++ wants us to think more about .leave
jnthn Thursday is normally not so good, but this week it turns out it is because the thing that normally makes it less good is happening on a Wednesday... :-) 14:59
pmichaud Thursday should be okay here.
jnthn Ah, OK.
pmichaud Currently Tene has an implementation of .leave using exceptions.... but I'm not convinced that's the correct model. I think we should perhaps be invoking continuations.
But we can discuss on Rakudo day.
jnthn Sure
I have been down the continuation route with it as an experiment too. 15:00
And found it wasn't all as nice and clean as I'd hoped. :-(
(Because of differences in the way the calling conventions error check return values vs parameters being passed.) 15:01
15:01 hercynium joined
jnthn (We get the second semantics when we actually want the first.) 15:01
pmichaud one can't just invoke the (return) continuation with the values to be returned as params?
15:02 lambdabot left
jnthn Well, it becomes a full continuation as soon as you get hold of it from interpinfo/ParrotInterpreter PMC 15:02
And then when you invoke it with the return values, it treats it a bit like a call.
pmichaud so do we need a way to get at it without promoting it to a full continuation? 15:03
jnthn Having looked at the invoke vtable method of RetContinuation too, I'm not sure that helps either.
It basically boils down to
$P0 = 'foo'()
'foo'()
In both of those, it's completley OK for foo to have a .return (42)
15:03 nihiliad left
jnthn In the second case, the fact that there's an unused return value is ignored by the calling conventions. 15:04
15:04 nihiliad joined
jnthn On the other hand, failing to pass a parameter (that isn't marked :optional) is an error. 15:04
15:04 lambdabot joined
pmichaud got it. 15:04
[particle] it's a flag setting in imcc to ignore unused return values
jnthn And the problem comes up because when you invoke the continuation it is doing the error check.
[particle] s/unused/mismatched/
jnthn [particle]: Maybe indirectly. 15:05
[particle]: But the real difference is in the way you call parrot_pass_args
(specifying call or return semantics)
[particle] the idea has been to enable mismatched return value detection, but at the time (2+ years ago) it required so many code/test/hll changes, it wasn't done
jnthn I did hack Continuation PMC just to make sure this is what the issue was, and it is this. 15:06
However (and I confirmed with allison, but suspected anyway) that's not really the right way to fix it.
[particle] since parrot is cps, we could get rid of all the return calls and just use invoke
15:06 Tene left
pmichaud return calls are invoke. 15:06
jnthn Aye. 15:07
pmichaud .return is just syntactic sugar around an invoke.
[particle] i mean, the silly second path through the pcc
jnthn It's the ivoke vtable meth that gets called.
I'd imagine all it changes is what error checks are done.
So it's not an extra path as such.
15:08 Patterner left
jnthn Also, if you make mismatched return values an error, we're going to have to go fix all kinds. 15:08
15:08 Psyche^ joined
[particle] right, which is why it was never done 15:08
jnthn since sub foo { 42 }; foo(); # is valid
15:08 Psyche^ is now known as Patterner
pmichaud the major difference between .return and a normal invoke is that a normal invoke uses set_args while .return uses set_return 15:08
[particle] right. 15:09
and the pir compiler could recognize invoke in void context and create slurpy unused registers
pmichaud so what we'd really want is a way to invoke a continuation using set_return instead of set_args
ooh! ooh! 15:10
this sounds very much like the patch that chromatic was working on for me that would do lazy :slurpy
15:10 kane_ joined
pmichaud i.e., that could avoid creating the slurpy PMC if it wasn't needed/used. 15:10
15:14 ivantis left
jnthn That sounds like a useful patch. :-) 15:14
pmichaud In all of the other stuff happening at the time (moving rakudo out of parrot repo) I never got a good chance to play with it much. 15:15
jnthn pmichaud: It did also occur to me, that we can write our own dynpmc that gives us completely lazy binding semantics...
pmichaud this is still for .leave? 15:16
that seems reasonable/workable also. (more)
but in some sense we keep coming up on Parrot calling convention roadblocks.
jnthn No, this is for avoiding using much of Parrot's calling convention implementation.
pmichaud and I fear that if we do workarounds it just means that Parrot will never get fixed.
jnthn That or it'll be like "oh, their workaround is how we shoulda done it in the first place" ;-) 15:17
pmurias finanalyst: perl6-snapshot will be updated
finanalyst pmurias: smop still not working for me
pmichaud well, if we do a workaround with the expectation that it eventually gets adopted by Parrot, that doesn't bug me quite so much. 15:18
finanalyst pmuria: I have scons: *** Cannot duplicate `test/03_const_identifier.c' in `build-tests': None. Stop.
[particle] it has always been a goal for parrot calling conventions to support p6 calling semantics natively
pmichaud [particle]: I agree it's a goal. What I don't know is when that goal might be reached. 15:19
jnthn pmichaud: I think that it might at the very least help Parrot get where we'd like it to be.
[particle] yep
pmichaud jnthn: I agree with that.
[particle] i agree with jonathan there
pmichaud so, basically we'd have our own mmd, our own calling conventions, etc.? 15:20
independent of what Parrot implements?
masak rakudo: class A { has $.f; method new($.f) {} }; my A $a .= new(5); say $a.f # I've asked this before, but what do I need to write inside the 'new' method body to make this work?
p6eval rakudo 5374f7: OUTPUTĀ«Type mismatch in assignment.ā¤current instr.: 'die' pc 15621 (src/builtins/control.pir:204)ā¤Ā»
15:20 ejs left
pmurias finanalyst: try removing build-tests,that's a strange error 15:21
pmichaud rakudo: class A { has $.f; method new($x) { $!f = $x } }; my A $a .= new(5); say $a.f; # perhaps this?
p6eval rakudo 5374f7: OUTPUTĀ«Null PMC access in getprop()ā¤current instr.: 'infix:=' pc 13861 (src/builtins/assign.pir:21)ā¤Ā»
15:21 dKingston left
masak pmichaud: I've a feeling I must return a newly-created A object. 15:21
jnthn pmichaud: I didn't think it through in huge detail yet. If anything, I planned to keep the caller side the same everywhere. Because actually it's the callee that does get_params and that is what invokes the calling conventions. And basically rather than just going through those to get the arguments we'd hand back some lazy data structure that pulls them "on demand". However, I didn't get to thinking a load beyond that just yet...and really it may just tur 15:22
masak jnthn: clipped message.
15:22 dKingston joined
masak jnthn: '...may just tur' 15:22
jnthn may just turn out to be too ugly to do.
And the tuits would be better spend in Parrot guts instead. 15:23
pmichaud I'm fine with the callee revising get_params. Ideally from a Rakudo perspect, it would be great if the callee could bind the arguments to lexicals directly (and immediately)
instead of relying on the PIR to do it.
jnthn pmichaud: Well, part of me got thinking, "hey, signature bind maybe should become a dynop one day for speed" 15:24
pmichaud agreed, that's been my expectation.
jnthn And then it wasn't a huge step to "and thus we needn't bother with the callee side of PCC"
pmichaud so, coming back to .leave ... what should we do there? 15:26
jnthn Well, it depends if the spec is going to say that leave is a control exception that you'd expect to be able to catch 15:27
15:27 amoc joined
pmichaud I think the spec says it's _not_ an exception. 15:27
jnthn OK.
The other thing about implementing it was an exception is that we do need to unwind the stack. 15:28
And call any block exit handlers etc.
15:28 Khisanth joined
jnthn While in some senses the "just invoke the return continuation" model appeals to me, I don't see such a neat way to make sure we call all of those. 15:29
pmichaud well, we really need block exit handlers.
I know we had them at one time.
but we need block exit handlers for a lot of things -- so we can unwind various actions that may have occurred (e.g., 'temp' variables)
iirc, Bob Rogers was using Parrot's block exit handlers to do such unwinding... but then allison said those features were going away. 15:30
jnthn Have they gone away, or are they just going away? 15:31
15:31 plash joined
pmichaud "going away" is my guess. 15:32
15:32 frioux_away left
jnthn OK. Maybe we should ask what replaces them. 15:32
pmichaud I'd have to go look at the historical logs a bit to see if I can find them out. But the issue came up as part of the exceptions refactor.
I think Bob asked what replaced them but didn't get an answer. Or maybe I just didn't see the answer.
jnthn I don't remember an answer either. 15:33
Anyway, if we are expecting a Parrot-level solution for the unwinding, then the argument taht it'd be easier to handle this with exceptions maybe holds less. 15:34
pmichaud using exception handlers to do unwinding just feels wrong to me. 15:37
in particular because exceptions typically _don't_ unwind the stack :-|
jnthn Aye 15:39
In that case, perhaps trying to fix up the continuations stuff to do what we want instead is the way to go.
And hopign whatever Parrot's block exit handler solution is works.
pmichaud especially since I think we could get a big number of other optimizations out by doing so.
jnthn Yes, good point.
pmichaud if we had a real .leave that unwinds things, then the standard 'return' semantics (esp for other languages) could be less exceptional. 15:40
jnthn *nod*
pmichaud another question I've late lately is trying to figure out the meaning of 'want' in Perl 6 15:41
s/late/had/
jnthn Ah, I was hoping you did understand that, because I don't. :-)
finanalyst ruoso: ping 15:43
pmurias: ping 15:44
jnthn pmichaud: I think part of it may well be about the bigger question of how we handle multiple return values too. 15:45
And probably needs to be considered and answered in part of working that out.
15:45 finanalyst left
jnthn IIRC, there was some lingering questions there too. 15:45
pmichaud well, multiple return values doesn't cause me as much grief, actually. I somewhat understand how the notion of Capture works there.
jnthn OK.
pmichaud but with the exception of assignment, I'm not sure I can deduce context in many situations. 15:46
jnthn Same.
I guess I should re-read the spec on it. 15:47
And review the tests that exist etc.
15:47 finanalyst joined
jnthn But yes, I've not had any eureka moments at all on want. 15:47
15:50 frioux_ joined 15:52 ron_ left
pmichaud okay, we'll need clarification, examples, or to look at tests then. 15:52
jnthn Aye, agree. 15:55
15:56 frioux_ left
jnthn And we can always bug Larry it in realspace about it in a couple of weeks too. Mwaha... ;-) 15:56
15:56 frew|work joined
jnthn Anyway, I need to do @other_thing for a bit... 15:56
pmichaud yes, I'm thinking that realspace discussion might be easiest. 15:59
masak food & 16:01
16:01 Khisanth left 16:05 payload joined
skids reminds pmichaud,jnthn to include "take" in the discussion when sussing out "leave", especially nested gathers. 16:19
moritz_ why? take already works
pmichaud fsvo "works" 16:20
moritz_ rakudo: sub t ($x) { take $x }; (gather { for 1 .. 3 { t($_) } } ).perl.say 16:21
p6eval rakudo 5374f7: OUTPUTĀ«[1, 2, 3]ā¤Ā»
moritz_ it's dynamically scoped 16:22
pmichaud rakudo: sub foo(@a) { my $x; gather { for @a { $x++; take $x } } }; foo(1..5).say
PerlJam what doesn't work about take?
p6eval rakudo 5374f7: OUTPUTĀ«Non-Positional argument for @a in call to fooā¤current instr.: 'die' pc 15621 (src/builtins/control.pir:204)ā¤Ā»
pmichaud rakudo: sub foo(@a) { my $x; gather { for @a { $x++; take $x } } }; foo((1,2,3,4,5)).say
p6eval rakudo 5374f7: OUTPUTĀ«55555ā¤Ā»
moritz_ ah, there was that.
but is it related to the .leave implementation? 16:23
pmichaud I don't know. It could end up being related, since it has to do with contexts and calling conventions (and capture binding of return values)
at any rate, I don't have a good answer to the 'take' problem yet. 16:24
16:24 eternaleye left, eternaleye joined
skids Also it isn't specced yet whether you can CALLER.take, contex, etc. 16:25
erm context(..).take
Or label gathers.
I figured it might have some implications in the implementation, given what has to happen stack-wise, so I mention it, is all. 16:27
pmichaud agreed. 16:28
pmurias finanalyst: pong 16:34
finanalyst pmurias: 16:41
hiu
ih
pmurias: end of day tiredness 16:42
still cant get smop to work
pmurias: have to go but put error message in nopaste 16:44
pasteling "finanalyst" at 193.110.4.137 pasted "mildew error" (5 lines, 204B) at sial.org/pbot/35796 16:45
16:46 finanalyst left 16:48 args joined 16:49 dKingston left 16:51 args is now known as rgs, dalek left 16:52 dalek joined 16:53 dKingston joined 16:55 rgs left 16:58 plash left 17:03 cognominal left
ruoso @tell finanalyst run "make CORE" (I suspect make all is missing a dependency on CORE) 17:14
lambdabot Consider it noted.
17:15 eternaleye left 17:16 eternaleye joined 17:27 awarefish joined 17:31 barney joined
pugs_svn r26040 | moritz++ | [evalbot] only reproduce output, never try to print the return value. 17:38
r26040 | moritz++ | Suggested by masak++ to reduce bogus tickets
masak moritz_++
17:39 p6eval left, p6eval joined
moritz_ rakudo: say "oh hai" 17:39
p6eval rakudo 5374f7: OUTPUTĀ«oh haiā¤Ā»
moritz_ rakudo: "foo"
p6eval rakudo 5374f7: ( no output )
moritz_ that was easy
jnthn rakudo: say " ( no output ) " 17:40
p6eval rakudo 5374f7: OUTPUTĀ« ( no output ) ā¤Ā»
masak jnthn++
jnthn ;-)
17:41 nihiliad left
masak did we ever reach a conclusion on the question "what do I have to fill a 'new' method with for it to work?"? 17:42
17:43 M_o_C joined
jnthn masak: I fear not, no. 17:45
masak: Just didn't get the tuits to chase it up yet.
moritz_ masak: in the spec, or in the implementation?
masak moritz_: I'm interested in both answers to that junction.
jnthn masak: Will try and remember to spend time on that in Rakudo day - poke me about it then if I don't.
masak jnthn: sure thing.
jnthn erm, if I seem to ahve forgotten
masak aye. 17:46
masak tries to get November to build manually
moritz_ the spec says it's as easy as self.bless(attrib1 => $value, attrib2 => $value, ...)
masak ok. 17:47
sounds promising.
moritz_ (once you know which parts of S12 you can ignore to get to that conclusion ;-) 17:48
masak rakudo: class A { has $.a; method new($a) { self.bless(:a($a)) } }; A.new(5).a.say
p6eval rakudo 5374f7: OUTPUTĀ«5ā¤Ā»
masak holy smokes, did that work!?
moritz_ rakudo: class A { has $.a; method new($a) { self.bless(:a($a)) }}; A.new.WHAT(4).say
p6eval rakudo 5374f7: OUTPUTĀ«too few arguments passed (1) - 2 params expectedā¤current instr.: 'parrot;A;new' pc 183 (EVAL_20:77)ā¤Ā» 17:49
moritz_ rakudo: class A { has $.a; method new($a) { self.bless(:a($a)) }}; A.new(4).WHAT.say
p6eval rakudo 5374f7: OUTPUTĀ«Aā¤Ā»
masak \o/
can't believe it.
17:49 smtms left
moritz_ t/spec/S12-construction/construction.t has two tests for that 17:49
but it's not in spectest.data 17:50
masak why not?
moritz_ because it relies on the existance of a class Class that all classes are members of...
masak ah. 17:51
which is against the Spec.
moritz_ but iirc that thing is gone
masak aye.
moritz_ and it fails in other funny ways
masak wohoo, November builds!
moritz_ like wrong class names
masak huh. 17:52
moritz_ it defines class OwnConstructor and uses OwnConsstr all over
dammit, it relies on outer lexials in classes 17:53
masak don't we have that?
moritz_ no, only in eval
maybe I can change that into a class atrib 17:54
17:54 rgs joined
masak rakudo: class A { my $a = 5; method foo { say $a } }; A.foo # are we talking about this? 17:55
17:55 smtms joined
p6eval rakudo 5374f7: OUTPUTĀ«5ā¤Ā» 17:55
moritz_ that's not an outer lexical
my $x; class A { # user $x here }
masak aha.
rakudo: my $a = 5; class A { method foo { say $a } }; A.foo # are we talking about this? 17:56
p6eval rakudo 5374f7: OUTPUTĀ«Lexical '$a' not foundā¤current instr.: 'parrot;A;foo' pc 168 (EVAL_20:77)ā¤Ā»
masak hm.
moritz_ we're talking now ;-)
masak does that have to do with different times, like BEGIN and stuff?
moritz_ dunno 17:57
jnthn No, it is an underlying ParrotBug.
It's about irksome enough that I really want to go hunt it down soon though...
masak jnthn: so there isn't a problem about A being constructed before the assignment to $a? 17:58
17:58 eternaleye_ joined
PerlJam when does that assignment happen exactly? 17:59
at INIT time?
masak PerlJam: if the assignment is outside the class, as in my last example, I imagine it happens at normal runtime.
18:01 ZuLuuuuuu joined 18:04 phat_ed joined
PerlJam so ... my $a = 5; class A { say $a; } would barf because the body of the class is run at compile time and $a is undefined? and your last example is very neat conceptually the same thing as my $a; class A { method foo { say $a; } }; $a = 5; A.foo; ? 18:05
and your last example dies now because of some bug with the lexical linkage in parrot?
moritz_ PerlJam: it wouldn't barf, because $a is *visible* at compile time, not just initialized yet...
18:05 phat_ed left
moritz_ PerlJam: but when you run the method, chances are that it has been initialized by then 18:06
18:06 phat_ed joined, phat_ed left
masak moritz_: so $a still contains an undefined prototype? 18:06
PerlJam right, right, it would just warn.
masak PerlJam: no, why would it?
18:06 cognominal joined
moritz_ it wouldn't even warn, because the assignment is run before the execution of the method 18:06
PerlJam masak: because $a is uninitialized. 18:07
masak PerlJam: ah. right.
PerlJam my $a = 5; class A { say $a; } # $a is uninitialized at the time the class body is executed.
masak rakudo: my $a; say $a
jnthn The problem now is that the presence of the class (or rather, something we use when constructing the class) makes the lexical invisible to Parrot.
p6eval rakudo 5374f7: OUTPUTĀ«Use of uninitialized valueā¤ā¤Ā»
jnthn Or at least, one of the problems.
moritz_ PerlJam: correct 18:08
jnthn rakudo: my $a = 5; class A { method x { say $a } }; A.x # should say 5
p6eval rakudo 5374f7: OUTPUTĀ«Lexical '$a' not foundā¤current instr.: 'parrot;A;x' pc 168 (EVAL_20:77)ā¤Ā»
jnthn But instead we get that error from Parrot.
PerlJam jnthn: how does the lexical become invisible? 18:09
masak :/
jnthn PerlJam: Because we have an init-time block in the static chain, and some Parrot bug gets in the way of that. 18:10
As in, makes init-time blocks hide lexicals outside of them.
Or somehting along those lines. I always forget exactly what it is...there's a Parrot ticket on it.
PerlJam :init can't also have :outer? or something like that? 18:11
18:11 eternaleye left
jnthn Right, something like that. 18:11
Anyway, dinner time...back in a bit. :-)
masak jnthn: don't miss the parrotsketch meeting in 15 minutes. :) 18:15
18:16 jhorwitz joined, PhatEddy joined
moritz_ eats a tasty steak 18:17
18:19 Tene_ left, Tene joined
PerlJam eats nips of cheese 18:19
(and wishes for a tasty steak)
18:21 nihiliad joined
pugs_svn r26041 | moritz++ | [t/spec] some improvements to construction.t, and fudged for rakudo 18:23
18:26 Tene_ joined 18:41 eternaleye joined 18:42 Tene left, alester joined, eternaleye_ left 18:44 eternaleye_ joined
dalek kudo: 78cb4c3 | (Moritz Lenz)++ | t/spectest.data:
add passing test to t/spectest.data
18:48
18:59 eternaleye left 19:04 dKingston left, dKingston joined
masak haha, Perl 5 requires parentheses around the boolean expression after 'if'. how quaint. :P 19:11
sbp yeah. Perl 6 only requires your sanity and your firstborn
masak deal. 19:12
19:14 FurnaceBoy joined
masak sbp: with 'firstborn', you meant November, right? :P 19:15
jnthn masak: Oh, as if...I can't believe it's Tuesday. :-( 19:17
Given that I didn't work yesterday I somehow thought today was Monday or something... :-|
masak jnthn: I'm sorry, can't talk right now. I'm in a meeting. :P
jnthn masak: :-P 19:18
sbp hey now, no taking the mickey out of November 19:19
it's a true achievement 19:20
because, you know, it's not like you can make a wiki in two lines of perl5 OH WAIT YOU CAN
masak sbp: I'm amused by your skewed compliemnt. thanks, I guess. 19:21
sbp heh, actually, I misremembered
it's four lines: c2.com/cgi/wiki?ShortestWikiContest
masak right.
sbp having said that, the 3 line PHP was smaller 19:22
masak we should have written it in PHP 6. :)
sbp oh, there's a PHP 6 now? always copying perl, those guys...
moritz_ isn't version 6 the one where they want to use the backslash as namespace separator? 19:23
sbp oh man, I remember that now
masak sbp: I definitely agree that there is nothing innovative in the ideas underlying November. and it could definitely have been shorter, if brevity were what we were striving for.
sbp: also, coming up with what to write wasn't the hard part.
sbp: making it run on top of Rakudo was.
sbp masak: I sympathise entirely 19:24
moritz_ it seems just as stupid as having ' for that function in Perl 5 ;-)
sbp it took me a day to get a grep-a-like working in rakudo
masak sbp: how long ago?
sbp a few days ago
masak sbp: nowadays it should not be so hard. :)
I'm talking about this summer.
sbp well it would have been easier if we could decide the best way to do the actual grepping
masak 'we'? 19:25
sbp because I tried loads of things which looked according to the synopses and code samples like they should have worked
yeah, I roped a few friends into helping
masak sbp: I must say this sounds interesting. please provide details if you can.
literal why does Perl 6 allow ' in package names, though?
sbp masak: oh the script is miniscule, hang on
masak sbp: I mean your discussion around it. 19:26
moritz_ literal: probably because it's part of english (pseudo) words
masak sbp: and the failures you allude to.
[particle] literal, apostrophes are allowed in all identifiers
moritz_ literal: I never used it, but I used - a lot
literal [particle]: yeah, I meant to ask why they are allowed in identifiers
[particle] literal: isn't(1, 0, "one isn't zero");
sbp masak: sure, well, paste.lisp.org/display/77828 is the script. embarrasing really. let me dig out all of the alternatives that we tried for that little bit in the middle, iterating over the file handle... 19:27
literal I'm not complaining, though, it's neat to have it
[particle] it allows programmers to express ideas better in grammatically correct identifiers
masak sbp: looks nice.
PerlJam literal: neater than apostrophes are dashes. $I-like-dashes = 1; # :-)
[particle] has been writing perl5 code with dashes lately, only to get compile errors
sigh.
literal PerlJam: I like underscores better than dashes 19:28
masak sbp: you should try lines($file). that's about the only improvement I can spot in your script. the rest is idiomatic Perl 6.
moritz_ [particle]: there's a whole list of features that I try to use in perl 5 regularly, and fail regularly ;-)
[particle] :)
masak oh, but lines() might now work on $*IN. trying... :)
PerlJam literal: I like fewer keystrokes in my expression of identifiers.
[particle] those backporters better get to work!
literal moritz_: Perl::Critic is your friend :P 19:29
PerlJam: that is a point
moritz_ literal: perl -c catches most of them anyway ;-)
[particle] eschewes the shift key
masak no, it works fine on $*IN.
sbp masak: well, what we tried was to compress that iterator into a single line. because, like, it's perl innit? so we ended up doing all of the following daft things, and more: paste.lisp.org/display/77829
where exactly would lines($file) go?
masak sbp: .say if $_ ~~ eval("/{@*ARGS[0]/") for lines( @*ARGS[1] // $*IN ) 19:30
:)
sbp ...ooh
masak sbp: lines($file) returns an array of strings.
19:30 parduncia left
moritz_ masak: you're being evil, that recompiles the regex for each lines 19:30
masak moritz_: I'm evil. what else is new? 19:31
sbp sure, I'd use $regex there
but the // is the classiest thing there
does that operator actually do what it looks like it does?
masak aye.
"undef-or"
sbp blimey. awesome
PerlJam sbp: what does it look like it does to you? :)
19:31 eternaleye joined
moritz_ lines($*IN) has the disadvantage that it'll only do its work after all lines have beeen read from STDIN 19:32
sbp it looks like it transmutes base variables into gold
moritz_ ;-)
PerlJam for some reason I dislike all of the parenthetical forms for grep in that paste earlier.
masak moritz_: is that inherent, or just in current Rakudo?
moritz_ sbp: actually it's available in perl 5.10 as well
sbp oh, it reads the whole file into memory?
moritz_ masak: current rakudo
masak thought so.
moritz_ sbp: yes. Until somebody implements lazy lists.
masak moritz_: also, I'm waiting for your revised version that doesn't recompile the regex each time. where is it? :)
sbp moritz_: I see. so technically it could be read lazily, but that depends on the implementation and nothing in the language or the code? 19:33
moritz_ sbp: right
sbp masak: just my $regex = eval(...); and then using $regex there wouldn't work?
moritz_ masak: .say if $_ ~~ state $x //= eval(...) for ...
masak moritz_: there you go. :)
moritz_ sbp: sure it would
masak sbp: what moritz_ did.
sbp okay... so my version would work... 19:34
moritz_ sbp: but masak and I have some kind of competition going on
sbp *but* it requires two, stupid, lines?
masak sbp: I was looking for a one-liner.
sbp right
okay, makes sense to me... :-)
moritz_ found a bug ;-) 19:36
masak \o/
moritz_ bar
foobarbaz
blubb
Null PMC access in get_pmc_keyed()
current instr.: '!state_var_inited' pc 19160 (src/builtins/guts.pir:1206)
masak wtf?
moritz_ argl
masak was it the 'blubb' that did it?
moritz_ ./perl6 -e '.say if $_ ~~ state $r = eval("rx/{@*ARGS[0]}/") for lines(@*ARGS[1] // $*IN)' foo
that should have been the first line
the rest was input
and output 19:37
masak makes more sense. :)
masak tries
PerlJam why the eval exactly?
moritz_ PerlJam: because variables don't interpolate into regexes (yet)
sbp why the rx?
PerlJam okay, you're just working around the current implementation. 19:38
masak moritz_: I can reproduce.
moritz_ they are specced to work as regexes with <$regex>
sbp eval("/{...}/") works too, right?
masak sbp: aye.
moritz_ sbp: it works, but I'm never sure when bare /.../ should match immediately, and when it should construct a regex
masak moritz_: I don't think they ever match immediately. 19:39
sbp I see. so rx/ basically enforces a construct and keeps your mind neat?
moritz_ sbp: aye
masak moritz_: it's just where expressions etc that take them and match.
moritz_ masak: if /.../ { ... } # should that test the truthness of the regex object?
masak moritz_: I'd say do.
s/do/so/
rakudo: $_ = "foo"; if /bar/ { say "OH HAI" } 19:40
p6eval rakudo 78cb4c: OUTPUTĀ«OH HAIā¤Ā»
masak case in point.
PerlJam that be a bug 19:41
PhatEddy Came across another rt that looks closable if anyone is interested. 54800 (rt.perl.org/rt3/Public/Bug/Display....?id=54800)
rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(:y(3));
p6eval rakudo 78cb4c: OUTPUTĀ«Use of uninitialized valueā¤|3ā¤Ā»
masak PerlJam: how so?
PerlJam perlcabal.org/syn/S05.html#Return_v...om_matches
masak PhatEddy: looks good. 19:42
PhatEddy: closing.
PerlJam: indeed.
masak submits rakudobug
close one, submit one. life's good.
19:47 eternaleye_ left
jnthn For the closed ticket, did we have a regression test? 19:47
masak um. good question. 19:49
19:50 diakopter joined
diakopter rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(:y(3)); 19:50
p6eval rakudo 78cb4c: OUTPUTĀ«Use of uninitialized valueā¤|3ā¤Ā»
sbp by the way, I didn't realise you could use state variables outside of closures 19:52
diakopter rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(:y(3), :x(5));
19:52 ejs joined
p6eval rakudo 78cb4c: OUTPUTĀ«too many named arguments - 'x' not expectedā¤current instr.: 'foo' pc 86 (EVAL_17:50)ā¤Ā» 19:52
sbp what's it doing, treating the whole program as the closure scope basically?
diakopter rakudo: sub foo($x?, :$y = 2){ say "$x"~"|"~"$y"}; foo(:y(3), 5);
p6eval rakudo 78cb4c: OUTPUTĀ«5|3ā¤Ā»
sbp kinda hurts my head. I think I get the point about using it in that loop... 19:53
pmichaud 19:40 <masak> rakudo: $_ = "foo"; if /bar/ { say "OH HAI" } 19:54
not a bug.
masak pmichaud: oh, so spec is wrong?
pmichaud spec isn't wrong.
S05: Specifically, a C</.../> matches immediately in a value context (void, 19:55
Boolean, string, or numeric), or when it is an explicit argument of
a C<~~>. Otherwise it's a C<Regex> constructor identical to the explicit
C<regex> form. So this:
(...)
the 'if' statement puts the regex in a boolean value context, so it matches immediately.
masak pmichaud: why then is OH HAI printed? 19:56
pmichaud oh.
masak "foo" does not match /bar/.
pmichaud sorry, yes, *that* is a bug.
19:56 Alias joined
masak pmichaud: thank you. 19:56
pmichaud I was misreading.
19:56 M_o_C left 19:57 M_o_C joined
pmichaud is there a value context other than if/while/unless/until ? 19:57
moritz_ ?(/.../) perhaps?
lambdabot Unknown command, try @list
sbp finds the state def in S03, reads 19:58
masak lambdabot: sssh, grownups talking.
pmichaud ?(/.../) looks like a call to prefix:<?>(...) to me, though.
lambdabot Unknown command, try @list
moritz_ pmichaud: notionally it puts ... in boolean context, doesn't it? 19:59
sbp ooh, each of the scoping keywords corresponds to a trait...
pmichaud I think it evaluates ... for its boolean value
moritz_ maybe a regex object in boolean context just matches against $_?
including in ?(...)
pmichaud no, not any arbitrary regex object. 20:00
jnthn sbp: state applies to a block
pmichaud at least, I haven't been thinking of regex objects in that way.
jnthn sbp: The main body of the program counts as a block too.
sbp jnthn: thanks 20:01
moritz_ it would kinda be weird in the case where regex objects are stored in data structures, and sombody says 'if @re[0] { ... }' and meant something else
so maybe my idea isn't all that great
sbp why (reading on in S03) would one want to construct a Signature outside of its normal contexts?
pmichaud in particular, regex { ... } should never automatically match against $_, afaict. 20:02
sbp I don't really get the point
moritz_ sbp: functions return captures...
sbp: ... and if you want to select a value from a capture, binding the capture to a signature is an easy way 20:03
masak hasn't fully grokked signatures
PerlJam sbp: deep magic :)
jnthn sbp: You can also use them for unpacking nested data structures. 20:04
sbp ah! wait, I get it 20:06
jnthn looks forward to getting Rakudo doing that stuff, but hasn't worked out quite how yet
PerlJam re: /.../ matching in a value context, does that apply to the rx// form as well? 20:07
(i.e., is there no difference between rx// and // ?)
sbp right, I found this:
PerlJam nevermind, I'll look it up.
sbp Signature Function parameters (left-hand side of a binding)
Capture Function call arguments (right-hand side of a binding)
- S02
masak jnthn: would it be possible to use them for unpacking nested data structures on the pointy side of -> in for loops as well?
jnthn masak: yes
sbp moritz_: but I still don't get your technique
PerlJam ah, it's only the m// form that matches immediately. I was conflating m// and rx// there for a minute. 20:08
sbp so I understand that Signature is like the query constructed when you make a sub, and that the Capture is the result of the execution of the query against the parameters when the sub is called...
pmichaud PerlJam: I _think_ the primary reason for rx is to allow modifiers to be easily attached. 20:09
PerlJam so, $var = /.../ doesn't match immediately, but $var = ?/.../ does because the ? provides a value context.
moritz_ sbp: look at svn.pugscode.org/pugs/docs/Perl6/Sp...ainers.pod and the example for sub classify
sbp thanks, looking...
pmichaud normally immediate match is handled with m/.../
PerlJam right, I'm just trying to understand the non-normal stuff :) 20:10
pmichaud I'm not sure how we can know the context of ?, unless it's somehow "special"
which it could be.
PerlJam I would think that ?/.../, +/.../, and ~/.../ all match immediately because the prefix op provide value context to the // 20:11
pmichaud this gets back to my conversation with jnthn++ earlier -- how exactly is context detected there?
PerlJam (I don't understand "value context" really, but this is what I would think based on what the spec says)
pmichaud assuming that ?/.../ is really prefix:<?>( /..../ )
how does that argument learn that it's in a value context? 20:12
either prefix:<?> isn't multi, or there's something else going on
moritz_ pmichaud: it must be "more" than that, otherwise want() could never work
pmichaud moritz_: yes, that was my question earlier -- how exactly does want() work there?
perhaps it's sub prefix:<?>($x as Bool) { $x } ? 20:13
moritz_ maybe
diakopter rakudo: .:P
pmichaud and the "as Bool" imposes the context? But that doesn't feel quite right either.
p6eval rakudo 78cb4c: OUTPUTĀ«Multiple Dispatch: No suitable candidate found for 'concatenate_str', with signature 'PSP->P'ā¤current instr.: 'parrot;Perl6;Grammar;Actions;_block2731' pc 163431 (src/gen_actions.pir:8071)ā¤Ā»
moritz_ I guess only TimToady can answer that ;-)
20:13 goksie left
diakopter PSP->P 20:14
std: .:P
PerlJam sub prefix:<?>(Regex $x) { $x.does_it_match } # is there such a method?
p6eval std 26041: OUTPUTĀ«ok 00:02 35mā¤Ā»
jnthn I'm not sure I even want to know what Rakudo is trying to do there...
sbp moritz_: oh, I think I see. so like another way that could be done is simply making a hash and having 'odd' and 'even' be keys of the hash, but instead you're using the capture as a kind of default hash to make the syntax nicer? 20:15
diakopter std: .:()
pmichaud PerlJam: sure, but once you start changing prefix:<?> into a multi sub (which it would have to be), then context information seems to be lost
p6eval std 26041: OUTPUTĀ«ok 00:02 35mā¤Ā»
moritz_ jnthn: it's trying to call method :P on $_
PerlJam oh, bool or something? bit?
PerlJam doesn't remember
moritz_ sbp: yes
PerlJam pm: what do you mean "seems to be lost"?
moritz_ sbp: also note that signatures have more power, with 'is copy', 'is rw' etc 20:16
pmichaud PerlJam: how does $x know that it's in "boolean value context"?
sbp moritz_: ah, I see
diakopter std: :P.:P
p6eval std 26041: OUTPUTĀ«ok 00:02 35mā¤Ā»
moritz_ jnthn: that's how $file ~~ :e works right now, it calls the method :e on Str ;/ 20:17
PerlJam pm: I'm going to go with prefix:<?> is special :)
jnthn Man, is there any smiley that isn't valid Perl 6 syntax in some context yet? 20:18
PerlJam pm: somethings are context providers, others are context consumers. prefix:<?> is a provider
moritz_ std: /<[^:^]>/
p6eval std 26041: OUTPUTĀ«ok 00:03 35mā¤Ā»
pmichaud PerlJam: but in order to do that, we have to have something that makes it special. Either it has to thunk its arguments (so it can provide context), or there has to be something declarationally or syntactically to make that happen. 20:19
diakopter rakudo: :() ~ 1
sbp moritz_: only thing I don't get, why shouldn't (:@even, :@odd) be :(:@even, :@odd)?
p6eval rakudo 78cb4c: OUTPUTĀ«No applicable methods.ā¤ā¤current instr.: '_block14' pc 66 (EVAL_17:40)ā¤Ā»
PerlJam pm: I don't think you're going to get any syntactic help, so it's got to be the former. 20:20
20:20 barney left
moritz_ sbp: they could be. But positional arguments can always also be called by name 20:20
pmichaud so, what in the definition indicates that prefix:<?> thunks it argument?
moritz_ sbp: sub f($x) { ... } can be called with f(:x<3>) 20:21
pmichaud but more generally, consider $y + foo() 20:22
what's the want context for foo() ?
PerlJam numeric scalar (or whatever the right terminology is) 20:23
sbp moritz_: also, why the comma between the classify args?
moritz_: someone pointed out to me that svn.openfoundry.org/pugs/docs/Perl6...ctions.pod doesn't have the comma there
(in the same example)
literal that's an outdated version 20:24
moritz_ sbp: that repository is very old
literal perlcabal.org/syn/S29.html
PerlJam unless someone redefines infix:<+> I guess.
pmichaud PerlJam: but infix:<+> is already a Multi
moritz_ sbp: you should forget about that repoistory immediately ;-)
pmichaud and we can't decide which multi to call until we know what foo() returns. 20:25
sbp will do. I'll bludgeon my friend with clue too
PerlJam right.
pmichaud so foo can't know what its caller wants because we don't know the identity of its caller. 20:26
[particle] is there a single word for "ask a yes/no question"? 20:27
diakopter rakudo: .say(1)
p6eval rakudo 78cb4c: OUTPUTĀ«too many arguments passed (3) - 1 params expectedā¤current instr.: 'parrot;Perl6Object;say' pc 980 (src/classes/Object.pir:174)ā¤Ā»
masak [particle]: boolify? 20:28
[particle] i should say, a verb. like interrogate/query/ask 20:29
PerlJam pm: so ... thunks everywhere? Seems like that would kill performance. (Suddenly simple addition feels like I'm dealing with junctions :)
[particle] i guess not. boole only has nouns named after him.
lucs [particle]: If the word was 'florb' for example, can you give an example of its usage?
PerlJam verbing nouns is a great tradition.
diakopter rakudo: {say $^zzz}.(e) 20:30
p6eval rakudo 78cb4c: OUTPUTĀ«2.71828182845905ā¤Ā»
[particle] i'm tagging ~300 api functions by objects involved, attributes, and verbs
IsContactIDUnsubscribed - Checks if a contact is subscribed by a contact ID number.
i need a verb to signify boolean context 20:31
diakopter [particle]: how about 'whether'
[particle] maybe i should be specifying context separately from my verbs
jnthn masak can probably offer you an appropriate Chinese particle. ;-)
[particle] whether isn't a verb, but it does express the idea
masak there's always an appropriate Chinese particle.
jnthn There might even be some inappropriate ones too. ;-) 20:32
masak äŗ† (LE5), of course, being the all-time favourite.
en.wikipedia.org/wiki/Chinese_particles 20:33
jnthn [particle]: Well, "is" is a verb too... 20:34
masak albeit a strange one.
masak likes E-prime on some days. 20:35
jnthn Aye, some languages mostly do without it, some may entirely...
masak jnthn: Russian doesn't count. they just have a zero-length word for it. or a long dash.
jnthn: Chinese also doesn't count. all their adjectives are verbs. 20:36
every language cheats. :)
diakopter rakudo: say *
p6eval rakudo 78cb4c: OUTPUTĀ«Whatever<0xb6060098>ā¤Ā»
masak rakudO: say *.WHAT
rakudo: say *.WHAT 20:37
p6eval rakudo 78cb4c: OUTPUTĀ«Statement not terminated properly at line 1, near ".WHAT"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā»
masak rakudo: say (*).WHAT
p6eval rakudo 78cb4c: OUTPUTĀ«Whateverā¤Ā»
masak :)
[particle] rakudo: say *.WHAT()
p6eval rakudo 78cb4c: OUTPUTĀ«Statement not terminated properly at line 1, near ".WHAT()"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)ā¤Ā» 20:38
[particle] thought WHAT needed parens
20:38 kidd joined
pmichaud PerlJam: (thunks everywhere) -- you can see why I'm a bit confounded by 'what' :-) 20:39
sorry, by 'want'
moritz_ maybe it would be sane to get rid of what() entirely ;-)
though it won't be popular among perl 5 hackers at all
masak getting rid of want() is an intriguing idea.
jnthn Would replacing it with some built in type that you initialize with how it coerces in various contexts do? 20:41
fwiw, I have _very_ rarely used want in Perl 5.
But I'd look at what people are using it for to get an idea...
moritz_ literal: I just got a mail that we should try to convince students to hand in their GSOC applications *now*, so please feel informed and motivated ;-)
PerlJam I editted some code just this morning and added a call to wantarray.
literal moritz_: will do
moritz_ jnthn: people mostly do that to generate DWIMmy return values
jnthn: which IMHO is much easier in Perl 6 anyway 20:42
PerlJam moritz_: funny, I was thinking it easier in perl 5 since you only have 3 "types" to work with :)
moritz_ PerlJam: I'm rather impressed by the Match object, which IMHO is unbeatable in DWIMmyness ;-) 20:43
masak moritz_: right. we use objects in Perl 6 to DWIM values. 20:44
no need for want(). :)
20:44 Alias left
jnthn do not want() 20:44
moritz_ ;-)
masak 哈哈
pmichaud it might be nice to have a canonical way to create an instance that says "in boolean context do X, in numeric context do Y, in list context do Z, etc." 20:45
moritz_ should I write a mail to p6l suggesting its killing?
pmichaud where X, Y, and Z may be closures that are lazily evaluated.
moritz_ pmichaud: good idea
masak moritz_: please.
pmichaud I don't know if 'but' fills that niche already
moritz_ pmichaud: I don't think that 'but' is lazy in any way 20:46
masak pmichaud: class A { method Str { ... }; method Num { ... }; method Bool { ... } }
pmichaud masak: sure, I can do that for a class, I'm thinking more of an instance.
return $x but List({ ... })
masak pmichaud: just instantiate an anonymous class.
it doesn't get much more convenient than that. 20:47
_and_ it's OO! :)
pmichaud having to create an anonymous class for want semantics seems odd....
yet strangely consistent.
masak want() seems odd. :)
pmichaud oh, maybe it's: return value but role { method Str { ... }; } 20:48
amoc rakudo: my %hash = (1 => 2); say "%role<>" 20:49
p6eval rakudo 78cb4c: OUTPUTĀ«%role<>ā¤Ā»
amoc rakudo: my %hash = (1 => 2); say "%hash<>"
p6eval rakudo 78cb4c: OUTPUTĀ«%hash<>ā¤Ā»
pmichaud amoc: Rakudo doesn't recognize anything but $-vars in interpolated strings yet.
masak pmichaud: I like that.
pmichaud rakudo: my %hash = (1 => 2); say "{%hash<>}";
p6eval rakudo 78cb4c: OUTPUTĀ«ā¤Ā»
pmichaud hmmm.
my @list = (1,2,3,4); say "{@list[]}"; 20:50
masak bug?
amoc err..
pmichaud rakudo: my @list = (1,2,3,4); say "{@list[]}";
PerlJam looks like one to me.
p6eval rakudo 78cb4c: OUTPUTĀ«1 2 3 4ā¤Ā»
masak submits rakudobug
pmichaud yes, I suspect it's a bug in postcircumfix:< >
literal rakudo: my @list = (1,2,3,4); say "{@list}";
p6eval rakudo 78cb4c: OUTPUTĀ«1 2 3 4ā¤Ā»
pmichaud rakudo: my %hash = (1 => 2); say "{%hash}";
p6eval rakudo 78cb4c: OUTPUTĀ«1 2ā¤ā¤Ā»
literal only need the [] when interpolating without { } :P
PerlJam rakudo: my %hash = (1 => 2); say "{%hash{}}"; # does this work?
p6eval rakudo 78cb4c: OUTPUTĀ«1 2ā¤Ā»
pmichaud rakudo: my %hash = (1 => 2); say "{%hash{()}}"; 20:51
p6eval rakudo 78cb4c: OUTPUTĀ«ā¤Ā»
pmichaud heh.
%hash<> is the same as %hash{()} 20:52
which is an empty slice.
masak rakudo: my %hash = (1 => 2); say %hash<>;
p6eval rakudo 78cb4c: OUTPUTĀ«ā¤Ā»
PerlJam er, isn't <> the empty string?
pmichaud no, it's the empty list.
like ()
(unless the spec changed again on me)
literal more like Perl 5's qw() (or qw<>, etc) 20:53
PerlJam yeah, you're right. I keep thinking of <> as quotes rather than quote words since it's almost always used with one word as a hash subscript.
amoc ...'~' empty slice produces list of elements when interpolation i think
PerlJam so ... why doesn't the interpolation work yet? Is it just blocking on tuits or something more substatial? 20:54
er, substantial even
pmichaud amoc: not quite -- empty brackets or braces produce the entire list. But if there's an argument there, then we use whatever the argument returns.
20:55 masak left
pmichaud so: my @a = 1,2,3; my @b = (); say @a[]; # "123" 20:55
amoc ah i see
pmichaud so: my @a = 1,2,3; my @b = (); say @a[@b]; # ""
PerlJam: it's a parser issue.
amoc o_O?
pmichaud for [email@hidden.address] we have to be able to lookahead and make sure there's a postcircumfix at the end somewhere
amoc @a[@b] = () is by design? or not yet implemented? 20:56
lambdabot Unknown command, try @list
pmichaud by design. 20:57
amoc i see that it means, then, only empty brackets not empty list. 20:58
pmichaud in particular, people would be surprised if a 2-element @b produces a 2-element slice, a 1-element @b produces a 1-element slice, and a 0-element @b produces the entire list.
PerlJam I know I would be surprised.
amoc yes, yet it looks really great. 20:59
skids BTW, the name for the [] or {} feature is "Zen slice" 21:00
pmichaud yes, couldn't find it in S02.
21:01 sri_kraih_ joined 21:04 ZuLuuuuuu left
moritz_ mail to p6l sent 21:05
maybe not the brightest description :/
pmichaud looks okay. Note that my "value but role ..." is conjectural -- I have no idea if it's actually correct. :-P 21:07
21:07 sri_kraih left
moritz_ pmichaud: I see how it's allowed by current language rules 21:07
21:08 jhorwitz left
amoc good morning (here) 21:09
jnthn I think you'd get away with it.
std: my $x = 42 but role { method x { say "oink" } }; say $x. say $x.x; 21:10
p6eval std 26041: OUTPUTĀ«##### PARSE FAILED #####ā¤Obsolete use of . to concatenate strings; in Perl 6 please use ~ instead at /tmp/0t8Pro0Wj7 line 1:ā¤------> le { method x { say "oink" } }; say $x. say $x.x;ā¤FAILED 00:04 36mā¤Ā»
jnthn std: my $x = 42 but role { method x { say "oink" } }; say $x; say $x.x;
21:10 __felix__ joined
p6eval std 26041: OUTPUTĀ«ok 00:04 36mā¤Ā» 21:10
jnthn rakudo: my $x = 42 but role { method x { say "oink" } }; say $x; say $x.x; 21:11
p6eval rakudo 78cb4c: ( no output )
jnthn fail
21:11 ejs left
jnthn rakudo: my $r = role { method x { say "oink" } }; say $x.WHAT 21:11
21:11 __felix__ left
p6eval rakudo 78cb4c: OUTPUTĀ«Scope not found for PAST::Var '$x' in ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)ā¤Ā» 21:11
jnthn rakudo: my $r = role { method x { say "oink" } }; say $r.WHAT 21:12
p6eval rakudo 78cb4c: OUTPUTĀ«Codeā¤Ā»
jnthn Ah.
That is the Wrong Answer.
PerlJam rakudo: my $x = 42 but role { method x { say "oink" } }; say $x.WHAT;
jnthn rakudo: say (role { }).WHAT
p6eval rakudo 78cb4c: ( no output ) 21:13
rakudo 78cb4c: OUTPUTĀ«Codeā¤Ā»
pmichaud rakudo: my $x = class { }; say $x.WHAT;
p6eval rakudo 78cb4c: OUTPUTĀ«!ANON10ā¤Ā»
moritz_ std: 2 but role { ... }
p6eval std 26041: OUTPUTĀ«ok 00:02 35mā¤Ā»
pmichaud rakudo: my $x = role { }; say $x.WHAT;
p6eval rakudo 78cb4c: OUTPUTĀ«Codeā¤Ā»
jnthn rakudo: my $r = role { method x { say "oink" } }; say $r!select.WHAT
pmichaud shouldn't 'role' return a protoobject or something here?
p6eval rakudo 78cb4c: OUTPUTĀ«Method '!select' not found for invocant of class 'Sub'ā¤current instr.: 'parrot;P6metaclass;dispatch' pc 637 (src/classes/ClassHOW.pir:161)ā¤Ā»
moritz_ std: return 2 but role { method foo { ... } }
p6eval std 26041: OUTPUTĀ«ok 00:02 35mā¤Ā»
jnthn pmichaud: tbh I'd not really thought a whole load on anonymous roles... 21:14
So I'm not hugely surprised that it doesn't work.
pmichaud that's fine... I hadn't thought of them until today either :-)
jnthn ah
rakudo: my $x = role { }; say $x().WHAT
pmichaud I do wonder if it's really $value but Str({...}) instead, though.
p6eval rakudo 78cb4c: OUTPUTĀ«ā¤Ā»
jnthn oh ah hmm nasty. 21:15
Roles as multi subs is great for named ones...
pmichaud I think it's returning the Code block instead of the proto. Seems to work okay for 'class' though.
jnthn I suspect it's trying to construct something multi-ish but then getting horribly confused over the anonymity. 21:16
PerlJam rakudo: my $x = 42; say $x.WHAT;
p6eval rakudo 78cb4c: OUTPUTĀ«Intā¤Ā»
PerlJam rakudo: my $x = 42 but role { }; say $x.WHAT;
(dramatic pause...)
p6eval rakudo 78cb4c: ( no output ) 21:17
jnthn I'm surprised infix:<but> isn't exploding here too.
Ho hum. Rakudo bug it. :-)
diakopter arkduo: say 3 21:18
erm
PerlJam arkduo is rakudo's evil twin?
[particle] three is the magic number
PerlJam one of an evil triplet? :) 21:19
[particle] that's the whole idea of ark duo's
21:21 skids left 21:23 dKingston_ joined, dKingston left 21:46 hercynium left
Tene_ anyone know how many spectests pugs passes these days? 21:46
moritz_ maybe there are some reports on smoke.pugscode.org? 21:50
Tene_ ELAMEBROWSER
Tene_ on ircphone 21:51
moritz_ ELAMESERVER
I'm trying to get to that server, and it takes ages
Tene_ laaaaaaame 21:52
moritz++ # provides http proxy over irc :) 21:53
21:54 kane_ left, kane_ joined 21:56 Alias_ joined
diakopter uadork: say "rakudo" 21:57
erm
22:03 Limbic_Region joined 22:05 vinay joined, M_o_C left 22:07 FurnaceBoy left 22:08 orafu left 22:11 orafu joined 22:13 pmurias left, skids joined 22:14 awarefish left
PerlJam moritz_: Did you see Damian's reply re: want? Damian++ :-) 22:37
moritz_ PerlJam: no. Has it hit the list already? 22:39
22:39 moritz_ sets mode: +oooo Tene_ diakopter PerlJam [particle]
PerlJam dunno, I just saw it in my inbox 22:39
22:40 [particle] left 22:44 dduncan joined, dduncan left 22:46 nihiliad left
jnthn Just hit mine too. 22:46
moritz_ same here 22:48
(slow lists)--
23:06 PZt joined 23:11 exodist left 23:22 wayland76 left 23:35 nihiliad joined 23:36 wknight8111 joined 23:42 Maghnus joined 23:50 LimbicRegion joined, Limbic_Region left, LimbicRegion is now known as Limbic_Region 23:51 PhatEddy left, meppl left 23:59 PhatEddy joined