syntax, lang = 'sweet', 'ruby'

check this syntactical sugar from ruby:

@title, @mood, @fulltext = title, mood, fulltext

(Example from _why's amazing online Ruby tutorial: 'Try Ruby in your browser')

Love it!

any chance that 'multiple assignments' can be added to C#? How about VB.Net.Next, hey paul?

Here's an explanation of the above syntax, taken from the Ruby spec:

" Multiple assignment form performs multiple assignment from expressions or an array. Each left hand side expression must be assignable. If single right hand side expression given, the value of the expression converted into an array, then each element in array assigned one by one to the left hand side expressions. If number of elements in the array is greater than left hand sides, they are just ignored. If left hand sides are longer than the array, nil will be added to the locations."

 

I'm currently writing a book about how to build your first product. If you want to build your first product, please sign up to be notified when the book is available.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.