Re: identity tests and comparing two references

2005-04-01 Thread Aaron Sherman
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. In

Re: identity tests and comparing two references

2005-04-01 Thread Larry Wall
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

Re: identity tests and comparing two references

2005-04-01 Thread Luke Palmer
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 to

Re: identity tests and comparing two references

2005-04-01 Thread Larry Wall
: 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

Re: identity tests and comparing two references

2005-04-01 Thread Larry Wall
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

Re: Documentary annotations: $what docwhy

2005-04-01 Thread Chip Salzenberg
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.

Re: identity tests and comparing two references

2005-04-01 Thread Aaron Sherman
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

Re: identity tests and comparing two references

2005-04-01 Thread Darren Duncan
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 =:=

Re: identity tests and comparing two references

2005-04-01 Thread Juerd
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

Re: identity tests and comparing two references

2005-04-01 Thread Juerd
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.html

PLEAC - Programming Language Examples Alike Cookbook

2005-04-01 Thread Tim Bunce
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,

Re: identity tests and comparing two references

2005-04-01 Thread Juerd
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? With

Re: identity tests and comparing two references

2005-04-01 Thread Thomas Sandlaß
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

Re: identity tests and comparing two references

2005-04-01 Thread James Mastros
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

Re: identity tests and comparing two references

2005-04-01 Thread Thomas Sandlaß
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

Re: Documentary annotations: $what docwhy

2005-04-01 Thread Sam Vilain
Luke Palmer wrote: Supposing I had a doc trait, could I say: sub f2c (Num $temp docTemperature in degrees F) docConvert degress F to degrees C {...} 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

Definitive and Complete Perl 6 Operator List

2005-04-01 Thread Andrew Savige
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