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 Properties -- distributive, predeclared, post-applied....??
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
 
Paul Hodges  
View profile  
 More options Dec 4 2003, 7:49 pm
Newsgroups: perl.perl6.language
From: Paul.Hod...@BELLSOUTH.COM (Paul Hodges)
Date: Thu, 4 Dec 2003 13:35:57 -0600
Local: Thurs, Dec 4 2003 2:35 pm
Subject: RE: Properties -- distributive, predeclared, post-applied....??
How about

  use Baz; # assume object type
  my property foo;
  my @bar of Baz is false but foo; # maybe not what you meant?

If you apply a trait like false to an array, I expect it to apply to the
"array instance object" itself and not the content, so that
  push @bar, Baz.new();
  if @bar    { print "stuff"; } else { print "empty"; } # oops! false!
  if @bar[0] { print " oops"; } else { print " ok";   } # oops! not false!
would print "empty oops" instead of "stuff ok".

I'd *like* to be able to predeclare a trait or property to be distributed
across any values placed in this array, but only this array. For example, it
would be nice if I could have the default aspects of false and foo be
applied to any Baz that gets stuck into @bar, but obviously this isn't the
syntax to do it. I could make Baz's new() do it, but I don't want *ALL* Baz
objects to be false and foo...just the ones in @bar. So, what I need is
something more like

  my @bar of Baz;
  @bar.STORE.wrap { my $r = call; return $r >>but=<< (false,foo); }

But I'm not sure C<$r >>but=<< (false,foo)> works, and I really wanted to
figure out a way to do it all in the declaration. Maybe it could be

  my @bar of Baz will do STORE.wrap { call >>but=<< (false,foo); }

but I'm not sure call will behave as an lvalue and still set up the
appropriate return, I don't expect @bar to accept "will do", and I don't
think "will do" is where the wrap should go. I'm just trying to wrap my
brain around this brick and I can't find all the references that tell me all
the little pieces so that I can compare them for a closer approximation,
lol....

*****
"The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential, proprietary, and/or
privileged material.  Any review, retransmission, dissemination or other use
of, or taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited.  If you received
this in error, please contact the sender and delete the material from all
computers.61"


 
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.