News for hackers. Stuff that matters.
Re:Why Structure and Interpretation of Computer Programs Mat... by dataflow on Monday June 17, 2024 @07:04AM (#40704360)
> But then you are saved from adding seconds to milliliters, because then the types will tell you it's complete nonsense.

I was thinking about this as I was reading your comment, and wondering: is it nonsense? If I have 5 seconds of time as well as 10 milliliters of water... I can consider them as being packaged together... which is addition. And I can subtract 3 milliliters and 6 seconds from them without running out of what I had. Nothing wrong with that, really. Five potatoes and a gallon of water is the same notion, just more familiar. Seems no more nonsensical than dividing length by time, right? Food for thought...

Re:Why Structure and Interpretation of Computer Programs Mat... by schoen on Monday June 17, 2024 @08:52AM (#40705124)
Bundling the time and the volume might be better called "forming a vector" or "forming an ordered pair" rather than "addition". You can then perform addition and subtraction with the resulting ordered pairs or vectors.
Re:Why Structure and Interpretation of Computer Programs Mat... by dataflow on Monday June 17, 2024 @11:29AM (#40706606)
There's no need for ordering (it's a bag rather than a vector), but yeah.
Re:Why Structure and Interpretation of Computer Programs Mat... by twixfel on Monday June 17, 2024 @12:12PM (#40707258)
That's nonsense because addition loses the structure. 3 litres and 6 seconds becomes indistinguishable from 4 litres and 5 seconds. Maybe that's what you want, but it's realistically pretty much never what you want.
Re:Why Structure and Interpretation of Computer Programs Mat... by dataflow on Monday June 17, 2024 @12:24PM (#40707455)
That's not how it works. Addition losing structure doesn't mean "strip out everything from the textual description that isn't a number". It just loses some properties, like ordering.

Which means, for example: (3 liters and (i.e. "+") 6 seconds) + (4 liters and 2 oranges) = (7 liters and 6 seconds and 2 oranges). Perfectly sensible addition, which you do all the time. There's no stipulation the output has to be a single number...

Re:Why Structure and Interpretation of Computer Programs Mat... by twixfel on Monday June 17, 2024 @01:13PM (#40708150)
Alright you're just talking about a different operation entirely but have decided to give it the name "addition". Not particularly insightful, but thanks anyway.
Re:Why Structure and Interpretation of Computer Programs Mat... by dataflow on Monday June 17, 2024 @01:27PM (#40708371)
What? Addition isn't just for numbers. This is literally no different from adding vectors. I'm sure you've seen that in school?
Re:Why Structure and Interpretation of Computer Programs Mat... by twixfel on Monday June 17, 2024 @04:34PM (#40710744)
What do you mean subtracting a cat from a dog doesn't make sense? Heh, ackshualllyyy I was imagining a vector of pets, where we have still have a dog but now a cat deficit of one, because the cat died and now we have a big hole in our family... nothing personnel kid. surely you learnt that in school?

The point is, making a vector, that's not addition.

Re:Why Structure and Interpretation of Computer Programs Mat... by dataflow on Monday June 17, 2024 @05:09PM (#40711097)
This is quite literally no different than 1i + 2j. Or if you hate vectors like i or j, just complex numbers -- 1 + 2i. I'm not sure why you feel the rudeness is helping you get a point across, because it's very much not.
Re:Why Structure and Interpretation of Computer Programs Mat... by twixfel on Monday June 17, 2024 @05:51PM (#40711492)
I am being no ruder than you are, more or less.

> because it's very much not

I don't expect to change the mind of someone who thinks that addition and defining a vector are the same thing. You've just redefined generally common terms and then started accusing people of being uneducated for not sharing your own eccentric definitions. Poor show.

Re:Why Structure and Interpretation of Computer Programs Mat... by dataflow on Monday June 17, 2024 @08:11PM (#40712698)
No, you're grossly misrepresenting what I said. I never accused you of being poorly educated; in fact quite the opposite. I was ~100% sure you had seen vectors and complex numbers before and I was telling you this is exactly like what you have already seen. That's not an accusation of poor education, that's literally the opposite: pointing out that you're well educated enough to have seen that before.

I didn't intend that to be rude, I was pointing out this is something everyone learns in a standard curriculum i.e. that this is very much the opposite of esoteric. But you seemed determined to reply that way, so I'll stop here.