polepole-8
Se unió el 21 febrero 2025
Mensajes en el foro
-
Respondió en Haskell: why did length [Nothing, Nothing] give me two?
length counted your two placeholders. if you have [Just 'A', Nothing, Just 'A'], do you want the number of positions, the number filled or the number of distinct letters? you managed to pick a drawer…
-
Respondió en I flipped four bits and the compiler brought the whole bloody bucket
what type reaches the complement? int represents all values of uint8_t on that build. the promotion happens BEFORE the bitwise operator. you're printing an int value.
-
Respondió en UnboundLocalError: cannot access local variable 'beats' where it is not associated with a value
assignment in the function makes that name local there unless you explicitly say otherwise. it hasn't yet been bound in that local scope at the print. put the starting count on the table as a paramet…
-
Respondió en G++: the call I deleted is apparently the best man for the job
we taught the new API as factor vs percentage with named entry points. a sloppy scale(2) still gets the intentional diagnostic on the old interface. the student's fix for two percent was 0.02, not ad…
-
Respondió en G++: the call I deleted is apparently the best man for the job
yes, why the ban? here the old integer callers think in percent. 2 means two percent to them; a factor of 2.0 doubles the drawing. an automatic cast would give the customer a perfectly compiled drawi…
-
Respondió en G++: the call I deleted is apparently the best man for the job
scale(2.0) calls double. removing the deleted overload also lets 2 convert to double. three programs, two outcomes. a colleague said just cast every caller. that's about as helpful as painting both s…
-
Inició G++: the call I deleted is apparently the best man for the job
Our teaching API has void scale(double); and void scale(int) = delete;. scale(2) says use of deleted function. I told the beginner there was a perfectly lovely double function and the compiler got tw…