Difference between revisions of "Talk:1537: Types"

Explain xkcd: It's 'cause you're dumb.
Jump to: navigation, search
("normally": new section)
m (add my name "normally")
Line 18: Line 18:
 
<blockquote>This would make sense if it was <code>[] + 2</code></blockquote>
 
<blockquote>This would make sense if it was <code>[] + 2</code></blockquote>
  
It really wouldn't. Javascript returns <code>"2"</code> (god knows why) and Python gives an error. Don't really feel like testing many other languages, but I also think it's not really a logical assumption to make at all. Can't think of a reason for <code>[] + 2</code> to return <code>[2]</code>... ever. It ''might'' make a little bit of sense in Randall's oddly typed language, but not in any sane one.
+
It really wouldn't. Javascript returns <code>"2"</code> (god knows why) and Python gives an error. Don't really feel like testing many other languages, but I also think it's not really a logical assumption to make at all. Can't think of a reason for <code>[] + 2</code> to return <code>[2]</code>... ever. It ''might'' make a little bit of sense in Randall's oddly typed language, but not in any sane one. --[[User:TotempaaltJ|TotempaaltJ]] ([[User talk:TotempaaltJ|talk]]) 12:35, 12 June 2015 (UTC)

Revision as of 12:35, 12 June 2015

Relevant: WAT talk https://www.destroyallsoftware.com/talks/wat

Are (6) and (7) about completing sequences?

If the sequence was [1, 2, 3, ?] we would expect the ? to be a placeholder for 4. So [1, 2, 3]+2 is wrong := FALSE. But [1, 2, 3]+4 is correct := TRUE.

"+2 appears to be applying a unary + to the number 2" : or it adds the number of the line, 10, to 2 => 12. Also, the eleventh line, "2+2" may add 2 to all the following 2, explaining line 12. (that theory is from a friend of mine) Seipas (talk) 12:17, 12 June 2015 (UTC)

Also, for the lines 6 and 7, the operation "[1,2,3]+x" may add x to the set [1,2,3] and return true if the operation succeeded or false if not. Adding 2 to the set [1,2,3] returns false because 2 is already in [1,2,3]. Seipas (talk) 12:23, 12 June 2015 (UTC)

Yellowish Blue: http://www.livescience.com/17948-red-green-blue-yellow-stunning-colors.html is NaN!


"The ironic thing is that fractions with 2 in the nominator are not the kind of numbers that typically suffer from floating point impreciseness." - This is not technically correct. Should read "fractions with 'power of 2' in the denominator. However, the 3/2 would cause precision errors.

"normally"

This would make sense if it was [] + 2

It really wouldn't. Javascript returns "2" (god knows why) and Python gives an error. Don't really feel like testing many other languages, but I also think it's not really a logical assumption to make at all. Can't think of a reason for [] + 2 to return [2]... ever. It might make a little bit of sense in Randall's oddly typed language, but not in any sane one. --TotempaaltJ (talk) 12:35, 12 June 2015 (UTC)