Re: Multi-assign

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...
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.

I agree with those reasons, and also believe that we should generally be parsimonious about adding keywords.

jimcbrown said...
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).

Yes, I agree with these. However, I think I may be the only one who still thinks the $ is perfect.

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

I could live with this.

This is not awful, though I'd always imagined using @ for implicit routine id's or something in the future.

jimcbrown said...
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).

Yes. I was thinking modulo (%) and bitwise xor (^).

I think my preferences, so far, in order, are: $, ~, @.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu