Re: Tip: hash indexing

2017-10-04 Thread ToddAndMargo
On 10/03/2017 11:35 PM, Richard Hainsworth wrote: The suggested solution to this thread seems odd to me. It confuses a storage structure with information about the elements, and doesn't use the power of perl6. An associative array is useful because non-integer indexes are possible and hashing

Re: Tip: hash indexing

2017-10-04 Thread Tom Browder
On Wed, Oct 4, 2017 at 06:23 yary wrote: > > There may be a better way for the coercion. All of this needs to be in a class called something like OrderedHash—a good exercise. Then turn it into a module for CPAN and we can all use it! Best, -Tom

Re: Tip: hash indexing

2017-10-04 Thread yary
> There may be a better way for the coercion. whatever... .say for %h.sort( * )

Re: Tip: hash indexing

2017-10-03 Thread Richard Hainsworth
The suggested solution to this thread seems odd to me. It confuses a storage structure with information about the elements, and doesn't use the power of perl6. An associative array is useful because non-integer indexes are possible and hashing makes storage efficient. This makes referencing da

Re: Tip: hash indexing

2017-10-03 Thread ToddAndMargo
On 10/03/2017 11:56 AM, Andy Bach wrote: Though this seems to be heading the wrong way but - TIMTOWTDI my @SmtpIndex =    qw[ DebugTrace smtp port username password from to Subject Text FileName ]; my @SmtpValues = ["1", "smtps://smtp.zoho.com ", "465", 'la...@zoho.com

Re: Tip: hash indexing

2017-10-03 Thread Andy Bach
Though this seems to be heading the wrong way but - TIMTOWTDI my @SmtpIndex = qw[ DebugTrace smtp port username password from to Subject Text FileName ]; my @SmtpValues = ["1", "smtps://smtp.zoho.com", "465", 'la...@zoho.com', "NaYukYukYuk", 'la...@zoho.com', @['cu...@zoho.com','m...@zoho.com']

Re: Tip: hash indexing

2017-10-03 Thread James Ellis Osborne III
Canadian Handicrafts Guild On Oct 3, 2017 11:22 AM, "ToddAndMargo" wrote: > Sweet!I added a reverse print to the pile! > > > #!/usr/bin/env perl6 > > #`{ > Hashes do not print in the order they are created. it is a Perl 6 thing. > To overcome this, create an index of the hash. > } > >

Re: Tip: hash indexing

2017-10-03 Thread ToddAndMargo
Sweet!I added a reverse print to the pile! #!/usr/bin/env perl6 #`{ Hashes do not print in the order they are created. it is a Perl 6 thing. To overcome this, create an index of the hash. } my @SmtpIndex = qw[ DebugTrace smtp port username password from to Subject Text FileName ];

Re: Tip: hash indexing

2017-10-03 Thread Bennett Todd
I'd like to note that Hash tables don't preserve the order they're created, and that this isn't a perl6 thing, this is intrinsic to the definition of hash tables. On October 3, 2017 9:06:47 AM EDT, Andrew Kirkpatrick wrote: >Thanks, your script enticed me to explore different ways of >construc

Re: Tip: hash indexing

2017-10-03 Thread Andrew Kirkpatrick
Thanks, your script enticed me to explore different ways of constructing a hash table. I dimly recall something about map having access to an index variable, but couldn't find it documented so maybe I was dreaming. The process of figuring out these approaches highlighted that so much perl6 document