by vorg · 10y ago · 0 comments
If you need to specify the "u" in order to re-use it in one place only, then your language is syntactically challenged. Use a better language instead of caring about the names. A more flexible language would enable a predefined name like "it" or "_" instead, e.g:
users.map{"(" + it.first_name + ")"}
or even provide syntax to do common stuff, e.g. the asterix in: users*.{"(" + first_name + ")"}http://research.microsoft.com/apps/pubs/default.aspx?id=6974...
That's not always an option.
Also, I don't find the language OP linked syntactically challenged. C# has a similar syntax and it's much more readable than what you've provided:
people.Sort(p => p.FirstName);