Quote:
Originally Posted by Tolnaftate2004
I may have been gone for a while (and not to nitpick or jump on the bandwagon...), but this is wrong. It is not as pretty as javascript to pull it off, but it can be done.
|
No, you can definitely not call the function in the same line you define it, like so:
PHP Code:
temp.example = (function () {
temp.i = 2;
return temp.i*5;
})();
That would fail. I'm pretty sure this is a result of YACC not truly treating functions (and other structures such as arrays) as first-class, when they should be and would make the grammar considerably less complex that whatever is currently there, most likely.
Quote:
Originally Posted by Tolnaftate2004
Just because Crockford messes up doesn't mean no one should be allowed to benefit from the usefulness of switch. S'all I'm sayin'.
|
Crockford isn't the only one I'm citing. A number of languages (see the giant list I posted a few posts back) have entirely removed the fall-through construct because of its hazard.
Quote:
Originally Posted by Tolnaftate2004
A few more things: javascript is a language in which appending the bracket at the end of a function is highly recommended because it has a sort of auto-complete where it puts a semicolon at the end of any line that a parser thinks is a complete statement. Placing a bracket at the end of a line avoids any confusion. GraalScript does not have this issue. Go hog wild, throw that bracket anywhere you like (where syntax allows).
|
I'm not sure exactly what you are referring to here.
Quote:
Originally Posted by Tolnaftate2004
The argument that X language uses Y means that Y is right for Z language is absolute nonsense. R is a statistical programming language that is C-like and return is a function in R.
|
It isn't nonsense if languages X and Z have similar core assumptions.
Quote:
Originally Posted by cbk1994
This thread right now is too messy to be stickied.
|
What are you talking about?
Quote:
Originally Posted by cbk1994
You've admitted there are things you would change if you could.
|
I wasn't claiming that what I wrote was perfect and I certainly would have changed everything by now, but I don't have the permissions to.
Quote:
Originally Posted by cbk1994
I would rather see a new thread stickied promoting coding standards, not personal preference.
|
Then go write one and stop defacing mine.