Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion is rw trait's effect on signature
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Aaron Sherman  
View profile  
 More options May 6 2004, 1:39 pm
Newsgroups: perl.perl6.language
From: a...@ajs.com (Aaron Sherman)
Date: Thu, 06 May 2004 13:39:36 -0400
Local: Thurs, May 6 2004 1:39 pm
Subject: is rw trait's effect on signature
There's a subtle problem / feature resulting from the "is rw" trait that
may be so obvious that I'm making a fool of myself, or it might be that
it's not yet occurred, but I don't recall seeing discussion of it.

The simple case is:

        sub foo(X $i is rw) {...}
        class X {...}
        class Y {...}
        my Y $var = 'something';
        foo($var);

In this case, something kind of interesting has to happen.

Either the signature checking has to verify that Y isa X (and thus can
be used polymorphically as X, not just converted to X) ...

... or, it has to do something of the sort:

        { my X $tmp = $var; foo($tmp); $var = $tmp; }

which has its own problems, of course.

Were either of these the intention or am I missing something?

"is ref" probably has the same concern.
--
Aaron Sherman <a...@ajs.com>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.