Or are these two are now strictly methods without functional forms?
-- Rod Adams
I'll make a guess: Ref of Int of Array.
This assumes Int has a polymorphic subtype that allows
pointing into arrays. But unfortunately you need two values
to describe the reference: the index and the array. So it should
be more like a pair: Ref of Pair[Int,Array].
my @array;
my Ref of Int of Array $iref = 17 of $array; # 17 => @array perhaps
$iref = "blahh";
say "@array[17]"; # prints blahh
> Or are these two are now strictly methods without functional forms?
Sorry I don't know what you are asking for. What is then a method with
functional form? Do you mean that the entries in an array are off-limits
to the outside and can be accessed only by the subscripting methods?
Regards,
--
TSa (Thomas Sandlaß)
What I'm asking is if we are going to continue allowing:
delete %x<foo>;
if exists %x<foo> { ... }
or make it where you instead have to say
%x.delete('foo');
if %x.exists('foo') { ... }
-- Rod Adams
>
> Regards,
Would renaming exists to has or hasa be a good idea, if it does indeed
exist only in method form?
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
They can always just be macros that translate the unary form to the
method. If you define them as term:<delete> and term:<exists> they
won't show up unexpectedly when the parser is looking for method names.
Larry
I'd think that would be asking if the array has an *attribute* of
that name. Perl 6 objects aren't hashes...
Larry
That makes sense. I think %x ~~ 'foo' will be used more than
%x.exists('foo') anyway.