Re: Multi-assign
- Posted by DerekParnell (admin) Nov 16, 2011
- 2581 views
I'd prefer not to use '$' as it is already loaded with two meanings and to add a third is probably asking for future problems.
I think the dash '-' is fine for the LHS but not so good on the RHS. It could be a typo on the RHS where someone meant to key negative number as an parameter.
A new keyword is a really bad idea.
The preference for a shift-less character is not so important as the feature would not be a commonly used one. Also, keyboards vary as to which characters are shifted. For example, the tilde '~' is very awkward on some keyboards.
I think we need to have a glyph of some sort, and a visually prominent one would be preferable. We should try to avoid characters that are potentially typos.
So I think we are left with the single characters ... "@%^&*?" , and maybe combinations like "[]".
{ A, @, B } = SomeFunc(1, @, 2) { A, %, B } = SomeFunc(1, %, 2) { A, ^, B } = SomeFunc(1, ^, 2) { A, &, B } = SomeFunc(1, &, 2) { A, *, B } = SomeFunc(1, *, 2) { A, ?, B } = SomeFunc(1, ?, 2) { A, [], B } = SomeFunc(1, [], 2)