Neonakis sorry for.

 
Crivello: But it seems very nonsensical

Irsik: Rurik: there wasn’t really anything else to do here.

Kinne: Rurik: because operators in JS are special, not methods of objects.

Vanscoy: And even if operators were methods, what should 1, “1”, 2.sort give you?

Caldera: Rurik: internally a comparison function is used, that compares two elements and returns 1, 0 or -1. greater than, equal, lower than

Bebber: Should 1.compare”1″ give you a runtime error? Should it try converting “1” to a number? And what about “1”.compare2? How do you guarantee that “1”.compare2 and 2.compare”1″ have sensible behaviours?

Dearin: Those are all hard questions.

Zeminski: Comparing things of different types should be an error.

Luehrs: In particular, Mermaid enforces that both arguments to “compare” should be of the same type. This is tricky when you consider that numbers can be of different types too. So if your language has Floats, Integers, BigInt, etc. you need to make sure “compare” does something sensible between all of those

Kunimitsu: If you want “1” to be equal 1, you can do that

Silovich: Riise: is var a : int = 1; var b : byte = 1; a.compareb considered a type error?

Merrithew: That does make it easy, but also arguably less practical

Bajko: Specially in languages that autopromote numbers.

Guilboard: Or arguably more practical.

Woodand: Hagb4rd: boolean true

Loxtercamp: If you can tell the difference in types

Peavey: Haskell doesn’t have comparisons between different integer types, noone’s complaining there.

Skender: Hagb4rd, I have seen some people encode logical implication as =, like true = false

Fortun: Haskell also doesn’t have heterogeneous collections

Lacefield: Is really interesting to see such things

Thornsbury: Heterogeneous collections are bad.

Ramroop: So the problem hardly happens there

Mcgue: Create a common interface that handles the things you want and convert the values to that.

Hartly: Hannibal_Smith: how does false imply true?

Atkins: That’s basically what you do in Java anyway, just without the “convert” bit.

Lossman: Neonakis, because it’s trivially true

Harpel: Neonakis: https://xkcd.com/246/

Batara: Riise: sure, you can capture limited heterogeneous collections with sum types, or convert to a common type. But some would still argue that’s less practical.

Hagadone: Neonakis, to me was really interesting to see that = works the same way for 0 and 1

Jeffrey: The same way as logic implication

Feuer: And then they might not care about the consistency tradeoff

Jurewicz: Those people would be wrong.

Quilindrino: I’m not sure I’d call them wrong. Mostly they just care about different things.

Schuett: Neonakis: they probably haven’t thought much about variance.

Cortis: Well, no one understands variance anyway :’D

Selman: Oh little OT Neonakis I was wrong on using the term trivially true for your question, the rihth term would be vacuous truth http://www.math.fsu.edu/~pkiry/mad2104/SlideShow/s3_2.pdf

Grunewald: Hagb4rd: no, covariance and contravariance.

James: Hagb4rd: eg, does a list of bytes satisfy the interface of a list of ints?

Wilburn: Could someone help me with this function ?:-/ Ive wrote it with some help but this has been frustrating me a few days already and im smashing my head against keyboard already :-/ I can’t seem to understand how this works :-/ http://repl.it/BFzA

Kjar: In particular I don’t understand how wasFound ever changes its value to true from false, what makes it change the value to true?

Nanz: Neonakis sorry for highlighting you, could you please give me a hint or like tell me where to look for the answer? this upsets me already lol