Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×

Comment Re:Not to sound like an ass, but... (Score 1) 173

Moreover, the DoAndIfThenElse extension merely extends the "do" syntax with if/then/else clauses; it is syntactic sugar. Empty data declarations are essentially union types unioned over no labels and therefore can have no values except for the bottom value.

References:
http://hackage.haskell.org/trac/haskell-prime/wiki/DoAndIfThenElse
http://hackage.haskell.org/trac/haskell-prime/wiki/EmptyDataDecls

Comment Re:Strongly typed language? (Score 1) 299

What would be the result of 354+true? What is the result of true+true? What is the result of false-true? What is the result of true^3? What is the squareroot of true? Does it make any sense? Is it well defined?

In C, any non-zero int value is synonymous with true and the int value 0 is synonymous with false. So, 354+true is something besides 354; true+true is the sum of two non-zero int values; false-true is simply the arithmetic negation of some non-zero int value; true^3 is some non-zero int value multiplied by itself twice; sqrt(true) is some non-zero int value cast into a double and given to sqrt. It does not have to make sense because these operations are well-defined.

Slashdot Top Deals

Top Ten Things Overheard At The ANSI C Draft Committee Meetings: (5) All right, who's the wiseguy who stuck this trigraph stuff in here?

Working...