in reply to tr doesn't *really* use a list

"list" is not a well-defined term with Perl, it is just an English word. This is confusing to most people because "scalar", "scalar context", and "list context" (as well as "array") are all well-defined Perl terms.

Different people have proposed their own interpretation of what a "Perl list" is, but they don't really agree very well so you are best to free yourself of this impression.

tr doesn't take a list of scalars. What word do you suggest be used in place of "list" in the "list of characters" that tr has two of?

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: tr doesn't *really* use a list

Replies are listed 'Best First'.
Re: (tye)Re: tr doesn't *really* use a list
by Anonymous Monk on Dec 28, 2000 at 00:20 UTC
    tr doesn't take a list of scalars. What word do you suggest be used in place of "list" in the "list of characters" that tr has two of?
    A word that springs to mind and seems to capture the intended meaning is 'set', and perhaps, more correctly: 'ordered set'.
Re: (tye)Re: tr doesn't *really* use a list
by fundflow (Chaplain) on Dec 28, 2000 at 06:10 UTC
    What word do you suggest be used in place of "list" in the "list of characters" that tr has two of?

    eh... "string"?

      But "string" comes much closer to having a narrow definition in Perl than "list" does so this would make the problem worse. If I said that tr/a-z/A-Z/ replaced the characters in the first string with the cooresponding characters from the second string, then, to me, I'd be saying that "b" is not changed to "B" since "b" does not appear in the string "a-z".

              - tye (but my friends call me "Tye")
        I see your point. For me tr can be taking a short-hand for strings, for convinence. Admittedly I'm not familiar with the official naming given in the official parsing rules.


        Cheers,