On Thu, Jun 02, 2005 at 12:52:36AM -0400, Jeff 'japhy' Pinyan wrote:
> Further woes, arguments, questions:
>
> In regards to <@array>, A5 says "A leading @ matches like a bare array..."
> but this is an over-generalization. A leading '@' merely indicates the
> rule is found in an array. <@arra
Further woes, arguments, questions:
In regards to <@array>, A5 says "A leading @ matches like a bare array..."
but this is an over-generalization. A leading '@' merely indicates the
rule is found in an array. <@array[3]> would be the same as
<$fourth_element_of_array>, assuming those two val
On Wed, 1 Jun 2005 19.37, Damian Conway wrote:
> Deborah Pickett wrote:
> > Someone please convince me otherwise.
> So what you want is not an identity value as default (which isn't even
> possible for many operators, as Luke pointed out), but a predictable
> failure value as default, so you can in
On Wed, Jun 01, 2005 at 03:42:57PM +1200, Sam Vilain wrote:
> I've made a start on this. See ext/Date in pugs. I don't think that
> your views are necessarily contrary.
That's what I'm looking for. Thank you!
> The biggest reason I didn't use DateTime was that I found it awkward
> for the comm
> > $ordered = [<] @array;
This is asking "Is @array ordered?" In the case of a 0-element or
1-element array, the answer is "It is not disordered", which means
$ordered is true.
$ordered = ! [!<] @array;
Rob
Juerd wrote:
Thomas Sandlass skribis 2005-05-28 17:34 (+0200):
I propose %hash = { key => :\$variable, foo => 'bar' };
:\$variable looks like many things to me, but not an alias.
Let's forget that idea, because I have a bunch of better ones!
$hash = { key => \ $variable but rw , foo =
Hi,
I just would like to share it with you. We had a weekend at the lake
Balaton on the last weekend, where I had a talk about Perl 6. The guys
liked it (the girls had sunbath during the event :), and one of them
(Poetro) said the summary: then we can say, that
Perl 6 is an "operator
Larry Wall wrote:
: my $b <== foo();
:
: declares $b to be an iterator rather than an array ref.
Though that would seem to imply that *$x slurpy parameters should
work that way too, and that's not how they work right now...
This is very in line with my current conclusion that List is
a s
Gaal Yahas wrote:
How do I specify the signature of a context-sensitive function?
sub foo() returns (what?) {
return want ~~ Scalar ?? cheap_integer_result :: List_of_Sheep;
}
If it were two subs, one would "is returns" Int and the other List of
Sheep. The draft S29 uses thin
Luke Palmer wrote:
For something like:
$ordered = [<] @array;
If @array is empty, is $ordered supposed to be true or false? It
certainly shouldn't be anything but those two, because < is a boolean
operator.
I have no problem with 3-state logic systems (true, false, undef) if
this is w
Sam Vilain wrote:
I also don't like implicit normalisation to seconds
underneath the hood when I'm doing basic date calculations, and
the way that the "DateTime" base class is inherantly based on the
Gregorian calendar.
I concur in this view. From a typing point of view there should
be some com
On Wed, 1 Jun 2005, Luke Palmer wrote:
I read that (mathematically) as "for all i, for all j such that j-i=1,
a_i
Yep, it sure is. Now tell Perl to read it that way for any operator.
Should _I_?!? ;-)
I wonder what a logic-oriented programming language a' la prolog would say
in this case.
Mark Reed wrote:
At least, not in cases where the intended result is consistent across 0.
Lots of date arithmetic falls into this category, and works beautifully with
the definitions above.
Does it? If you have a year 0, what is the number corresponding
to the middle of that year? Is it 0.5? Is
Hi,
You have to either supply an initial value or refactor your logic not
to allow an empty @array (as in the first case). If you want it some
other way, there are far too many special cases we have to work with,
some of which are just mathematically impossible.
I think `fail`ing is the best b
xOn 5/31/05, Sam Vilain <[EMAIL PROTECTED]> wrote:
> Rob Kinyon wrote:
> > I would love to see a document (one per editor) that describes the
> > Unicode characters in use and how to make them. The Set implementation
> > in Pugs uses (at last count) 20 different Unicode characters as
> > operators.
On 6/1/05, Michele Dondi <[EMAIL PROTECTED]> wrote:
> On Wed, 1 Jun 2005, Luke Palmer wrote:
>
> >$ordered = [<] @array;
> >
> > If @array is empty, is $ordered supposed to be true or false? It
> > certainly shouldn't be anything but those two, because < is a boolean
> > operator.
>
> I rea
Carl Franks wrote:
However, if I allowed the default 'new' to handle that case, then the
BUILD submethod has to be aware of that.
I thought it would be cleaner to 'document' the special case with a
seperate constructor, and also not require any special-case logic in the
BUILD submethod.
Is that
Carl Franks wrote:
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 th
On Wed, 1 Jun 2005, Luke Palmer wrote:
$ordered = [<] @array;
If @array is empty, is $ordered supposed to be true or false? It
certainly shouldn't be anything but those two, because < is a boolean
operator.
I read that (mathematically) as "for all i, for all j such that j-i=1,
a_i
Why sh
> 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
Deborah Pickett wrote:
You are going to see empty lists more often than you think in expressions like
$product = [*] @array;
and having to write that as
$product = [*] 1, @array;
just to protect against a common case doesn't exactly flaunt Perl's DWIMmery
to me. I *have* to write 1 there,
On 6/1/05, Deborah Pickett <[EMAIL PROTECTED]> wrote:
> I'm still in the camp of those wanting each operator to know its own identity
> value (perhaps in terms of a trait). The identity of multiplication (say) is
> always 1, after all, and it doesn't change depending on when you do
> multiplicatio
On Wed, 1 Jun 2005 13.19, Joe Gottman wrote:
> > Juerd asked:
> > >>2+ args: interpolate specified operator
> > >>1 arg: return that arg
> > >>0 args: fail (i.e. thrown or unthrown exception depending on use
> > fatal)
> >
> > > Following this logic, does join(" ", @foo) with [EMAIL
> 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
Two questions:
Should {} be an empty hash rather than an empty code?
Why did we change { %hash } from making a shallow copy of a hash to
the code that returns %hash?
Luke
25 matches
Mail list logo