develooper Front page | perl.perl6.users | Postings from July 2021

Re: How do a pe-salt an array inside an object?

Thread Previous
From:
ToddAndMargo via perl6-users
Date:
July 6, 2021 20:31
Subject:
Re: How do a pe-salt an array inside an object?
Message ID:
f167b91e-4a03-e909-a5d0-1ff1b127959f@zoho.com
On 7/6/21 1:23 PM, Bruce Gray wrote:
> 
> 
>> On Jul 6, 2021, at 3:10 PM, Tom Browder <tom.browder@gmail.com> wrote:
>>
>> On Tue, Jul 6, 2021 at 14:53 ToddAndMargo via perl6-users <perl6-users@perl.org> wrote:
>> ...
>> writing out 2000 skips is not practical.
>>
>> Todd, why don't you tell us what you're really trying to do, i.e., what is your use case? Maybe the experts can suggest a better class design.
>>
>> -Tom
> 
> I also would prefer seeing a use case.
> 
> In the meantime:
> 	my @will_become_I_soon;
> 	@will_become_I_soon[400]  = "four hundred";
> 	@will_become_I_soon[2000] = "two thousand";
> 	my $CC = AA.new( I => @will_become_I_soon );

Hmmm. 1002 ways!

> or
> 	my $CC = AA.new( I => [ flat( Str xx 400, "four hundred", Str xx 2000-400-1, "two thousand" ) ] );

Sweet!  Thank you!

No use case.  I am just in learning mode on
the different ways to pre-salt an object on
creation.

Thread Previous


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