S03 does not seem to detail a complete list of all Perl 6 operators.
For example, it explicitly mentions += but does not mention -=
Googling around, I found the Perl 6 Periodic Table of Operators
http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html
(which I assume does not form part of the
Luke Palmer wrote:
Supposing I had a "doc" trait, could I say:
sub f2c (Num $temp doc)
doc
{...}
Or would I be forced to spell it doc('stuff') ?
Well, first you need an `is` somewhere in there. And after that I think
you'll need to do it in doc('stuff') form. If we did allow doc<>,
James Mastros wrote:
$x = 42;
$a = \$x but false;
$b = \$y but blue;
Assuming you meant \$x in the last row we are dealing with three values:
42 but true
42 but false
42 but blue
Which are not identical but equal. The first value is not necessarily
implemented that way because the boolean value can
Larry Wall wrote:
On Fri, Apr 01, 2005 at 08:39:52AM -0700, Luke Palmer wrote:
: I'm pretty sure that =:= does what you want. If you have two scalar
: references, you might have to spell it like this:
:
: $$x =:= $$y
Unnecessary, I think. I want
$x =:= @y
to tell me whether the referenc
HaloO Juerd,
you wrote:
Thomas Sandlaß skribis 2005-04-01 23:37 (+0200):
So you expect $bar to contain value 2 and detach from $foo?
No. But if you said $baz instead of $bar, then yes.
Ohh sorry, I mis-read your mail as talking about chains of
references: $baz to $bar to $foo to 2. The last step co
On Fri, 2005-04-01 at 16:57, Tim Bunce wrote:
> So far http://pleac.sourceforge.net/ has comparative Perl Cookbook
> example for these languages:
[...]
> The maintainer, Guillaume Cottenceau <[EMAIL PROTECTED]>, is very happy to
> accept perl6 versions of Perl Cookbook examples.
Presumably people
Thomas Sandlaß skribis 2005-04-01 23:37 (+0200):
> Juerd wrote (with substitution applied):
> >IMO, =:= should not auto(de)reference.
> So you expect $bar to contain value 2 and detach from $foo?
No. But if you said $baz instead of $bar, then yes.
> How would one then reach the value in $foo? Wit
So far http://pleac.sourceforge.net/ has comparative Perl Cookbook
example for these languages:
- perl, 100.00% done (naturally, since they're from the book)
- python, 63.43% done
- ruby, 62.43% done
- guile, 30.00% done
- merd, 28.86% done
- ada, 26.00% done
- tcl, 25.00% done
- ocaml, 24
Juerd wrote (with substitution applied):
IMO, =:= should not auto(de)reference.
So you expect $bar to contain value 2 and detach from $foo?
How would one then reach the value in $foo? With $$baz?
And for longer chains of referene with a corresponding number
of $ on the front? But IIRC that was obvi
Juerd skribis 2005-04-01 22:35 (+0200):
> $foo :=: $bar; # true
> $foo :=: $baz; # also true?!
> IMO, :=: should not auto(de)reference.
s:g/:=:/=:=/
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.ht
Larry Wall skribis 2005-04-01 7:47 (-0800):
> : $$x =:= $$y
> Unnecessary, I think. I want
> $x =:= @y
> to tell me whether the reference in $x is to the same array as @y.
But
my $foo;
my $bar := $foo;
my $baz = \$foo;
$foo :=: $bar; # true
$foo :=: $baz; # also t
At 7:37 AM -0800 4/1/05, Larry Wall wrote:
On Thu, Mar 31, 2005 at 11:46:22PM -0800, Darren Duncan wrote:
: So, what is the operator for reference comparison?
The =:= operator is almost certainly what you want here.
Larry
Thanks to everyone for their answers. Last night I started coding
with =:=
On Fri, 2005-04-01 at 10:46, Larry Wall wrote:
> On Fri, Apr 01, 2005 at 08:04:22AM -0500, Aaron Sherman wrote:
> : In P6, an object is a data-type. It's not a reference, and any member
> : payload is attached directly to the variable.
>
> Well, it's still a reference, but we try to smudge the di
According to Abhijit Mahabal:
> sub f2c (Num $temp doc "Temperature in degrees F") {...}
Nce.
--
Chip Salzenberg- a.k.a. -<[EMAIL PROTECTED]>
Open Source is not an excuse to write fun code
then leave the actual work to others.
On Fri, Apr 01, 2005 at 08:39:52AM -0700, Luke Palmer wrote:
: I'm pretty sure that =:= does what you want. If you have two scalar
: references, you might have to spell it like this:
:
: $$x =:= $$y
Unnecessary, I think. I want
$x =:= @y
to tell me whether the reference in $x is to th
: On Thu, 2005-03-31 at 23:46 -0800, Darren Duncan wrote:
On Fri, Apr 01, 2005 at 08:04:22AM -0500, Aaron Sherman wrote:
:
: > What I want to be able to do is compare two references to see if they
: > point to the same thing, in this case an object, but in other cases
: > perhaps some other type
Sam Vilain writes:
> Darren Duncan wrote:
> >Now I seem to remember reading somewhere that '===' will do what I want,
> >but I'm now having trouble finding any mention of it.
> >So, what is the operator for reference comparison?
>
> As someone who wrote a tool that uses refaddr() and 0+ in Perl 5
On Thu, Mar 31, 2005 at 11:46:22PM -0800, Darren Duncan wrote:
: So, what is the operator for reference comparison?
The =:= operator is almost certainly what you want here.
Larry
On Thu, 2005-03-31 at 23:46 -0800, Darren Duncan wrote:
> What I want to be able to do is compare two references to see if they
> point to the same thing, in this case an object, but in other cases
> perhaps some other type of thing.
Let's be clear about the difference between P5 and P6 here. I
19 matches
Mail list logo