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
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
Brent,
Why not post the original query to p6compiler for their take on it?
Carl
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
> 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
> : 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
> 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
> 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
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
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
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
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
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+) )"
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
signatures and have to 'go back' to the
perl5-ish
sub do_this (*%args) { }
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
16 matches
Mail list logo