> 1. The list you posted is fantastic ("If the first character inside is 
> anything other
> than an alpha it doesn't capture"). It should be added to the Raku Docs ASAP.

Not the list, right? Just the rule. (There are dozens of kinds of
assertions. No one
is going to remember the list.) If you were to add just the line you
suggest then
you'd be able to do it ASAP.

> 2. There are some shortcuts that don't seem to follow a set pattern. For 
> example
> a named capture can be accessed using $<myname> instead of $/<myname> ;
> the "/' can be elided. Do you have a method you can share for remembering
> these sorts of shortcuts? Or are they disfavored?

I know you're asking Brad, but fwiw my overall method for mnemonics is to stay
creative and bring in visual and audio elements (like images and rhyming) and
weave them into a little made up story that fits in with an overall
adventure story
about Raku. The elements would be ones that work for a given individual for a
given aspect of a given feature of Raku, with the story being made up by the
person doing the learning.

Thus, for example, I might note that the @ symbol looks something like a `0`
and is sounded out as "at" and have a kid tell me a little story they imagine
getting added to the twitter profile of someone they know about programming
that involves the fact that array indexing is `0` based, thus giving
them a strong
reminder of the latter aspect.

Fwiw I'm not seeing much value in developing one for eliding the `/`.
If a dev doesn't
know they can elide the `/` when writing code, then no harm done; just
leave it in.
If a dev is *reading* code and sees syntax of the form `$<foo>` and wonders what
it is, they can type `$<` into the search box in the doc and get a
match. I personally
found it really easy to remember because it's so simple and used so
frequently. I
think mnemonics

> 3. Finally, I've never seen in the Perl6/Raku literature the motto you cite:
> "One of the mottos of Raku, is that it is ok to confuse a new programmer,
> it is not ok to confuse an expert."

I think that's a reasonable distillation of Larry's perspective. It's
another way
of expressing that Python is good as a first language, Raku as a last one.

Consider the options:

* Ok to confuse a new programmer or an expert. (Not a good option.)

* Ok to confuse an expert, not Ok to confuse a new programmer. ScratchJr?

* Not Ok to confuse a new programmer or an expert. ScratchJr?

> [ The motto I prefer is from Larry Wall: "...easy things should stay easy,
> hard things should get easier, and impossible things should get hard... ."

I like that one too. I daresay I prefer it too. But for it to work, it
really needs
to be Ok to confuse a new programmer but not Ok to confuse an expert.

Note that easy things being easy does not mean that new programmers
won't get confused. For example, a new Raku programmer who is used
to Perl might  be confused that `<$foo>` does not capture in Raku, even
though it does in Perl. But it's still easy to capture; you write `<foo=$foo>`.

But when *experts* are *systematically* confused, i.e. *all* experts just
keep falling for the same trap, then impossible things won't just be hard,
they'll stop happening.

Note that I say that as a non-expert in many, many areas of Raku. What
I *do* know is that whenever I encounter something that surprises me,
and keep an open mind about what's going on, no matter how annoyed
I am or convinced Raku is being stupid, I almost always eventually arrive
at an interim conclusion it's appropriate as is.

*Almost* always. And always an *interim* conclusion at best. That is to
say, I retain an eternally open mind toward all such things. So if someone
were to add a table to the doc listing all the assertion types, noting which
ones capture and which ones don't, rather than just the one rule ("starts
with an alpha") I'd be open minded about what the outcome would be.
Likewise if Brad reveals some master method he has for coming up with
a mnemonic covering dropping the `/` in `$<foo>`. And if it turns out Larry
has never said something directly to the effect that Brad has mentioned,
I'd be surprised but curious why I was surprised.

--
love, raiph

Reply via email to