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 A12: The dynamic nature of a class
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
 
Dan Sugalski  
View profile  
 More options Apr 23 2004, 8:42 am
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Fri, 23 Apr 2004 08:42:28 -0400
Local: Fri, Apr 23 2004 8:42 am
Subject: Re: A12: The dynamic nature of a class
At 11:29 PM +0100 4/22/04, Simon Cozens wrote:

>d...@sidhe.org (Dan Sugalski) writes:
>>      my Joe $foo;

>>  emits the code that, at runtime, finds the class ID of whatever Joe's
>>  in scope, instantiates a new object of that class

>Uh, is that right? I don't think that "my" is a constructor, more a typing
>declarator.

Since any type potentially has assignment behaviour, it has to be a
constructor. For example, if you've got the Joe class set such that
assigning to it prints the contents to stderr, this:

    my Joe $foo;
    $foo = 12;

should print 12 to stderr. Can't do that if you've not put at least a
minimally constructed thing in the slot.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
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.