Re: for ... else

2007-03-04 Thread Rick Delaney
On Mar 04 2007, Smylers wrote: > for @invoice > { > .process; > } or fail 'No invoices to process'; If that actually works then I'm happy. -- Rick Delaney [EMAIL PROTECTED]

Re: for ... else

2007-03-02 Thread Rick Delaney
kit. [% FOREACH records %] [% whatever %] [% ELSE %] Search returned no records. [% END %] -- Rick Delaney [EMAIL PROTECTED]

Re: Outlaw to declare a lexical twice in the same scope

2006-09-11 Thread Rick Delaney
ed states. Presumably you will be able to make warnings fatal as in Perl 5 so you should be able to get the behaviour you want, too. -- Rick Delaney [EMAIL PROTECTED]

Re: WTF? - Re: method calls on $self

2005-07-14 Thread Rick Delaney
iguity. An error here would just be confusing. Now, for those who want .abc to call $?SELF.abc within the given block then I think it would be clearer if they spelled out that intention with something like given $y { use dot '$?SELF'; # or just 'use dot' with suitable default when 1 { .abc } # calls $?SELF.abc } -- Rick Delaney [EMAIL PROTECTED]

Re: split /(..)*/, 1234567890

2005-05-12 Thread Rick Delaney
emented as such. > > pugs> map { ref $_ } split /(..)*/, 1234567890 > (::Str, ::Array::Const) Sorry if I'm getting ahead of the implementation but if it is returning $0 then shouldn't ref($0) return ::Rule::Result or somesuch? It would just look like an ::Array::Const if you treat it as such. -- Rick Delaney [EMAIL PROTECTED]

Re: Scoping of $/

2005-05-10 Thread Rick Delaney
t; > > > sub bar() { > > "def" ~~ /^(.)/; # $1 now "d" > > foo(); > > say $1;# Outputs "d" > > } > > > > bar(); > > > > # Correct (I hope so)? > > Yeah, they're lexical, just like in Perl 5. Not just like Perl 5, I hope. If it was then the above would print "d". -- Rick Delaney [EMAIL PROTECTED]

Exegesis 7: Why so many field specifiers?

2004-03-01 Thread Rick Delaney
or it. It also clearly distinguishes the field type for two-character fields. Neither of these is a strong argument for changing the existing design but I'm wondering why the first table above would be easier to learn/remember than the second. -- Rick Delaney [EMAIL PROTECTED]

E6 (sort of): All levels of complex data structs marked ro?

2003-08-02 Thread Rick Delaney
even close: method FETCH ($var, $index) { my $val = $var[$index]; return $val unless $val.can("STORE"); my $x is very_read_only := $val; return $x; } And how the trait connects to the FETCH-replacing I don't even know where to begin. -- Rick Delaney [EMAIL PROTECTED]

Re: Arrays: Default Values

2003-01-29 Thread Rick Delaney
undef_to(0). There is no default here, only a rule saying what assignment of undef stores. Accessing an uninitialized element should raise an exception, not give zero. In the case where people want assigning undef to set the default (i.e. treat undef the same as uninitialized) then they would set both properties to the same value. my int @a is default(1) is undef_to(1); -- Rick Delaney [EMAIL PROTECTED]

Re: Arrays: Default Values

2003-01-29 Thread Rick Delaney
given, and no spam warning issued). This sort of logic deferral is > common to many uses of undefined values (or "NULL") in databases, even > when columns have defaults that are non-null. The reference to databases is salient. There are surely many examples to be found in SQL books. -- Rick Delaney [EMAIL PROTECTED]

Re: Exposing regexp engine & compiled regexp's

2001-01-08 Thread Rick Delaney
The overload technique can be made considerably less ponderous by creating one class that behaves as your proposal. Then those that like it could just use RFC93 sub { $_[1] ? $fh->pushback($_[0]) : $fh->getn($_[0]) }; my $scalar = RFC93->new; $scalar =~ /pat/; -- Rick Delaney [EMAIL PROTECTED]