### Re: [tutorial] Basic Sequence Operations

_tom said...

Trying some new definitions for properties and functions.

_tom

First, let me thank you for the marvelous work you've done writing these helpful tutorials. I keep learning a lot from them.

When i came to Eu v2 from BASIC as a self-taught hobbyist, i found sequences challenging from the start: that they're not the same as arrays; that an empty sequence really is empty; that a printable letter on its own is different from the same letter inside a sequence; that a string is really a sequence in disguise; that a character is really a small integer in disguise...

When learning about Eu objects, I found it helpful to think in terms of billiard balls on an infinitely large table. I imagined an atom as a lone billiard ball, with its decimal value painted on its surface and its binary value encased inside it. I imagined some billiard balls with their printable-character value overlaid on their decimal value, with their binary value deep inside them, so that if i needed to, i could peel back the character to reveal its decimal value. (This helped me make sense of trace() displays, print() output, and ex.err files, with their character/number combinations.) Keeping with the billiard simile, for sequences i imagined elastic, extensible frames that could stretch around any number of balls or other frames that had balls in them, or even nothing at all in them. Then i imagined those billiard balls - alone or within their own elastic frame - being inserted, removed, replaced, reversed, reassigned, or otherwise manipulated as needed. For some data structures, i imagined elastic frames that had been twisted to look (for example) like a table (eg a 3x3 table), but which were really one long sequence (eg of 9 top-level elements) that had been bent into a different shape; this helped me understand them as the same object, with a different look. An empty sequence looked like a collapsed elastic frame with nothing in it - not even a space (which had confused me at the start). One or more billiard balls spread around the table, were atoms. The same balls inside one or more elastic frames of their own, represented one or more sequences. A string became a sequence of balls inside a single elastic frame, with no other framed balls within it.

PS: i couldn't play billiards if my life depended on it!

_Arch