Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: easy calling of associative array?



On 11/02/2015 01:05 PM, Bart Schaefer wrote:
} >        typeset -g "${1}[$2]=$3"	# quotes so [ ] isn't globbing

In the above,

     set_v ary idx val

is going to invoke

     typeset -g ary[idx]=val

Ordinarly "typeset" inside a function body behaves like "local".  The
-g option tells it not to do that, so that the name "ary" is taken to
come from the calling context instead of the current function context.

I don't understand. The idea of context here is new to me. Why is 'ary' not a variable
like any other?
} BTW, as a point of list etiquette:  Responding to most posts I let my
} lines wrap
} but resonding to yours, which seem to alway have fixed line width, I try to
} match that style, but looking at the returned posts from the list, they
} sometimes
} sproing badly. Should I  try to keep to your width, or just let lines wrap?

The above is what your text would look like if I didn't run it through
a reformatter.  It Used To Be that everyone assumed text should be
folded to be readable on an 80-column display, which, as a guy still
using the email program I wrote myself 20 years ago, I still do.  Then
along came HTML format email, and everybody assumed text should never be
wrapped at all (let the reader's UI deal with it).  Except there's still
this pesky thing about mailing lists preferring plain text, so we end up
with a hypbrid where text as you write it is folded to be readable at
whatever your display width is set, but then it gets re-folded to 80
when you send it -- except that it also keeps any real newlines you
entered, so if you were actually trying to make it look nice, it ends
up like the above instead.

Yes.  Very unfortunate.

Exactly what you SHOULD do depends on what you're using to write your
email.  In Thunderbird you should probably put literal line breaks only
at the ends of paragraphs, and let it wrap other stuff as it wills.

Ok.  Gotta get a better program, I hate Tbird.




Messages sorted by: Reverse Date, Date, Thread, Author