> Strings and integers are data, but containers are "magic". Right.

I appreciate your sarcasm.

I've heard some folk say they find the distinction between values and variables (containers) to be confusing. Imo this is worth discussing, as are issues about coding and the brain, so I'll continue.

> The propensity for fuzzy magical thinking is wired into our brains, not artificial.

Are you saying that the brain's capacity to distinguish singular and plural things is "fuzzy magical thinking"?

> But [the fact that the brain distinguishes singular and plural] doesn't mean [taking that into account is] a good way to design a programming language.

It also doesn't mean it's not. More on this in a mo.

> Containers can certainly be data.

Yes. I thought use of Wittgenstein's ladder[1] was wise given the mistake you'd made that was the first thing I responded to in our exchange in this subthread.[2]

Anything can be data just as code is data (explicitly so in, eg, lisps). But it can be helpful to distinguish code from data and the same applies to containers vs data. On the few occasions when a conceptual distinction is not helpful, one should simply ignore the distinction. (This is perhaps somewhat like lisp macros that could be said to conceptually treat code as code or as data depending on whether or not it's helpful to the human writer or reader to treat it one way or the other.)

> A string is a container of characters

In Perl 6 a "string" is not a "container" even if you like to think of it that way and/or use the words that way.

> So should the window.Add(subWindow) method automatically loop over the subSubWindows of subWindow and add each of them as direct children of window, or should it simply add subWindow to window directly so its subSubWindows are grandchildren of window?

Exactly. Both interpretations can make sense.

This is why Perls provide notation to emphasize either the scalar or composite interpretation of an entity and to optionally switch to the other interpretation for any given mention of that entity in code.[3]

> It's fuzzy magical thinking to believe that Perl's dichotomy of scalar/array maps directly to your brain's concept of singular/plural.

Audience member, to Deepak Chopra: "You stated ... that 'all belief is a cover-up for insecurity', right?" Deepak: "Uhuh". Audience member: "Do you believe that?" Deepak: "Yes."[4]

I consider the notion that Perl's singular/plural distinction maps directly to the brain's to be at least plausible as an explanation of why it seems so natural to me.[5]

> Does everyone's brain's built-in concept of plurality naturally support nested polymorphic arrays?

Iirc, the results from neuroscience I've read that study brain circuits that process aspects related to nesting (hierarchy) suggest it's reasonable to view them as distinct from those that process the singular/plural distinction in most humans.

So, to the degree that separate brain circuits could be said to be mutually supporting, I'd say that one's brain circuits that process plurality support nesting (and vice-versa).

Something similar may apply for polymorphism.[6]

> Do those arrays in people's brains also behave like keyed hash tables, like Perl and JavaScript arrays?

I think there's more than a century's worth of science supporting the notion that association is deeply fundamental to how the brain works. Aiui it's an even more primitive mechanism than processing hierarchy and singular/plural aspects.

> Must the keys be strings, or might they be any hashable idea?

Again, I think I'm on solid ground when I say that humans' brains naturally support association of arbitrary "things".

Perl 6 supports any hashable entities as hash keys, not just strings.

> Do Perl references work exactly the same way as actual human neurons? What about dolphin brains? Please show me some peer reviewed scientific studies that prove Perl arrays accurately model natural language and mirror human thought, and then I will concede that Perl is more linguistically or biologically "natural" than Python.

(I rather suspect you'd still not change your mind even if such ridiculous studies could and did exist and I showed them.)

For now I'll just mention "A new study provides new evidence that programmers are using language regions of the brain when understanding code and found little activation in other regions of the brain devoted to mathematical thinking."[7] and ask you to read the linked article and/or the study itself before declaring it entirely bogus.

> But until I see some proof to the contrary, I believe that Larry Wall is to linguistics as Deepak Chakra is to physics

One good antidote to confirmation bias is reflection on the copious scientific evidence that expressed sincere confidence is generally inversely proportional to measured competence in relation to a given skill.

That said, while I'm fairly confident that you will not have changed your mind about any of the things we've discussed, my hope is that I'm incompetent at reading your character and we're making actual progress in mutual understanding, at least inasmuch as you manage to be more creative with your sarcasm in the future. :)

[1] http://c2.com/cgi/wiki?WittgensteinsLadder

[2] I refer to your mistaken notion of Perls "dividing all possible types into two different classes, and then using punctuation to distinguish variables holding those two classes".

[3] Imo aspects of Perl 5 related to this were fairly simple for declaring and using simple data structures but quickly became much too complex for my taste for more complex structures and usage.

Over the last 5 years or so a consensus emerged in the Perl 6 community that the Perl 6 version of this part of the language's syntax and semantics was another mess, ruining what was otherwise considered a good design for declaring and using deep data structures. This was one of the two justifications for the Great List Refactor (the other was implementation simplicity and optimizability) which has since been completed to general acclaim in regards to syntax and semantics by many of the same folk who disliked the pre GLR situation.

Imo what 6.c delivers for dealing with data structures, shallow and deep, simple and complex, is pretty sweet.

[4] https://www.youtube.com/watch?v=Vg3-pwIP0X4#t=54m07s

While I find much to dislike about Deepak Chopra, and have mixed feelings about the first person to bring my attention to the notion that belief is redundant at best, harmful at worst, namely Jiddu Krishnamurti, I do nowadays consider belief to itself be magical thinking. If you know something's true, why bother with belief? If you don't, why hold on to belief as if it were reliable?

[5] I don't recall reading anything on polymorphism but my own guess would be that any natural language concepts that correspond to polymorphism, assuming that such can be reliably identified and found to correspond to some degree to brain circuits in some humans, would involve circuits that are typically distinct from brain circuits that are involved in processing of hierarchy and the singular/plural distinction but are mutually supportive.

[6] It seems you believe that scalar/array does not map directly to my brain's concept of singular/plural but have not provided scientific evidence to back it up. One could argue, and I will for nothing more than entertainment value, that belief based on nothing more than sufficiently advanced confidence is indistinguishable from magical thinking.

[7] http://www.huffingtonpost.com/chris-parnin/scientists-begin-...