The topic for #perl6 is: pugscode.org/ planetsix.perl.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by TimToady on 25 November 2008.
ruoso .handled = 0; # in the beggining of CATCH 00:00
.handled = 1; # in the beggining of CATCH
.handled = 0; # in the end of CATCH
then no rethrow would be need 00:01
*needed
pmichaud ...except that marking an exception as handled (even temporarily) might roll up the stack? 00:02
ruoso only after the CATCH block was run
ruoso not before 00:02
pmichaud unless .handled is the way that the exception decides when to release its information 00:03
as opposed to being a simple flag.
(again, I don't have a definite working model -- I just have pieces I've observed from lots of other models, including Parrot) 00:04
*other _not-really-complete_ models 00:06
ruoso pmichaud, but do you think the releasing of that information would happen before the CATCH block finishes?
pmichaud I don't know. But S04 says: 00:07
That is, 00:08
the stack is not unwound until some exception handler chooses to
unwind it by "handling" the exception in question.
That seems to imply that "handling the exception" unwinds the stack.
or that it *could* unwinde the stack at that point.
*unwind
ruoso hmmm 00:09
pmichaud again, I'm not saying it does work that way -- just that the spec seems to leave room for it.
you're correct that we could all use some more definitive statements here :_)
ruoso is there any way that the smart matching could mark the exception as handled?
pmichaud I suppose, but I think we're getting to a point where we really need TimToady's ideas of how this all should work (beyond the minimal details given in S04) 00:10
ruoso but I really hope that implicit 'die $!' is just a conceptual note 00:11
and not really something supposed to be literally there
ruoso I'd be actually much happier with an implicit '.handled = 1' at the end of each when block inside CATCH 00:15
(if we have to add implicit things, that is) 00:16
anyway...
sleep &
cspencer rakudo: my $r = 'A'..'Z'; say $r.perl while (my $i = $r.shift) 00:25
p6eval rakudo 34458: OUTPUT«"B".."Z"␤"C".."Z"␤"D".."Z"␤"E".."Z"␤"F".."Z"␤"G".."Z"␤"H".."Z"␤"I".."Z"␤"J".."Z"␤"K".."Z"␤"L".."Z"␤"M".."Z"␤"N".."Z"␤"O".."Z"␤"P".."Z"␤"Q".."Z"␤"R".."Z"␤"S".."Z"␤"T".."Z"␤"U".."Z"␤"V".."Z"␤"W".."Z"␤"X".."Z"␤"Y".."Z"␤"Z".."Z"␤"AA".."Z"␤»
Tene ruoso: in rakudo right now, unhandled exceptions are rethrown. You can prevent that by setting the ['handled'] of the exception, which makes it just .return() instead. iirc. 00:48
That's what I remember implementing, which is only weak evidence at best.
cspencer rakudo: say "a".succ 02:34
p6eval rakudo 34462: OUTPUT«b␤»
cspencer rakudo: say "a".pred 02:35
p6eval rakudo 34462: OUTPUT«a␤»
meppl good night 02:41
pugs_svn r24656 | lwall++ | [Spec] get rid of some fossil uses of * spotted by masak++ 03:17
Patterner rakudo: say "@".pred 03:27
p6eval rakudo 34463: OUTPUT«@␤»
pugs_svn r24657 | lwall++ | [Spec] differentiate $*ARGFILES from the $*ARGS capture, noticed by zev++ 03:30
pugs_svn r24658 | lwall++ | [Spec] remove fossil typecast noticed by masak++ 03:36
pugs_svn r24659 | lwall++ | [range-by.t] fix parsefail 04:21
pmichaud @tell TimToady it feels really odd to me that variable declarations of the form "my Int $x" end up going through <multi_declarator>. Any specific reason why that's the case? 04:39
lambdabot Consider it noted.
TimToady pmichaud: see S04:78 re "my proto $x" 04:42
lambdabot TimToady: You have 7 new messages. '/msg lambdabot @messages' to read them.
pmichaud seems like it might be easier to parse 'proto' inside of variable declarator
TimToady you can also mark each declaration with "multi" 04:43
pmichaud ah.
then that's why :-)
TimToady also gives us "my multi &foo" if we want it 04:44
pmichaud okay.
would 'multi' be used with anything other than a subroutine var?
TimToady it can be used on any duplicate declaration that you want to suppress warnings on 04:47
pmichaud okay.
thanks for the quick answer.
TimToady say, if you write a macro containing "my multi $x = foo()"
unlike with functions, all those $x are the same var though 04:48
TimToady so we don't have to track interior scopes, just current lexical scope, for eval and such 04:48
ruoso: I would say that the "die $!" is merely notional, except that we also have to handle real die in a CATCH without requiring every CATCH block to have a CATCH block within it, which would be problematic... 04:51
I'd say that die within a CATCH block is one way to signal that the current exception was not handled yet. The new exception needs to be recorded within the the current $!, probably 04:52
though we should think about whether we want to try to find an exception handler outside the CATCH first, which seems problematic 04:53
if someone suggests making $! a junction of outstanding exceptions, we can shoot them :) 04:54
pmichaud hey! Maybe we should make $! into a junct.... <kapow!> 04:55
TimToady or maybe the original die just calls the first CATCH it finds, and relies on it to call subsequent CATCHes 04:56
in that case, die would want to see if it's throwing a different exception, and incorporating the old $! if so 04:57
maybe that's a cleaner model
in any case, die doesn't unwind the stack, so it can be used to continue searching if we like
cspencer rakudo: my $r = Range.new(:from(10), :to(1)); $r.minmax.say 05:18
p6eval rakudo 34463: OUTPUT«101␤»
cspencer rakudo: my $r = Range.new(:from(1), :to(10)); $r.minmax.say 05:19
p6eval rakudo 34463: OUTPUT«110␤»
cspencer pugs: my $r = Range.new(:from(10), :to(1)); $r.minmax.say 05:20
p6eval pugs: OUTPUT«*** No such subroutine: "&Range"␤ at /tmp/u7FaHZOpjH line 1, column 4-37␤»
cspencer pugs: my $r = 10..1; $r.minmax.say 05:21
p6eval pugs: OUTPUT«*** No such method in class Array: "&minmax"␤ at /tmp/6UwTRKx8fG line 1, column 16 - line 2, column 1␤»
TimToady I don't think pugs ever had Range objects 05:22
cspencer that would explain things :)
is the output for the first one i'd sent to rakudo correct? 05:23
it returns "10 1" for the minmax
though the :by is positive
pmichaud iirc, when :by is positive, minmax returns .from and .to 05:24
although I wasn't completely clear on that part of the spec.
TimToady: BTW, S02 shows Range as immutable, but I think that must not be the case if it has .pop and .shift
cspencer ah ok, yes, that's what it says in S03 05:25
TimToady we might be confusing two different concepts under one name 05:30
Tene The difference between Range being immutable and ranges being immutable. 05:40
cspencer rakudo: my $r = Range.new(:from(10), :to(1)); $r.min.say 05:44
p6eval rakudo 34463: OUTPUT«10␤»
cspencer rakudo: my $r = Range.new(:from(1), :to(10)); $r.min.say
p6eval rakudo 34463: OUTPUT«1␤»
Matt-W rakudo: class Foo { has $.bar; method baz() { $.bar = 'Wibble'; } } Foo.new.baz(); 07:16
p6eval rakudo 34468: OUTPUT«Statement not terminated properly at line 1, near "Foo.new.ba"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
azawawi good morning 07:30
Matt-W Morning
pugs_svn r24660 | azawawi++ | [gimme5] removed extra 'our $DELIM;' that was causing a variable redeclaration warning 08:21
r24661 | azawawi++ | [Syntax::Highlight::Perl6] updated to the latest perl6.vim 08:24
azawawi @tell TimToady i have managed to write a testcase for a problem i have been recently having with STD (sial.org/pbot/34090) 09:53
lambdabot Consider it noted.
pmurias sorry, about people typing stuff into my terminal 10:38
pmurias moritz_: i installed scons myself 10:44
pugs_svn r24662 | schwarzer++ | fix some minor issues while reading through README & friends 11:29
r24662 | schwarzer++ | - whitespaces (+format)
r24662 | schwarzer++ | - typos
r24662 | schwarzer++ | - style
r24662 | schwarzer++ | nothing of interest, really
icwiener Should entries that are present in READTOO and READTHEM be removed from READTOO? 11:30
Ok, I'll just do it since it is mentioned in the READTOO file. :) 11:47
pugs_svn r24663 | schwarzer++ | remove entry that is available in both READTOO and READTHEM 11:49
pmurias mildew: $OUT.print("works\n") 12:07
p6eval mildew: No output (you need to produce output to STDOUT)
icwiener Is there a reason for many smartlinks being # L<S03/Changes to Perl 5 operators/Bitwise operators get a data type prefix> instead of # L<S03/Changes to Perl 5 operators/"Bitwise operators get a data type prefix"> (see the quotes) as stated in the README file? 12:31
szabgab Is there an __END__ in Perl 6 ? 12:34
pugs_svn r24664 | pmurias++ | [smop] P5Interpreter.eval can now load XS modules 12:36
r24664 | pmurias++ | commented out the SMOP initialisation code to enable it being used from an embedded p5
r24664 | pmurias++ | [mildew] updated t/p5.t
pmurias szabgab: no 12:37
szabgab reverting to =begin =end for commenting out large chunk of code
pmurias it's =begin END and $=END 12:38
see S02:3065
szabgab thanks 12:42
STD does not seem to like it 12:43
pugs_svn r24665 | schwarzer++ | fix broken smartlinks 12:51
r24665 | schwarzer++ |
r24665 | schwarzer++ | - do not use format specifier in paragraph description
r24665 | schwarzer++ | - adapt to changes in the synopsis' texts
pmurias szabgab: it doesn't like what? 12:52
ruoso just sent an email to p6-language with all his concerns about compile-time vs run-time 13:18
pmurias ruoso: use happens at parse time 14:28
ruoso: why can't some modules be staticly linked? 14:29
* statically 14:30
rakudo_svn r34490 | pmichaud++ | [rakudo]: spectest-progress.csv update: 264 files, 5913 passing, 0 failing 14:40
ruoso pmurias, some modules require loading symbols that are only available at some specific runtiem 15:46
i.e.: an apache module 15:47
ruoso how would be a sane way to get the current continuation in Perl 6? 16:29
pmurias ruoso: it's intentionaly not specced 16:30
ruoso because considering that each CATCH/CONTROL block needs to rethrow the exception, we need to store the continuation where the exception refers to into the continuation
masak ruoso: IIRC, $larry doesn't want to expose continuations, due to differences in implementations/platforms. 16:31
ruoso: however, gather/take can be made to provide continuations at least in some cases.
I guess yours is not such a case, however.
pmurias masak: gather/take provides coroutines 16:32
masak pmurias: yes.
ruoso unless we assume that when you instantiate an exception (i.e.: .new()), it automatically stores the continuation where it was created
pmurias, masak, gather/take doesn't solve my problem because it creates a new coroutine, I need to refer to the current continuation 16:33
masak ruoso: yes, I guessed as much.
pmurias ruoso: we need a way to refer to the interpreter object 16:34
ruoso er... $*VM ?
rakudo: say $*VM; 16:35
p6eval rakudo 34496: OUTPUT«␤»
pmurias we don't really need to expose it to Perl 6
ruoso right...
some time ago, larry agreed on implementation-specific-macros to be named in a ___FOO___ scheme 16:36
___INTERPRETER____ 16:37
masak moritz_: ping 16:38
ruoso hmm... I think Code needs an API to call with current continuation 16:41
CATCH and CONTROL blocks need it
masak ruoso: does the fact that Perl 6 is meant to be implemented in Perl 6 mean that call/cc needs to be exposed in the language? 16:42
or does it just mean that it needs to be exposed in the implementation used to implement Perl 6? 16:43
ruoso hm.... that's not the reason
the reason is that the CATCH and CONTROL blocks are executed "with the caller of the enclosing routine as its back" 16:44
vixey you can implement call/cc by turning all the code to CPS form (but I guess that doesn't really say..)
masak ruoso: "as its back"?
ruoso masak, as the outer in the stack 16:45
ruoso to where it would return to 16:45
pmurias vixey: turning all code to CPS form isn't really the nicest thing
vixey yes
ruoso meaning that if the CATCH block throws a new exception, it goes straight to block outside the block that encloses the CATCH
vixey, but SMOP already does a kind of CPS
pmurias we do more of a "couroutine passing form" 16:46
masak ruoso: I understand all the words you're saying, but...
ruoso that's why it's so easy to deal with continuations in SMOP
masak I don't really see how it all fits together.
vixey I haven't looked at SMOP in months.. better check it again :)
ruoso pmurias, a continuation doesn't need to be re-invokable to be a continuation
ruoso conceptually, a continuation is simply something that represents "the rest of the execution" 16:47
masak ruoso: aye. 16:48
masak has read Ch 3 of "Lisp In Small Pieces" very carefully and many times 16:49
ruoso masak, sub foo { fail 1 }; sub bar { foo(); CATCH { fail 2 }; }; sub baz { foo(); {CATCH { when 2 { # it gets here } } } };
if you think on the nested blocks
pmurias has to borrow "Lisp In Small Pieces" some day from the library
masak ruoso: hold on, thinking :) 16:50
ruoso the CATCH block is *inside* bar
but it goes straight to *outside* bar
when it fails...
and this all happen before the stack is unwinded from the exception being thrown 16:51
masak wait, wait. I assume that besides declaring three subs, you also call something. which one? baz?
ruoso yes
masak and bar is never executed?
ruoso meh.. baz was supposed to call bar
masak let's start from a correct example :P 16:52
ruoso ok
masak, sub foo { fail 1 }; sub bar { foo(); CATCH { fail 2 }; }; sub baz { bar(); {CATCH { when 2 { # it gets here } } } }; baz()
masak also, the CATCH block in baz looks strange.
ruoso it does have an extra { }
but it doesn't care
masak intentionally?
ok.
ruoso actually
the oppening { is in the wrong place 16:53
let me re-write it *again*
masak :)
ruoso masak, sub foo { fail 1 }; sub bar { foo(); CATCH { fail 2 }; }; sub baz { bar(); CATCH { when 2 { # it gets here } } }; baz()
right... now it should be fine
masak so the order of events is (1) baz called (2) bar called (3) foo called
ruoso yes...
then foo fails
masak (4) exception 1 thrown (5) and caught
ruoso bar tries to catch it
but fails again 16:54
masak (6) exception 2 thrown (6) and caught
ruoso exactly...
masak and we end up in the `when 2 {}` block
ruoso yes
masak what's the problem?
ruoso but the important thing
masak seems we just walk down and up the call stack.
ruoso except that the call stack is not unwinded until the exception is handled 16:55
masak fair enough.
ruoso note that inside &bar, the exception from foo is *not* handled
which means that we have not one, but two exceptions
masak that just means that we keep stack frames below out current depth.
ruoso and each of those exceptions point somehow to the continuation where they were thrown 16:56
masak ...so that we kan resume execution from there?
ruoso eventually, yess
(if the exceptino does Resumable, according to TimToady) 16:57
masak could one resume both? :)
ruoso good question
masak or will resuming a higher one invalidate the lower one?
ruoso but the point here...
is that the CATCH block doesn't try to CATCH its own exceptions
{ fail 1; CATCH { fail 2 }} 16:58
masak ah, right.
it only catches things that come in from callees. 16:59
but surely that can be solved without continuations? just make the CATCH block recognize and rethrow its own block's exceptions.
ruoso masak, it actually means that CATCH is executed as if it was called by this routine's caller 17:00
it never even see its own exceptions
masak ruoso: ok. I see how that can work too, but it sounds complicated. 17:01
why do it that way?
ruoso it only sounds complicated if you don't support call//cc 17:02
masak ruoso: no, it sounds complicated if you've first thought of the idea of CATCH blocks recognizing and rethrowing their own block's exceptions :) 17:04
pmurias ruoso: how should i "use SMOP" withought installing SMOP? 17:08
ruoso setting -I and LD_LIBRARY_PATH
pmurias hates LD_LIBRARY_PATH 17:09
what should i set LD_LIBRARY_PATH to?
ruoso to where libsmop.so is 17:10
pmurias if i just -I../smop/SMOP i get an error that the object can't be found 17:11
ruoso have you built SMOP xs? 17:12
run make test in SMOP/smop
pmurias perl Makefile.pl;make in smop/SMOP
ruoso yes
if you run make test 17:13
it will show what you need to add in -I
pmurias ok 17:14
Matt-W Does rakudo have zip yet?
masak Matt-W: sure!
Matt-W Hmm so it's not that then
masak rakudo: <1 2 3> Z <a b c>
p6eval rakudo 34497: RESULT«["1", "a", "2", "b", "3", "c"]»
Matt-W oh 17:15
I thought it was called zip() 17:16
masak Matt-W: well, that too.
Matt-W: I'm not sure the function form is implemented.
rakudo: zip(1)
p6eval rakudo 34502: OUTPUT«Could not find non-existent sub zip␤current instr.: '_block14' pc 55 (EVAL_13:38)␤»
masak seems not.
Matt-W ahah
that might be fairly easy to do then
if the operator's alreadydone, which it is
masak Matt-W: depends.
Matt-W yeah there could be something hideous 17:17
masak there's supposed to be semicolons in the arg list of zip()
Matt-W but if I'm going to contribute I need to start somewhere
masak I don't know if those are supported yet.
Matt-W hmm they may not be
masak Matt-W: pmichaud and jnthn will know that.
Matt-W because I tried doing for zip(blah blah; blah blah) and it said statement not terminated correctly
ruoso will consider that Code.postcircumfix:<( )> accepts a named parameter cc to support call/cc
masak Matt-W: sounds like typical unawareness of intra-arglist semicolon, yes. 17:18
Matt-W but on the bright side
the code I'm trying to write actually works!!
masak Matt-W++
pmichaud zip() doesn't exist because we don't have slice context yet.
Matt-W and I've got to use roles and methods and inheritance and stuff :)
it's like I'm writing code in Perl 6! 17:19
oh wait... I am!
pmichaud (i.e., we don't parse semicolons in argument lists yet)
Matt-W pmichaud: okay, well at least there's Z, saved me a lot of effort just now
pmichaud yeah, Z is simpler because the arguments are already parsed the way we expect :-)
Matt-W :D
pmichaud I'm working on parameter passing now
(but it's a major refactor, so it'll be a while.) 17:20
Matt-W pmichaud++
Is it just me, or do roles seem far more natural than ordinary inheritance for a lot of things?
pmichaud it's not just you.
Matt-W I suspect they're going to be used an awful lot
ooh 17:21
I don't suppose rakudo supports heredocs?
pmichaud not yet. 17:22
Matt-W I'll do it the other way then
masak heredocs might actually be the last thing I miss in Rakudo. 17:25
but I don't miss them very much, since ordinary strings work almost as well.
Matt-W I tend to use them a fair bit in Perl 5 code, so I miss them in just about every other language
I don't get to use much Perl at work :( so I have to bash my way through C++ a lot and its string handling is of course fairly poor 17:26
I believe food is nearly ready
&
masak is there some way to make a class internal to a sub? 17:55
ruoso my class 17:56
masak rakudo: sub x { my class A { has $.foo } }; say A.new.foo
p6eval rakudo 34502: OUTPUT«␤»
masak that a bug? 17:57
ruoso masak, yes... it should have failed 18:02
pugs_svn r24666 | ruoso++ | [smop] CATCH and CONTROL is run with the outer of the block that contains the CATCH block as caller, providing the semantics as explained by TimToady yesterday. the CATCH and CONTROL blocks need to rethrow the exception if they dont handle it 18:03
r24666 | ruoso++ | [smop] adding OutOfItemsException, needed to support Iterator (this need to be spec)
r24666 | ruoso++ | [smop] $capture.named returns false if the named argument doesnt exist
r24666 | ruoso++ | [smop] Code.postcircumfix:<( )> accepts :$cc named parameter to support call/cc
r24666 | ruoso++ | [mildew] move CATCH blocks setup to the top of the block, the same way as CONTROL
masak I can report it later, when I have web access.
pugs_svn r24667 | ruoso++ | [smop] $code.($capture, :cc($continuation)) never returns... 18:05
ruoso actually, the above commit message is wrong...
$code.postcircumfix:<( )>($capture, :cc($continuation)) never returns 18:06
$code.() is the same as $code()
pugs_svn r24668 | ruoso++ | [smop] OutOfItemsException works like ControlExceptionReturn, but looks for CATCH instead of CONTROL 18:08
ruoso TimToady, what do you think about the :cc named parameter to postcircumfix:<( )> ? 18:09
pugs_svn r24669 | ruoso++ | [spec] name OutOfItemsException in the DRAFT S07 18:11
cspencer rakudo: my $r = 1..10; say $r 18:14
p6eval rakudo 34502: OUTPUT«12345678910␤»
pugs_svn r24670 | ruoso++ | [mildew] a test showing throw inside catch 18:22
ruoso pmurias, now we officially have return again, but now with the proper semantics as explained by TimToady :) 18:23
ruoso later & 18:25
rakudo_svn r34511 | bernhard++ | [doc] Change the filename in PDO to the real filename 18:40
cspencer rakudo: my $r = 1..10; while (my $i = $r.shift()) { say "i = $i (" ~ $r.perl ~ ")" } 20:07
p6eval rakudo 34516: OUTPUT«i = 1 (2..10)␤i = 2 (3..10)␤i = 3 (4..10)␤i = 4 (5..10)␤i = 5 (6..10)␤i = 6 (7..10)␤i = 7 (8..10)␤i = 8 (9..10)␤i = 9 (10..10)␤i = 10 (11..10)␤»
gourav hi i have been able to download PARROT from SVN 21:37
did make and make test on it but when i am trying to run make install then it says : "WARNING:
Installing Parrot may interfere with developing Parrot
on the same machine. This is a temporary flaw in the
Parrot build system.
To use the make install target, type: make reallyinstall
/usr/bin/perl -e "exit(1)"
make: *** [install] Error 1"
please let me know what should i do now 21:38
ruoso gourav, I'd recommend using parrot in the build directory at this moment 21:39
gourav how do i do that i am new to perl development and to open source development as well, so i need some step by step guidance 21:40
vixey gourav: well the question is do you really want to install it despite what that message says? 21:42
gourav what i understand is that if i have to modify some parts of the code then i have to rebuild it once again. as it suggests it might interfere with the original code in that case 21:44
gourav so if you are working on it please guide me on how to proceed 21:45
this is my first time and i know i am asking some really silly questions here
it is 3:20 am in India and i am determined to start working on PERL6 development provided i get some help 21:47
pmurias gourav: what do you want to proceed with? 21:51
gourav i am a beginner so you tell me the best way to start contributing
pmurias do you want to contribute to the Parrot VM or to rakudo? 21:53
you could look at TODO
i'm not a parrot guy so it's hard to tell me what's the best way to contribute 21:54
gourav raduko
gourav so please tell me about raduko 21:55
pmurias i work on an alternative perl6 compiler (mildew) so i'm not the best person to tell you about rakudo 21:56
gourav okies 21:58
so difference b/w Parrot VM and Raduko is it is a Parrot implementation of perl. am i right 21:59
pmurias rakudo is the compiler, parrot is the vm 22:00
gourav got it
so i am really interested in raduko development 22:01
pmurias what do you want to code in?
gourav is there any one over there to provide some guidance?
pmurias there = ?
gourav that is what someone has to help me with? 22:02
i have absolutely no clues on that
mberends gourav, is your OS unix compatible? 22:15
gourav yeah
i work on UBUNTU
mberends can you make a symbolic link to the perl6 executable in one of the directories in your search path? 22:16
for example, sudo ln -s /home/myname/parrot/languages/perl6/perl6 /usr/local/bin 22:18
that way you can try lots of perl6 commands at the shell prompt
scrolling back, it looks like you should also do 'make perl6' in the parrot directory 22:22
gourav thanks a lot its 4:00 am here and i have to hit office in another 5 hours. I will surely try this and let you know by tomorrow 22:22
mberends ok 22:23