develooper Front page | perl.perl6.internals | Postings from February 2002

RE: PMCs, setting, and suchlike things

Thread Previous | Thread Next
From:
Brent Dax
Date:
February 12, 2002 17:22
Subject:
RE: PMCs, setting, and suchlike things
Message ID:
FJELLKOPEAGHOOODKEDPKEDGDDAA.brentdax@cpan.org
Dan Sugalski:
# So, what about the ramifications of:
#
#      $foo = @bar
#
# @bar's get_integer method is called, and $foo's set_integer method is
# called. No temp PMCs.

Huh?  Assigning an array to a scalar yields a reference to an array.  In
integer context that yields the length.  In string contents that yields
the Perl 6 equivalent of join($", @$foo) (or whatever).

#      $foo = %bar
#
# calls %bar's get_string method and $foo's set_string method.

See above.  IIRC hashes work the same way as arrays, more or less..

#      $foo = keys %bar (or whatever we're using in perl 6 for this)
#
# calls %bar's get_integer method and $foo's set_integer method.

No.  Once again, yields an array ref. (Though perhaps a lazily-generated
one.)

# The only issue we really have is how do we get a scalar PMC for an
# aggregate PMC. Working on that.

Still, your basic point--that there's more than one kind of 'set'--is
well put.

--Brent Dax
brentdax@cpan.org
Parrot Configure pumpking and regex hacker
Check out the Parrot FAQ: http://www.panix.com/~ziggy/parrot.html (no,
it's not mine)

<obra> mmmm. hawt sysadmin chx0rs
<lathos> This is sad. I know of *a* hawt sysamin chx0r.
<obra> I know more than a few.
<lathos> obra: There are two? Are you sure it's not the same one?


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About