skanev
- @ And we're talking programming language design here, not pragmatics.about 6 hours ago from TweetDeck in reply to tisho
- @ It is a design flaw, because "loose match" in a duck typed language is "non-sense", but that's where you need Type Theory.about 6 hours ago from TweetDeck in reply to tisho
- беше супер. 'nuff said.about 7 hours ago from TweetDeck
- @ ..you've guessed it -- you violate the principle of least surprise.4:19 PM Nov 7th from TweetDeck in reply to tisho
- @ Nope, % is not commutative. One thinks of === as equality operator, since it *looks like* one. If it's not what it looks like, then..4:18 PM Nov 7th from TweetDeck in reply to tisho
- @ But occasionally, it surprises you. Hence. -PLOS. Hence, not really sugar.1:21 PM Nov 7th from TweetDeck in reply to tisho
- @ Well, I would argue that the concept of a commutative binary operator is pretty intuitively known. You expect === to be commutative1:21 PM Nov 7th from TweetDeck in reply to tisho
- @ What do you disagree with, then? :)1:06 PM Nov 7th from TweetDeck in reply to tisho
- @ Also, consider that (0..10) === 1, but not 1 === (0..10).1:05 PM Nov 7th from TweetDeck in reply to tisho
- @ Implement a new class, StringOrInteger and have '5' === SOI.new(5) && 5 === SOI.new(5). Post it as gist. Then we talk.12:58 PM Nov 7th from TweetDeck in reply to tisho
- @ No, you're oversimplifying it. It works, but it is semantically wrong. It eventually violates the principle of least surprise.12:24 PM Nov 7th from TweetDeck in reply to tisho
- @ Не, нямаме live streaming, но можеш да заповядаш в Интерпред. Имаме безплатно кафе.4:16 AM Nov 7th from TweetDeck in reply to deimosbg
- @ I disagree. I would quote Type Theory on that, but even 1400 words won't be enough to cover that.2:32 AM Nov 7th from TweetDeck in reply to tisho
- @ But then this really boils down to polymorphic binary operators being really unorthogonal to inheritance. Especially in duck type1:22 PM Nov 6th from TweetDeck in reply to tisho
- @ ...problem when you want to define String-like and Integer-like classes and have the same behavior for === as the default types.1:20 PM Nov 6th from TweetDeck in reply to tisho
- @ I would have you cast to the same type for == if they are not parts of the same hierarchy (be explicit). Otherwise, there is a...1:20 PM Nov 6th from TweetDeck in reply to tisho
- @ I wouldn't implement it. I would have == (equal if same type), match? (=== for case only) and is? (for current equals?).1:19 PM Nov 6th from TweetDeck in reply to tisho
- @ Ah.12:08 PM Nov 6th from TweetDeck in reply to lucho870601
- @ Why would you think that? :)12:04 PM Nov 6th from TweetDeck in reply to lucho870601
- My day just got one hour shorter. Damn time zone changes :)11:37 AM Nov 6th from TweetDeck
|
- Name Stefan Kanev
- Location Stockholm, Sweden
- Web http://skanev.com/
- Bio Programming, Music
|