Re: [TODO] tools/dev/genrpt.pl is obsolete

2006-01-18 Thread Joshua Hoblitt
Bernhard++

-J

--
On Tue, Jan 17, 2006 at 09:55:47PM +0100, Bernhard Schmalhofer wrote:
> It looks like the script 'tools/dev/genrpt.pl' does basically the same as
> 'parrotbug'.
> In order to decrease the level of confusion I propose to remove 
> genrpt.pl and the associated make targets 'ok', 'okfile', 'nok', 'nokfile'.
> 
> CU, Bernhard
> 
> 


pgpG0htM7mbFm.pgp
Description: PGP signature


Re: [perl #38260] [BUG] Parrot::Config contains invalid info

2006-01-18 Thread Joshua Hoblitt
On Tue, Jan 17, 2006 at 12:44:56PM -0800, jerry gay wrote:
> attached is my lib/Parrot/Config.pm file generated from r11223, on
> windows using msvc. inside you'll find a few things, like keys given
> unix file path values,
>  'bin_dir' => '/usr/local/bin',
> 
> an invalid key,
>  'Parrot::Configure::Data=HASH(0x193a650)' => '   ',

I'll clean that up...

> and unexpanded values,
>  'libparrot' => '$(LIBPARROT_STATIC)',
>  'libparrot_ldflags' => '$(LIBPARROT_STATIC)',
>  'libparrot_shared' => 'libparrot$(SHARE_EXT)',

I believe those are only intended to be substituted into root.in and are
working as designed.  The design could made a little cleaner thou...
any takers?

-J

--


pgpgSuMJ1EUMd.pgp
Description: PGP signature


Re: [perl #38264] Bug in compute_dominance_frontiers?

2006-01-18 Thread Jonathan Worthington

"Bob Rogers (via RT)" <[EMAIL PROTECTED]> wrote:


  The attached code compiles to byte code OK in r11235, until you
comment out the push_eh indicated by the patch, which makes
compute_dominance_frontiers take forever.  (Sorry; I wish I had time to
try to make it smaller.)  TIA,

I hit upon this the other day, but with a 4,500 line PIR file which I've 
also failed to get to a better test case.  I'll see what I can do.


In the meantime, we don't actually need compute_dominance_frontiers unless 
we are optimizing so far as I can see, so I have ci'd a change to only do 
that when the optimize flag is set.


I've cc'd in Curtis Rawls who I believe implemented the routine - Curtis, 
any chance you may have time to have a quick look at this?


Thanks,

Jonathan 



Re: [PATCH] struct Parrot_Context doesn't need a 'prev' field.

2006-01-18 Thread Leopold Toetsch

Bob Rogers wrote:

   From: Matt Fowles <[EMAIL PROTECTED]>




   Why leave it in as a placeholder at all?

   Matt

Good question.  I did so because of the "common header with
Interp_Context" comment in struct Parrot_Context. 


Yep. And this common header is actually used in e.g. 
mark_register_stack. But we could move e.g. C there and safe 
one word of context space.


leo



Re: split on empty string

2006-01-18 Thread David K Storrs


On Jan 18, 2006, at 1:18 AM, Jonathan Scott Duff wrote:


On Tue, Jan 17, 2006 at 12:35:57PM -0500, Mark Reed wrote:

On 2006-01-17 12:24 PM, "Gaal Yahas" <[EMAIL PROTECTED]> wrote:

[split on empty string] doesn's seem to be specced yet.


I would prefer the current pugs behavior; it's consistent with the  
general
case, in which a string which does not match the splitting regex  
results in
a single-item list containing the original string.  This is the  
Python

behavior.

I find the Perl5 (and, surprisingly, Ruby) behavior rather  
counterintuitive.


FWIW, I agree with Mark.

-Scott


Just to show opposite, I've always found that behavior (i.e.  
returning the original string unchanged) confusing.  C works  
based on sequential examination of the target string to locate  
matching substrings on which to split.  There is a matching "empty  
string" substring between every character.  Naturally, what you get  
back is an array of characters.


Plus, it's a useful idiom.

--Dks



Re: split on empty string

2006-01-18 Thread Mark Reed
On 2006-01-18 10:04 AM, "David K Storrs" <[EMAIL PROTECTED]> wrote:
> Just to show opposite, I've always found that behavior (i.e.
> returning the original string unchanged) confusing.  C works
> based on sequential examination of the target string to locate
> matching substrings on which to split.  There is a matching "empty
> string" substring between every character.  Naturally, what you get
> back is an array of characters.
> 
> Plus, it's a useful idiom.

You misunderstand.  We're not talking about splitting a string with the
empty string as the delimiter.  We're talking about splitting the empty
string (as the target), with any delimiter whatsoever.  If you do that, what
you get back is an empty array.

Perl6 "".split(/whatever/) is equivalent to split(/whatever/,"") in Perl5.
It's not like the silly Python idiom where the invocant is the delimiter
string. :)

So this is the Perl5 to which I was referring:

   my @result = split(/whatever/, "");
   print [EMAIL PROTECTED],"\n";# --> 0

The general case I was comparing it to is when the target string is *not*
empty but doesn't match, in which case you get the original string back:

my @result = split(/foo/, "bar");
print [EMAIL PROTECTED],"\n";# --> 1
print $result[0],"\n";   # --> "bar"





Re: split on empty string

2006-01-18 Thread Jonathan Lang
Mark Reed wrote:
> Perl6 "".split(/whatever/) is equivalent to split(/whatever/,"") in Perl5.

I'm hoping that the perl 5 syntax will still be valid in perl 6.

--
Jonathan "Dataweaver" Lang


[perl #38269] Build broken r11243

2006-01-18 Thread via RT
# New Ticket Created by  Will Coleda 
# Please include the string:  [perl #38269]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=38269 >



Make realclean, config with these options:

CXX='ccache g++-4.0'
CC='ccache gcc-4.0'
/usr/bin/perl Configure.pl --cc="$CC" --cxx="$CXX" --link="$CXX" -- 
d="$CXX" --optimize --parrot_is_shared $@

then make fails with:

Invoking Parrot to generate runtime/parrot/include/config.fpmc -- 
cross your fingers
./miniparrot config_lib.pasm > runtime/parrot/include/config.fpmc
dyld: lazy symbol binding failed: Symbol not found: _sprintf$LDBLStub
   Referenced from: /Users/wcoleda/research/parrot/blib/lib/ 
libparrot.dylib
   Expected in: flat namespace

dyld: Symbol not found: _sprintf$LDBLStub
   Referenced from: /Users/wcoleda/research/parrot/blib/lib/ 
libparrot.dylib
   Expected in: flat namespace

$ sw_vers
ProductName:Mac OS X
ProductVersion: 10.4.4
BuildVersion:   8G32




Re: Indeterminate forms for the Num type.

2006-01-18 Thread Doug McNutt
At 09:38 +0800 1/18/06, Audrey Tang wrote:
>Also, would you be happy with different treatments of Int/Int versus
>Num/Num?
>
>   0/0 # fail "illegal division by zero"
>   0.0/0.0 # NaN

I plead guilty. I was not aware that perl6 was going to allow types to be 
defined like int and float.

While learning perl 5 I was frustrated by that lack at first but I came to like 
it after a while because the treatment of strings that happen to be numbers is 
well done.

$serial = "48";

behaves like a numeric 48 if I add to it but I don't have to perform an sprintf 
to get the zeros back if my goal is to repeat the value read from some HTML 
page or cookie. As a Gegenbeispeil try entering that or even a date in M$Excel. 
It will be immediately converted to a floating point seconds after the epoch 
and there is no way to recover the input text. I hate it.

So. . .

If perl6 will allow me to define a variable as type int64, int32, or things 
like that then division by zero should be an exception as should overflow on 
addition.

If "the perl way" is the goal then users who don't want to go to C should be 
treated to $numerics that allows for strings, scientific notation, and the like 
while doing the right thing. For that, converting 0/0 to a floating point 
division with a NaN result is quite proper.

The important thing is that ($aa + $bb)/$aa should return 1.0 when $bb is a NaN 
underflow or if $aa is a NaN Inf. Those may not be the best examples but you 
get the idea. Some intermediate results can return NaN's in a way that 
inclusion in a later calculation can produce a correct result in spite of the 
NaN. Numeric values often come from an external source. Unnecessary and 
confusing validation of that kind of input should not be required just to keep 
a program running. Just let the final answer show as a NaN and keep the 
programming clear and short.
-- 
-->  There are 10 kinds of people:  those who understand binary, and those who 
don't <--


Re: Indeterminate forms for the Num type.

2006-01-18 Thread Larry Wall
On Wed, Jan 18, 2006 at 09:38:04AM +0800, Audrey Tang wrote:
: Also, would you be happy with different treatments of Int/Int versus
: Num/Num?
: 
:   0/0 # fail "illegal division by zero"
:   0.0/0.0 # NaN

I'd like to point out that there's no reason in principle that a failure
undef can't return NaN in numeric context, so we don't actually have
to distinguish those two cases normally (though "use fatal" might
distinguish them).

By and large I agree with Darren.  The boxed types should opt for
consistency over efficiency while the unboxed types should opt for
efficiency of consistency.  So perhaps we just say that boxed NaN is
indistinguishable from undef--in particular, unboxing one in numeric
context gives you back the NaN.  I don't know whether it makes sense
to extend that to ±Inf though.  Maybe it does.  We're kinda fuzzing
that idea anyway already.  Undefined numbers vary in definedness much
like undefined generic prototype objects, aka "classes".

All undefs are created unequal, but some are more unequal than others.

Long term I think we'll end up asking these objects whether they're
defined according to one of their roles.  So the infinities know they
have a defined sign, for instance, but not a defined magnitude (except
insofar as infinity is considered a separate defined concept).  And
an object might be considered defined as a Mammal but undefined (so far)
as a Dog or Cat.  So instead of $num.defined or $animal.defined we
might have $num.defined(Sign) or $animal.defined(Dog|Cat).  If you
omit the arg then .defined devolves to something like what we have now,
where the definedness is decided by the class of the object.

Note this is not quite the same as .does(Dog|Cat), since an undefined
proto object returns true for that but false for .defined(Dog|Cat) unless
one of those roles thinks the object is sufficiently initialized to
be considered defined.  For most roles that could implicitly determined
by whether the BUILD for that role has run, assuming BUILD always
produces a complete initialization.

Maybe "defined" is the wrong word for it anymore.  It's more like "okay"
or "normal" or "nominal" or "functional".  I could go for $Fido.good(Dog). :-)

Larry


Class methods vs. Instance methods

2006-01-18 Thread Rob Kinyon
Today on #perl6, Audrey, Stevan and I were talking about $repr. A
tangent arose where Audrey said that the difference between class
methods and instance methods was simply whether or not the body
contained an attribute access.

Is this true? If it is, then I think it violates polymorphism as
demonstrated by the following:

class Dog {
method tail { "brown and short" }
};

class Chihuahua is Dog {
has $.color;
method tail { $.color _ " and short" }
};

You can say Dog.tail, Dog.new.tail, Chihuahua.new.tail, but not
Chihuahua.tail. That's extremely counter-intuitive.

I think that class methods should be explicitly defined as class
methods and you cannot call a class method upon an instance, just as
you cannot call an instance method upon a class. Plus, this should be
determinable (for the most part) at compile time, which is a bonus,
imho.

Thanks,
Rob


Re: split on empty string

2006-01-18 Thread Larry Wall
On Tue, Jan 17, 2006 at 07:24:14PM +0200, Gaal Yahas wrote:
: While cleaning up tests for release:
: 
: "".split(':')=>
: 
:()# Perl 5
:("",) # pugs
: 
: Which is correct? It doesn's seem to be specced yet.

This has nothing to do with splitting on the empty string, per se, but
with Perl 5 stripping trailing null fields by default:

@results = split(/:/,'');
print @results + 0; # prints '0'

I think we could make that behavior optional now with :trim or some
such.  The original motivation has largely gone away with the advent
of autochomping filehandles, so split /\s+/ won't produce a spurious
null field after the \n.

Larry


Re: [perl #38262] get external modules out of the parrot repo

2006-01-18 Thread Bernhard Schmalhofer

jerry gay (via RT) schrieb:

# New Ticket Created by  jerry gay 
# Please include the string:  [perl #38262]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=38262 >



perl modules necessary for parrot configuration, development, and
testing have been either committed to the parrot repo, assumed to be
installed by the user, or (in some cases) checked for in code that
uses them.

this mish-mash is causing confusion for developers, testers, and end
users of parrot. all of them are left asking the same question, "what
external modules do i need to use parrot?"

we should have a better answer than "run it and see."

i think that better answer should be in the form of CPAN bundles. a
development bundle (Bundle::Parrot::Devel), a test bundle (::Test),
perhaps a seperate smoke bundle (::Smoke), and perhaps a bundle for
end users (::Install.)
 


We could also go the other way.  Put everthing we need into the Parrot
repository, so that the answer to the above question would be:

  Nothing, it is all in the distribution.

- Bernhard




Re: [PROPOSAL] named arguments

2006-01-18 Thread Leopold Toetsch


On Jan 13, 2006, at 14:29, Leopold Toetsch wrote:


Below are some thoughts, syntax mainly, how it could look like.


And now a bit of named arguments passing semantics.

0. Call and return are symmetric, I'll use function call here, because
   it's more commonly used with named. (Arguments are passed to the 
function,

   which receives params)

1. Call arguments can have two zones: positional and named
1.1 Both argument zones are optional, but the order matters
1.2. Positional arguments is that what is currently specced in pdd03
 i.e. a sequence of 'normal' args or :flat'tened args
1.3. Named arguments are either a pair ('name' => arg) or are flattened
 out from an Hash
1.4. Arguments are strictly processed as they appear in the call

2. Function parameters can be in 4 zones: positional, positional_slurpy,
   named, and named_slurpy
2.1. All 4 param zones are optional, order matters
2.2. All positional arguments are processed first, filling up:
- first all positional params
- if a slurpy array is present it gets the rest
- else if there are named params, these are filled
- if there are unprocessed positionals, an exception is thrown
- if there are unfilled positional params, which are not marked with
  :optional, a param count mismatch exception is thrown
2.4. named arguments can only fill named param slots, but the procedure 
is

 the same
   - fill all named params, or course according to their name
   - if there are excess args, and a named_slurpy is present, fill it
 with a Hash of unprocessed named arguments
   - else if there are unprocessed args throw exception
   - if there are unfilled, non-optional named params throw exception

Comments welcome,
leo



Re: [perl #38262] get external modules out of the parrot repo

2006-01-18 Thread jerry gay
On 1/17/06, via RT jerry gay <[EMAIL PROTECTED]> wrote:
> perl modules necessary for parrot configuration, development, and
> testing have been either committed to the parrot repo, assumed to be
> installed by the user, or (in some cases) checked for in code that
> uses them.
>
> this mish-mash is causing confusion for developers, testers, and end
> users of parrot. all of them are left asking the same question, "what
> external modules do i need to use parrot?"
>
> we should have a better answer than "run it and see."
>
here's a list of external modules committed to the parrot repo, and
where they're used:

~ Class::Struct -- can't find it used anywhere. recommend deletion.
~ Digest::Perl::MD5 -- used by dev/build tools.
~ File::Which -- used by configure
~ Parrot::* -- used by config, build, test. not really external
modules, recommend they stay.
~ Parse::RecDescent -- used by some languages in testing
~ Pod::Simple -- used by Parrot::Docs::* modules
~ Pod::Escapes -- used by Pod::Simple
~ Test::* -- used by test and some languages in testing
~ Text::Balanced -- used by build, and Parse::RecDescent

i've only given recommendations for obvious choices here. comments welcome.
~jerry


Re: split on empty string

2006-01-18 Thread Juerd
Jonathan Lang skribis 2006-01-18  7:26 (-0800):
> Mark Reed wrote:
> > Perl6 "".split(/whatever/) is equivalent to split(/whatever/,"") in Perl5.
> I'm hoping that the perl 5 syntax will still be valid in perl 6.

Don't worry, it is.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html


Re: [perl #38262] get external modules out of the parrot repo

2006-01-18 Thread jerry gay
On 1/18/06, Bernhard Schmalhofer <[EMAIL PROTECTED]> wrote:
> jerry gay (via RT) schrieb:
> >perl modules necessary for parrot configuration, development, and
> >testing have been either committed to the parrot repo, assumed to be
> >installed by the user, or (in some cases) checked for in code that
> >uses them.
> >
> >this mish-mash is causing confusion for developers, testers, and end
> >users of parrot. all of them are left asking the same question, "what
> >external modules do i need to use parrot?"
> >
> >we should have a better answer than "run it and see."
> >
> >i think that better answer should be in the form of CPAN bundles. a
> >development bundle (Bundle::Parrot::Devel), a test bundle (::Test),
> >perhaps a seperate smoke bundle (::Smoke), and perhaps a bundle for
> >end users (::Install.)
> >
> >
> We could also go the other way.  Put everthing we need into the Parrot
> repository, so that the answer to the above question would be:
>
>Nothing, it is all in the distribution.
>
true, but i think DRY (don't repeat yourself) applies here. there's
already a standard repository for these modules, so why clutter the
parrot repo? users can then install only the cpan bundles they need,
rather than a whole host of modules they won't use if they're not
testers or developers.

~jerry


[perl #38235] [TODO] Rename (dyn)?classes to (dyn)?pmc

2006-01-18 Thread Bernhard Schmalhofer via RT
> [bernhard - Di 17. Jan 2006, 13:02:44]:

> > > I propose to rename 'src/classes' to 'src/pmc' 
> > >
> > Yes, and for consistency please also rename dynclasses to dynpmc and
the 
> > t/dynclass to t/dynpmc.

The second step of directory renaming has been completed. Altogether
follwing dirs have move:

  src/dynclasses  -> src/dynpmc
  t/dynclass  -> t/dynpmc
  src/classes -> src/pmc

Please do a 'svn up' followed by a 'perl Configure.pl'.
If 'svn status' reports a spurious dir 'src/dynclasses', 't/dynclass' or
'src/classes', then simple remove it.

Please holler, when scripts or tests are failing.

   Bernhard   

-- 
/* [EMAIL PROTECTED] */


Re: split on empty string

2006-01-18 Thread Larry Wall
On Wed, Jan 18, 2006 at 09:08:07PM +0100, Juerd wrote:
: Jonathan Lang skribis 2006-01-18  7:26 (-0800):
: > Mark Reed wrote:
: > > Perl6 "".split(/whatever/) is equivalent to split(/whatever/,"") in Perl5.
: > I'm hoping that the perl 5 syntax will still be valid in perl 6.
: 
: Don't worry, it is.

Yep, it's mostly just the semantics we're screwing around with.  :-)

Larry


Re: Class methods vs. Instance methods

2006-01-18 Thread Larry Wall
On Wed, Jan 18, 2006 at 01:56:53PM -0500, Rob Kinyon wrote:
: Today on #perl6, Audrey, Stevan and I were talking about $repr. A
: tangent arose where Audrey said that the difference between class
: methods and instance methods was simply whether or not the body
: contained an attribute access.
: 
: Is this true? If it is, then I think it violates polymorphism as
: demonstrated by the following:
: 
: class Dog {
: method tail { "brown and short" }
: };
: 
: class Chihuahua is Dog {
: has $.color;
: method tail { $.color _ " and short" }
: };
: 
: You can say Dog.tail, Dog.new.tail, Chihuahua.new.tail, but not
: Chihuahua.tail. That's extremely counter-intuitive.

I don't think it's counterintuitive.  You've defined Dog with an
invariant .tail but not Chihuahua.  It's doing exactly what you asked
for under a prototype view of reality.

: I think that class methods should be explicitly defined as class
: methods and you cannot call a class method upon an instance, just as
: you cannot call an instance method upon a class. Plus, this should be
: determinable (for the most part) at compile time, which is a bonus,
: imho.

I believe this is already determinble at compile time for the most part.

But I have a strong gut-feeling that over the long term it's going to
be important to be able to view a given object as either a partially
instantiated class or a partially undefined object, and for that we have
to break down the false class/instance dichotomy.  And to the extent
that the dichotomy *isn't* false, we're trying to sweep classness into
the .meta object, which is the *real* class object in Perl 6.

Larry


Re: Class methods vs. Instance methods

2006-01-18 Thread Matt Fowles
Larry~

On 1/18/06, Larry Wall <[EMAIL PROTECTED]> wrote:
>
> But I have a strong gut-feeling that over the long term it's going to
> be important to be able to view a given object as either a partially
> instantiated class or a partially undefined object, and for that we have
> to break down the false class/instance dichotomy.  And to the extent
> that the dichotomy *isn't* false, we're trying to sweep classness into
> the .meta object, which is the *real* class object in Perl 6.

Perhaps I am just being short sighted, but I never saw this as a false
dichotomy.  In fact, every time I hear about these "partially
instatiated" I cringe in horror about the strange halfway lands we
might end up in... Oh no, this method can only be called on an object
that is 3/4 initialized, and you supplied one that is 2/3 initialized
that causes undefined behavior.

Could you provide a concrete example of the advantage of this approach
please?  Failing that can you try and expand on your gut feeling a
bit?

Thanks,
Matt
--
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-Stan Kelly-Bootle, The Devil's DP Dictionary


Re: [perl #38217] r11124: Cygwin build fails

2006-01-18 Thread Jonathan Worthington

"Greg Bacon" <[EMAIL PROTECTED]> wrote:

I'm still seeing a link failure with r11221.

Discovered I have cygwin on this PC, went to investigate and...happens>...the link failure is gone as well as the auto-import warnings. 
Sadly, there's a new problem that I really have no idea about (aside from 
the fact that the DLL doesn't get created in the right place, but that can 
be fixed easily enough).  When you run miniparrot.exe, it immediately 
segfaults.  Please can someone verify this isn't just me having a dodgy 
cygwin setup?


Thanks,

Jonathan 



Um... this week's summary

2006-01-18 Thread The Perl 6 Summarizer
Unless Matt takes pity on me, and writes a summary at disgustingly
high speed, there won't be a summary this week. Assorted things got in
the way on Monday or Tuesday, and I'm now at my consulting gig 'til
the end of the week with no time for summarizing.

I'm really, really sorry.
-- 
Piers Cawley <[EMAIL PROTECTED]>
http://www.bofh.org.uk/


Re: [perl #38217] r11124: Cygwin build fails

2006-01-18 Thread Greg Bacon
In message <[EMAIL PROTECTED]>,
Larry Wall writes:

: Looks like the same problem we were having before.  If we have to have
: -L/usr/local/lib in there, it should probably come after your personal
: -L/home/gbacon/src/parrot/blib/lib so that -lparrot prefers the one
: you just built.  You ran nm on a different libparrot than the one
: the linker used.

I doubt it. On my machine's entire filesystem, there is but one
libparrot.dll.  My /usr/local/lib is empty, so that's not a source
of collisions.

How cool to elicit a reply from $Larry about lowly little Cygwin!

Larry loves the Perl-y platforms,
All the platforms of the world!
Hokey, buggy, wacked, and nice,
They are precious in his sight.
Larry loves the Perl-y platforms of the world!

I know you know the tune. :-)

Greg


perl6-all@perl.org

2006-01-18 Thread Stevan Little

Hello All,

In reading over the Synopsis again in hopes of finding more  
information regarding the different repr types (see the warnocked  
post entitled "Construction and Initialization of repr types other  
than P6opaque"), I stumbled onto some issues with the Perl 6 OO model  
and &bless.


In S02 it says:

Perl 6 is an OO engine, but you're not generally required to  
think in OO
when that's inconvenient. However, some built-in concepts such  
as filehandles

will be more object-oriented in a user-visible way than in Perl 5.

Now taking this statement one (logical) step further, and I assume  
that this means things like arrays and hashes will (underneath) just  
be objects. So we will have an ^Array class, and a ^Hash class, and  
[] and {} will actually construct instances of ^Array and ^Hash  
respectively. (Of course I am simplifying it here, these may be roles  
instead of classes, but this is not relevant to the discussion really).


Then later on S12 says:

As in Perl 5, a constructor is any routine that calls bless.  
Unlike in Perl 5,
you call it as a method on the class, passing the candidate as  
the first

argument. To bless a hash as in Perl 5, say:

$object = $class.bless({k1 => $v1, k2 => $v2, ...});

Are we not just re-blessing an instance of the class ^Hash into  
whatever $class is? That does not seem to be what is intended,  
however, if {} is a constructor for an instance of ^Hash, and I can  
call methods on {} like any other object ({}.keys, {}.exists($key),  
etc.), then what happens when I bless {} with a class? Do I loose  
access to the methods of ^Hash? Are the methods only allowed to be  
called in the non-invocant syntax (called like functions and not  
methods)?


Which brings me to my real question:

Do we really still need to retain the old Perl 5 version of &bless?  
What purpose does it serve that p6opaque does not do in a better/ 
faster/cleaner way?


Thanks,

Stevan 


Re: [perl #38262] get external modules out of the parrot repo

2006-01-18 Thread Joshua Hoblitt
On Tue, Jan 17, 2006 at 04:55:36PM -0800, jerry gay wrote:
> i think that better answer should be in the form of CPAN bundles. a
> development bundle (Bundle::Parrot::Devel), a test bundle (::Test),
> perhaps a seperate smoke bundle (::Smoke), and perhaps a bundle for
> end users (::Install.)

The whole point of 'Bundles' is so that you don't have to install a
bunch of modules by hand.  Creating 3 or 4 bundles that all have to be
installed just so that you can build and test parrot is really defeating
the purpose.  There should be just one bundle if any at all.

> installation of the necessary modules should be checked at configure
> time, and an informative message should be given to the user if there
> are missing dependencies.

That's just another configure step but it had better be run first... 

-J

--


pgpYqACFsoadF.pgp
Description: PGP signature


perl6-all@perl.org

2006-01-18 Thread chromatic
On Wednesday 18 January 2006 14:13, Stevan Little wrote:

> Do we really still need to retain the old Perl 5 version of &bless?
> What purpose does it serve that p6opaque does not do in a better/
> faster/cleaner way?

Interoperability with Perl 5 code.

Now if you want to write a p6opaque <-> Perl 5 thunking layer

-- c


Re: [perl #38262] get external modules out of the parrot repo

2006-01-18 Thread chromatic
On Wednesday 18 January 2006 14:53, Joshua Hoblitt wrote:

> > installation of the necessary modules should be checked at configure
> > time, and an informative message should be given to the user if there
> > are missing dependencies.

> That's just another configure step but it had better be run first...

This sounds an awful lot like what a Makefile.PL or a Build.PL does.

-- c


Re: Class methods vs. Instance methods

2006-01-18 Thread Rob Kinyon
On 1/18/06, Larry Wall <[EMAIL PROTECTED]> wrote:
> On Wed, Jan 18, 2006 at 01:56:53PM -0500, Rob Kinyon wrote:
> : Today on #perl6, Audrey, Stevan and I were talking about $repr. A
> : tangent arose where Audrey said that the difference between class
> : methods and instance methods was simply whether or not the body
> : contained an attribute access.
> :
> : Is this true? If it is, then I think it violates polymorphism as
> : demonstrated by the following:
> :
> : class Dog {
> : method tail { "brown and short" }
> : };
> :
> : class Chihuahua is Dog {
> : has $.color;
> : method tail { $.color _ " and short" }
> : };
> :
> : You can say Dog.tail, Dog.new.tail, Chihuahua.new.tail, but not
> : Chihuahua.tail. That's extremely counter-intuitive.
>
> I don't think it's counterintuitive.  You've defined Dog with an
> invariant .tail but not Chihuahua.  It's doing exactly what you asked
> for under a prototype view of reality.

Except there are no such things as classes in a prototype view of
reality. Everything is an instance and there are no such things as
class methods. The entire idea that an object (::Dog) can call methods
that are for another object ($fido) is ... well ... it's a little off.

That's like saying any object can call any method from any other
object so long as that method is invariant.

> : I think that class methods should be explicitly defined as class
> : methods and you cannot call a class method upon an instance, just as
> : you cannot call an instance method upon a class. Plus, this should be
> : determinable (for the most part) at compile time, which is a bonus,
> : imho.
>
> I believe this is already determinble at compile time for the most part.
>
> But I have a strong gut-feeling that over the long term it's going to
> be important to be able to view a given object as either a partially
> instantiated class or a partially undefined object, and for that we have
> to break down the false class/instance dichotomy.  And to the extent
> that the dichotomy *isn't* false, we're trying to sweep classness into
> the .meta object, which is the *real* class object in Perl 6.

I'm sure you understand the distinction you're making. I know I don't
and I've been trying to follow this discussion for the past year. I'm
may not be the brightest bulb in the chandelier, but I'm no 15W dimmer
switch, either.

Frankly, you should be using people like me, Matt Fowles, and the
other  programmers on the list as sounding boards. If we're having
problems understanding the concept, then how are we going to explain
"partially-instantiated classes" on Perlmonks or #perl or clmp? Like
it or not, we're the sergeants in the Perl army. We're the guys
explaining all this stuff to the privates coming up the ranks. It may
be a nice extension to have, but I'm not sure this should be part of
the standard MOP.

Rob


perl6-all@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:
> On Wednesday 18 January 2006 14:13, Stevan Little wrote:
>
> > Do we really still need to retain the old Perl 5 version of &bless?
> > What purpose does it serve that p6opaque does not do in a better/
> > faster/cleaner way?
>
> Interoperability with Perl 5 code.

Well, for one thing, you can't write OO code in P5. You can write code
that behaves like you're in OO-land and that talks with an OO accent
(so long as you don't look behind the curtain), but it's not OO.

Given that, I'm not sure that conceptual interoperability with P5 code
should be a design goal, particularly in the OO-space. Allowing
methods to be called on references that have been associated with a
given package is an easy addition to the current MOP. Just add
.blessed_into and have a step right before AUTOLOAD (or method_missing
or whatever) to check .blessed_into and try that package, if one is
set.

Also, given that the semantics of a number of items is changing (
"".split(':') anyone?), how closely will P6 really mirror P5 behavior
given identical code?

Rob


Do chained comparisons short-circuit?

2006-01-18 Thread Joe Gottman
   Suppose I have code that looks like this:

my ($x, $y, $z) = (1, 2, 3);

say "sorted backward" if ++$x > ++$y > ++$z;

 

Will $z be incremented even though the chained comparison is known to be
false after ++$x and ++$y are compared?

 

Joe Gottman




perl6-all@perl.org

2006-01-18 Thread Stevan Little

On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:

On Wednesday 18 January 2006 14:13, Stevan Little wrote:


Do we really still need to retain the old Perl 5 version of &bless?
What purpose does it serve that p6opaque does not do in a better/
faster/cleaner way?


Interoperability with Perl 5 code.


How so? Please elaborate how you see this working?

Are you thinking that one would be able to bless a Perl 5 reference  
into a Perl 6 package?


I would argue then that we really don't need Perl 6 &bless for this,  
and we can just use Perl 5's &bless. After all, if Perl 5 can call  
Perl 6 functions, then Perl 5 will need to understand Perl 6's  
packages, and vice-versa. If this is true then Perl 5's bless should  
be able to accept a Perl 6 package value and DWIM. However, this  
would probably be a somewhat ugly solution to whatever problem it is  
you are trying to solve since your Perl 6 code would be weighted down  
with Perl 5 OO-isms. In fact, I would argue that doing it this way is  
not the right way, and instead using Perl 6 OO and delegating to a  
Perl 5 object is a better option.


Or are you thinking that a Perl 6 value should be blessed into a Perl  
5 package?


I think there is a real serious issue here since the hash the Perl 5  
package would be expecting is a ref to an HV, and the Perl 6 value it  
would be getting would be an instance of the ^Hash class (itself a  
subclass of ^Object). This is actually where i see the fundemental  
problem with a Perl 6 &bless which is capable of blessing Perl 6  
references. There are no Perl 6 references like we had in Perl 5,  
they are *all* objects now. Would not the Perl 5 layer see the Perl 6  
instance of ^Hash as an object? If not, then we must already have a  
Perl 6 opaque (the ^Hash instance) to Perl 5 HV converter/proxy/magic- 
jellybean/thunk so I don't need to write it :)


Or maybe you are you thinking that a Perl 6 class can inherit from a  
Perl 5 class?


To be honest, i think this is better handled with delegation, and can  
even be automated using the attribute delegation features described  
in A/S12.


The biggest problem with this would be object initialization. The  
normal Perl 6 BUILDALL/BUILD code could not be used here since Perl 5  
does not have the meta-object protocol to support such behaviors, nor  
is there a common enough Perl 5 object initialization idiom to work  
with here. The end result is that you probably end up having to do a  
bunch of manual initialization code.


And let's not forget that our Perl 6 blessed hash is not the same as  
the Perl 5 blessed hash, so there might be confusion/issues there  
too. We also have the issue here of where does ^Object fit into our  
inheritance now? Is the Perl 5 package the top of our @ISA tree? or  
do we insert ^Object in there somewhere too?


Or maybe you are you thinking that a Perl 5 class can inherit from a  
Perl 6 class?


Well since Perl 5 inheritance is really just a package name in the  
@ISA, this is trivial to get method inheritance since Perl 5 already  
can understand Perl 6's packages. And lets assume that the Perl 5  
&new uses the (somewhat common) idiom and just calls SUPER::new(@_)  
and re-blesses the returned Perl 6 instance. Let's assume too that  
the Perl 6 constructor just blessed a Perl 6 instance of ^Hash. Again  
we have the mismatch between the ref to an HV and the ref to an  
instance of ^Hash. This brings us back to our Perl 6 opaque (the  
^Hash instance) to Perl 5 HV converter/proxy/magic-jellybean/thunk  
thingy.


So in conclusion, I think that a Perl 6 &bless which acts like a Perl  
5 &bless is not as useful as your seem to indicate. It is certainly  
not the magic bullet of interoperability. I don't think we can really  
avoid not having a p6opaque->p5-blessed-ref magic-thunker.


However, maybe I am missing something here, if so, please elaborate  
and explain.


Thanks,

Stevan




perl6-all@perl.org

2006-01-18 Thread chromatic
On Wednesday 18 January 2006 17:57, Rob Kinyon wrote:

> Well, for one thing, you can't write OO code in P5.

I'll play your semantic game if you play my what-if game.

I have a fair bit of Perl 5 code.  Ponie works.  I want to migrate my Perl 5 
code to Perl 6 slowly.  Everything new is Perl 6 code.  When I have a chance, 
I migrate classes and modules from Perl 5 to Perl 6 code.

I have a handful of Perl 5 classes.  One day, I need to subclass one of them.  
Per my goal, I do so in Perl 6.  Of course, it has to interoperate with the 
Perl 5 in the system, per that pesky Liskov rule.  If I can specify an 
alternate internal representation for the object corresponding to the 
appropriate internal representation for the Perl 5 class I'm extending, 
great!

If not, your programming language sucks and doesn't do what the box leads me 
to believe that it should do -- especially if the answer is "Well you 
shouldn't want to do that."

-- c

PS - You can't write procedural code in Haskell.  You can't write functional 
code in C.  You can't write readable code in Ada.

Okay, I think that's out of my system now.


perl6-all@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:
> On Wednesday 18 January 2006 17:57, Rob Kinyon wrote:
>
> > Well, for one thing, you can't write OO code in P5.
>
> I'll play your semantic game if you play my what-if game.
>
> I have a fair bit of Perl 5 code.  Ponie works.  I want to migrate my Perl 5
> code to Perl 6 slowly.  Everything new is Perl 6 code.  When I have a chance,
> I migrate classes and modules from Perl 5 to Perl 6 code.
>
> I have a handful of Perl 5 classes.  One day, I need to subclass one of them.
> Per my goal, I do so in Perl 6.  Of course, it has to interoperate with the
> Perl 5 in the system, per that pesky Liskov rule.  If I can specify an
> alternate internal representation for the object corresponding to the
> appropriate internal representation for the Perl 5 class I'm extending,
> great!

I think the more relevant question is "How do I subclass a Ruby class
in Python and delegate to it from a Perl6 object that's used in a
Perl5 module that's implementing the event loop for a Java app?"

The answer, of course, is that everything is mediated by Parrot (or
whatever VM they all choose to target). Just because one side is Perl6
and the other side is Perl5 doesn't mean that they should have any
closer of a relationship than Ruby and Python would. They are separate
languages, related only through a common creator, a shared community,
and the same VM. Nothing less, nothing more.

As for how that will be handled, I would think that it would be as follows:
- in Perl6, objects created in another language will be treated as
p6opaque (unless some other unbox is a more suitable $repr).
- in Perl5, objects created in another language will be treated as
inside-out objects.

> If not, your programming language sucks and doesn't do what the box leads me
> to believe that it should do -- especially if the answer is "Well you
> shouldn't want to do that."

The box you're talking about is the box with "Parrot" on the cover,
not Perl6. And, you most definitely want to be able to do what you're
suggesting and it will be possible.

You'll just have to give up on the mismeme of &bless, and I think
you'll find that oddly freeing.

Rob


perl6-all@perl.org

2006-01-18 Thread chromatic
On Wednesday 18 January 2006 18:54, Stevan Little wrote:

> Are you thinking that one would be able to bless a Perl 5 reference
> into a Perl 6 package?

Not really, but depending on the what Perl 6 bless() does it might work.

> I would argue then that we really don't need Perl 6 &bless for this,
> and we can just use Perl 5's &bless. After all, if Perl 5 can call
> Perl 6 functions, then Perl 5 will need to understand Perl 6's
> packages, and vice-versa. If this is true then Perl 5's bless should
> be able to accept a Perl 6 package value and DWIM. However, this
> would probably be a somewhat ugly solution to whatever problem it is
> you are trying to solve since your Perl 6 code would be weighted down
> with Perl 5 OO-isms. In fact, I would argue that doing it this way is
> not the right way, and instead using Perl 6 OO and delegating to a
> Perl 5 object is a better option.

In the long-term sure.  However, I don't know how far interoperability will 
get if we expect everyone to do everything The Right Way all at once.

> Or are you thinking that a Perl 6 value should be blessed into a Perl
> 5 package?

That's closer to what I had in mind.

> I think there is a real serious issue here since the hash the Perl 5
> package would be expecting is a ref to an HV, and the Perl 6 value it
> would be getting would be an instance of the ^Hash class (itself a
> subclass of ^Object). This is actually where i see the fundemental
> problem with a Perl 6 &bless which is capable of blessing Perl 6
> references. There are no Perl 6 references like we had in Perl 5,
> they are *all* objects now. Would not the Perl 5 layer see the Perl 6
> instance of ^Hash as an object? If not, then we must already have a
> Perl 6 opaque (the ^Hash instance) to Perl 5 HV converter/proxy/magic-
> jellybean/thunk so I don't need to write it :)

Why would Perl 6 bless() bless references?  I've always seen it as specifying 
the underlying storage container for the object's instance data.  (Hey, my 
last rigorous reading of S12 predates my current project.  I could be wrong.)

If Ponie is there and this code runs on Parrot and Ponie uses Perl 5 PMCs, 
they're theoretically available to Perl 6, with the proper invocations or 
magic or thunking or whatever.

> Or maybe you are you thinking that a Perl 6 class can inherit from a
> Perl 5 class?

Absolutely.

> To be honest, i think this is better handled with delegation, and can
> even be automated using the attribute delegation features described
> in A/S12.

I have serious doubts about round-tripping with delegation, having tried to do 
it.  I want to subclass a Perl 5 class with Perl 6 code and use objects of 
that class within Perl 5 code without them having to know that I'm doing 
something sneaky.

It'll be a true pity if that's *truly* impossible.

> The biggest problem with this would be object initialization. The
> normal Perl 6 BUILDALL/BUILD code could not be used here since Perl 5
> does not have the meta-object protocol to support such behaviors, nor
> is there a common enough Perl 5 object initialization idiom to work
> with here. The end result is that you probably end up having to do a
> bunch of manual initialization code.

Sure, but that's a per-representation thunking layer writable in Perl 6 code.  
It might be somewhat tricky, but it's not completely hideously unsolvable 
code -- if it's possible.

> And let's not forget that our Perl 6 blessed hash is not the same as
> the Perl 5 blessed hash, so there might be confusion/issues there
> too. We also have the issue here of where does ^Object fit into our
> inheritance now? Is the Perl 5 package the top of our @ISA tree? or
> do we insert ^Object in there somewhere too?
>
> Or maybe you are you thinking that a Perl 5 class can inherit from a
> Perl 6 class?

I'm not nearly Australian enough for that kind of madness.

> So in conclusion, I think that a Perl 6 &bless which acts like a Perl
> 5 &bless is not as useful as your seem to indicate.

I'm pretty sure that's not what I was advocating.  I'm pretty sure the design 
thinking has always been:

1) by default, your object is opaque
2) if you don't want this, you can always use bless()

For interoperability with Perl 5 classes, I don't want to use an opaque 
object.  Ergo, I want to use bless() (or something, but does that explain why 
I think bless() is important?).

> It is certainly not the magic bullet of interoperability. I don't think we 
> can really avoid not having a p6opaque->p5-blessed-ref magic-thunker. 

I don't want to translate opaque objects into blessed references.  They should 
be opaque everywhere.  I do want the option to rewrite as little Perl 5 code 
as possible just to get the program to work, though.

-- c


perl6-all@perl.org

2006-01-18 Thread chromatic
On Wednesday 18 January 2006 19:11, Rob Kinyon wrote:

> As for how that will be handled, I would think that it would be as follows:
> - in Perl6, objects created in another language will be treated as
> p6opaque (unless some other unbox is a more suitable $repr).

... and I specify this exactly how?

-- c


Re: Do chained comparisons short-circuit?

2006-01-18 Thread Luke Palmer
On 1/19/06, Joe Gottman <[EMAIL PROTECTED]> wrote:
>Suppose I have code that looks like this:
>
> my ($x, $y, $z) = (1, 2, 3);
>
> say "sorted backward" if ++$x > ++$y > ++$z;
>
>
>
> Will $z be incremented even though the chained comparison is known to be
> false after ++$x and ++$y are compared?

I don't see a reason for chained comparisons not to short-circuit,
besides the surprise factor.  But anyone who knows about &&, and
understands chained comparisons as expanding to &&, should understand
short-circuiting behavior.

Luke


perl6-all@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:
> On Wednesday 18 January 2006 19:11, Rob Kinyon wrote:
>
> > As for how that will be handled, I would think that it would be as follows:
> > - in Perl6, objects created in another language will be treated as
> > p6opaque (unless some other unbox is a more suitable $repr).
>
> ... and I specify this exactly how?

I was intending for that to mean that Parrot might indicate that the
representation in Perl6 for a Perl5 object could be p6hash instead of
p6opaque, but that might be a little too clever.

I was thinking, actually for interoperability with something like C++
where your classes are laid-out-in-memory structs (which is the best
reason I've heard for having alternate $repr). There certainly is no
good reason within Perl6 itself to muddy up the waters like that.

You really want to read
http://svn.openfoundry.org/pugs/docs/notes/piln_object_repr_types.pod

Rob


perl6-all@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:
> 1) by default, your object is opaque
> 2) if you don't want this, you can always use bless()
>
> For interoperability with Perl 5 classes, I don't want to use an opaque
> object.  Ergo, I want to use bless() (or something, but does that explain why
> I think bless() is important?).

No, you want to specify the $repr in CREATE(). But, p6hash will still
not be the same as a ref to an HV. Frankly, I think you're better off
letting Parrot mediate things the same way it would mediate Ruby and
Perl6 or Perl5 and Python. Worrying about it in userland is just going
to cause you headaches.

Rob


perl6-all@perl.org

2006-01-18 Thread chromatic
On Wednesday 18 January 2006 19:39, Rob Kinyon wrote:

> No, you want to specify the $repr in CREATE(). But, p6hash will still
> not be the same as a ref to an HV. Frankly, I think you're better off
> letting Parrot mediate things the same way it would mediate Ruby and
> Perl6 or Perl5 and Python. Worrying about it in userland is just going
> to cause you headaches.

Answer me this then -- under your scheme, can I subclass a Perl 5 class with 
Perl 6 code, instantiate the subclass, and use that object in Perl 5 code as 
if the subclass were Perl 5 code, without rewriting all of my Perl 5 code?

-- c


perl6-all@perl.org

2006-01-18 Thread Trey Harris
Excuse my ignorance of the finer points, but I thought the reason for 
bless's continued existence was so that the same sort of brilliant OO 
experimentation that Damian and others have done with pure Perl 5 can 
continue to be done in pure Perl 6 without having to hack p6opaque?


Trey


perl6-all@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, chromatic <[EMAIL PROTECTED]> wrote:
> On Wednesday 18 January 2006 19:39, Rob Kinyon wrote:
>
> > No, you want to specify the $repr in CREATE(). But, p6hash will still
> > not be the same as a ref to an HV. Frankly, I think you're better off
> > letting Parrot mediate things the same way it would mediate Ruby and
> > Perl6 or Perl5 and Python. Worrying about it in userland is just going
> > to cause you headaches.
>
> Answer me this then -- under your scheme, can I subclass a Perl 5 class with
> Perl 6 code, instantiate the subclass, and use that object in Perl 5 code as
> if the subclass were Perl 5 code, without rewriting all of my Perl 5 code?

You have two cross-language interactions.
1) Subclass a LangX class in LangY
2) Instantiate a LangY class and use that object in LangZ
That LangX === LangZ is irrelevant to the discussion.

So long as you aren't peeking behind the curtain (method calls only),
Parrot should be able to mediate everything. In other words, if your
code is good OO code, then you shouldn't have any problems.

Rob


perl6-all@perl.org

2006-01-18 Thread Rob Kinyon
On 1/18/06, Trey Harris <[EMAIL PROTECTED]> wrote:
> Excuse my ignorance of the finer points, but I thought the reason for
> bless's continued existence was so that the same sort of brilliant OO
> experimentation that Damian and others have done with pure Perl 5 can
> continue to be done in pure Perl 6 without having to hack p6opaque?

That's what the .meta and the MetaObject Protocol is for. Not to
mention that 90% of the hacking done in Class:: and Object:: will
handled by the fact that Perl6 has actual OO syntax. ("Look Ma, no
hands!") You won't need Class::MakeMethods because Perl6 will make
your accessors for you. You won't need Class::Std to protect your
instance data because p6opaque will ... well, it's opaque. :-)

As for the ability to "hook into" the P6 OO system, you'll have
CREATE, BUILD, BUILDALL, true NEXT semantics, and the ability to
completely rewrite the method dispatcher (if you really feel like it).
I think we've gone well beyond &bless.

Rob


perl6-all@perl.org

2006-01-18 Thread John Siracusa
On 1/18/06 11:06 PM, Rob Kinyon wrote:
> Not to mention that 90% of the hacking done in Class:: and Object:: will
> handled by the fact that Perl6 has actual OO syntax. ("Look Ma, no hands!")
> You won't need Class::MakeMethods because Perl6 will make your accessors for
> you.

There's more to life than simple get/set accessors.  Method-makers will have
and a long and glorious life in Perl 6, I assure you :)

-John




perl6-all@perl.org

2006-01-18 Thread Stevan Little


On Jan 18, 2006, at 10:41 PM, Trey Harris wrote:
Excuse my ignorance of the finer points, but I thought the reason  
for bless's continued existence was so that the same sort of  
brilliant OO experimentation that Damian and others have done with  
pure Perl 5 can continue to be done in pure Perl 6 without having  
to hack p6opaque?


Actually &bless only partially plays a role in all those whacky  
things which so many whacky people have done with Perl 5. Without  
AUTOLOAD, symbol table hacking and closures, &bless would not be that  
exciting.


However, given a proper MOP (meta-object-protocol) the amount of  
Object Oriented experimentation which will be possible in Perl 6 will  
far exceed what you can do in Perl 5. Not to mention that it will  
also be type-safe and far more reliable (read: you could *actually*  
use it in production).


And not to put down all of the brilliant OO experimentation that has  
been done in Perl 5, but it is not always as cutting edge as one  
might think. A good amount of the really crazy cutting edge OO work  
is being done with either Smalltalk or CLOS and the fact they both  
have well defined and studied MOPs is probably a major reason for that.


Stevan 


Re: Do chained comparisons short-circuit?

2006-01-18 Thread Ph. Marek
On Thursday 19 January 2006 04:25, Luke Palmer wrote:
> On 1/19/06, Joe Gottman <[EMAIL PROTECTED]> wrote:
> >Suppose I have code that looks like this:
> >
> > my ($x, $y, $z) = (1, 2, 3);
> >
> > say "sorted backward" if ++$x > ++$y > ++$z;
> >
> > Will $z be incremented even though the chained comparison is known to be
> > false after ++$x and ++$y are compared?
>
> I don't see a reason for chained comparisons not to short-circuit,
> besides the surprise factor.  But anyone who knows about &&, and
> understands chained comparisons as expanding to &&, should understand
> short-circuiting behavior.
Although that may lead to _longer_ code, which (when extended) is likely to be 
broken:

$x++; $y++; $z++;
say "sorted backward" if $x > $y > $z;

To be honest, in this example it mostly doesn't matter; if $x > $y, then 
($x+1) > ($y+1). But in many quickly written scripts I did some numeric 
operation to force the value to numeric, even if I got a parameter like 
"string" (which becomes 0 when numyfied)


How about some flag saying "don't short-circuit this"?


Regards,

Phil