Re: Multi-assign

new topic     » goto parent     » topic index » view thread      » older message » newer message
DerekParnell said...

A new keyword is a really bad idea.

I agree with you, but I am curious as to why you think that.

I just thought using a keyword would be too confusing, as it'd be too easy to think it was a variable name or something.

DerekParnell said...

The preference for a shift-less character is not so important as the feature would not be a commonly used one.

We use shifted characters all the time for more commonly used expressions, like and'ing two sequences together.

DerekParnell said...

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.

Agreed. This arguably takes the underscore out of the equation as well (as it could be a typo on either side - variable named "_math" turned into "_,math" or something).

DerekParnell said...

So I think we are left with the single characters ... "@%^&*?" , and maybe combinations like "[]".

{ A, [], B } = SomeFunc(1, [], 2) 

This one I really like. It stands out to me.

Problem is, it could be a double typo ("[]" when "p[0]" was meant for example).

DerekParnell said...
{ A, @, B }  = SomeFunc(1, @, 2) 

I could live with this.

DerekParnell said...
{ 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) 

These all look like operations to me. Even the caret (we don't use it, but it reminds me of power() in other languages).

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu