Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 10:30 PM, ToddAndMargo wrote: > On 09/30/2017 02:15 PM, Brandon Allbery wrote: > >> Basically: < > is single quotes and treats variables and expressions as >> literals. << >> is double quotes and interpolates variables but not general >>

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread ToddAndMargo
On 09/30/2017 02:15 PM, Brandon Allbery wrote: Basically: < > is single quotes and treats variables and expressions as literals. << >> is double quotes and interpolates variables but not general expressions. And { } does no quoting at all and uses general expressions. Hi Brandon, I am

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread Brandon Allbery
On Sat, Sep 30, 2017 at 7:44 PM, ToddAndMargo wrote: > On 09/30/2017 02:15 PM, Brandon Allbery wrote: > >> This concept gets reused enough that it's not separately described for >> every place where it is used; the documentation would be impossible to >> manage, almost as

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread ToddAndMargo
On 09/30/2017 02:15 PM, Brandon Allbery wrote: This concept gets reused enough that it's not separately described for every place where it is used; the documentation would be impossible to manage, almost as impossible to read, and often out of sync with itself if every reused concept had to be

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread ToddAndMargo
On 09/30/2017 02:20 AM, Timo Paulssen wrote: This doc page should help you a lot with this topic: https://docs.perl6.org/language/subscripts#Basics A little bit. I had found that when I was researching. It did not go into who to use a variable as a key value. This is what I wrote myself:

Re: Any way to get hashes to loop in order?

2017-09-30 Thread ToddAndMargo
On Sep 30, 2017 12:41 PM, "Parrot Raiser" <1parr...@gmail.com > wrote: Prepending the real key value with an order indicator, then sorting the retrieved list on the key would achieve that, (though the maximum number size would have to be known in advance.

Re: Any way to get hashes to loop in order?

2017-09-30 Thread Brock Wilcox
Maybe a list/array of pairs would be better, and then cast it to a hash if you need to do fast lookups. On Sep 30, 2017 12:41 PM, "Parrot Raiser" <1parr...@gmail.com> wrote: > Prepending the real key value with an order indicator, then sorting > the retrieved list on the key would achieve that,

Re: Any way to get hashes to loop in order?

2017-09-30 Thread ToddAndMargo
On 09/29/2017 07:25 PM, Brandon Allbery wrote: The point of a hash is that it computes hash values from its keys for fast lookup, Not me. I use them to "organize" data all in one easy to look up place. For example: my %SmtpIni = [ 'DebugTrace' => "", 'smtp' => "", 'port'

Re: Perl 6 Object Construction - General Advice

2017-09-30 Thread Brian Duggan
On Saturday, September 30, Mark Devine wrote: > My most common OC case: initialize attributes at OC time from external > input that will be parsed with grammars &/| scrubbed with elaborate > conditional tests. I like to use assignment for simple things and TWEAK for complicated things --

Re: Any way to get hashes to loop in order?

2017-09-30 Thread Parrot Raiser
Prepending the real key value with an order indicator, then sorting the retrieved list on the key would achieve that, (though the maximum number size would have to be known in advance. E.g. 001First_key => data1, 002Second => data2

Perl 6 Object Construction - General Advice

2017-09-30 Thread Mark Devine
Perl 6, I am preparing to write several classes for some Perl 6 apps I intend to craft in support of a prominent backup suite. In looking at the documentation & some of the modules published in the Perl 6 ecosystem, I’m not quite sure that I can identify the best idiomatic object construction

Re: Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread Timo Paulssen
This doc page should help you a lot with this topic: https://docs.perl6.org/language/subscripts#Basics

Tip: assign a value to a hash using a variable as a key

2017-09-30 Thread ToddAndMargo
Hi All, This one about killed me to find! The guys on the chat line figured it out for me. Apparently some tutorial is wrong on this too, but I couldn't figure out which one they were referring to. When assigning a value to a hash using a variable as the key, use {} instead of <> perl6 -e '