Re: use fatal err fail

2005-09-29 Thread Carl Franks
On 29/09/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > * "try { foo() } err next" will next even if foo() did not throw > an exception, but returned undef. But I don't think that's a problem > in most cases. One can always do: > try { foo(); 1 } I think that's a flag that it's not

Re: my $key is sensitive;

2005-10-05 Thread Carl Franks
Brent, Why not post the original query to p6compiler for their take on it? Carl

Re: new sigil

2005-10-21 Thread Carl Franks
Where did you get ALT-155 from? I've just checked the windows Character Map, and ¢ (cent) is ALT-0162 ( If it's not in your startmenu, do start -> run -> charmap ) It displays in Eclipse (3.1.1) whether the Text File Encoding is set to Cp1252 (default) or UTF-8 or ISO-8859-1 Cheers, Carl

Re: new sigil

2005-10-21 Thread Carl Franks
On 21/10/05, Steve Peters <[EMAIL PROTECTED]> wrote: > On Fri, Oct 21, 2005 at 09:42:00AM +0100, Carl Franks wrote: > > Where did you get ALT-155 from? > > > > I've just checked the windows Character Map, and ¢ (cent) is ALT-0162 > > ( If it's not in

default values for attributive parameters

2005-04-21 Thread Carl Franks
Are default values supported for attributive parameters in an argument list? I wish to convert these 2 subroutines to perl6: sub foo { my $self = shift; $self->{foo} = defined $_[0] ? shift : undef; } sub bar { my $self = shift; $self->{bar} = defined $_[0] ? shift : $DEFAULT; } Is th

pass hash to sub expecting named params?

2005-04-25 Thread Carl Franks
signatures and have to 'go back' to the perl5-ish sub do_this (*%args) { } Carl Franks

Re: pass hash to sub expecting named params?

2005-04-25 Thread Carl Franks
That puts my mind at ease! Many thanks, Carl On 4/25/05, Luke Palmer <[EMAIL PROTECTED]> wrote: > Carl Franks writes: > > Will it be valid to pass a hash to a subroutine expecting named > > params, if the hash keys match the names? > > > > sub do_this

Re: Nested captures

2005-05-09 Thread Carl Franks
Are you subscribed to perl6-compiler? Yesterday Patrick Michaud posted "PGE features update (corrections)" which describes the results you've got: * Match objects for nested captures are nested into the surrounding capture object. Thus, given rulesub = p6rule(":w (let) ( (\w+) \:= (\S+) )"

Re: ./method

2005-05-19 Thread Carl Franks
On 5/19/05, Martin Kuehl <[EMAIL PROTECTED]> wrote: > I have tried, but I can't make myself like it. I'm afraid I have to agree. When I saw it used in code after this discussion (I think it must have been somewhere in pugs t/ or ext/) my reaction was "yuck". (for what it's worth) Carl

hash slice from array items

2005-05-25 Thread Carl Franks
Is [EMAIL PROTECTED] the correct way to get a hash slice using elements of an array? (it's giving me a compilation error with pugs) Cheers, Carl

Re: hash slice from array items

2005-05-25 Thread Carl Franks
On 5/25/05, Jonathan Scott Duff <[EMAIL PROTECTED]> wrote: > Works just fine for me. What version of pugs are you using? Perhaps > you need to upgrade. Ok, I've just realised I had missed a '->' to '.' in my perl5 to perl6 conversion, I was trying to do [EMAIL PROTECTED] = $obj->list; I wasn't

construction clarification

2005-05-30 Thread Carl Franks
I have a class that normally takes a list of named arguments. I also want to be able to handle a single argument. class Foo { multi method new (Class $class: Str $date) { return $class.bless(date => $date); } submethod BUILD ($.date, $.time, $.offset) { # some error checking here

Re: construction clarification

2005-06-01 Thread Carl Franks
> It's *a* correct way. But redundant in this particular case. > The universal new() would handle the one-argument call exactly the same > as your overloaded new() does. Presumably, however, the one-argument variant > would do something else as well. Some people will need to call the constructor w

Re: construction clarification

2005-06-01 Thread Carl Franks
> The universal new() would handle the one-argument call exactly the > same as your overloaded new() does. Is that correct? S12 says... All classes inherit a default new constructor from Object. It expects all arguments to be named parameters initializing attributes of the same name. ... whi

Re: proposal: binding with a function

2005-06-15 Thread Carl Franks
> : alias newlines, newline; Isn't it possible to add a Role to the relevant Class, which specifies that is 'handles' the method name you want as an alias? Carl

Re: When can I take given as read?

2005-06-21 Thread Carl Franks
> sub factorial (Int $n is topic) { > return 1 when 0; > return $n * factorial $n; > } hmm, could we write... sub foo (Class $self is topic: +$foo, +$bar) { .method; } to avoid having to use ./ ? Cheers, Carl