5 ms·
I mostly read this as an exposition on how painful other types in Scheme are - like, if numbers were as painful to use as ever other thing, what an absurd world
by ianbicking 12y ago
I mostly read this as an exposition on how painful other types in Scheme are - like, if numbers were as painful to use as ever other thing, what an absurd world that would be!
- soegaard 12y agoSo did I. So why have append for lists, and string-append for strings? Well, Scheme implementors were early on (still are) interested in writing efficient compilers - that affects the naming choices.
- gus_massa 12y agoIn the "Racket2" wish list ( https://github.com/plt/racket/wiki/Racket2 https://github.com/plt/racket/wiki/Racket2 ) there is an idea to use more generics: > Generic programming by default: map, fold, and friends are generic [in Racket2] and not specialized to lists. I have something similar in my private "language" that I use for internal projects, it also use that for append and length (actually len, because length is too verbose). And I use only list-append or string-append in the few cases where the speed is critical. If something like this is implemented, the transformation from append to list-append or string-append could be made automatically in some cases by the Typed Racket optimizer (or the core optimizer).
- davexunit 12y ago>So why have append for lists, and string-append for strings? Because concatenating two lists and concatenating 2 strings are distinctly different operations on different data types, and it helps that they are named as such.
- copsarebastards 12y ago> Because concatenating two lists and concatenating 2 strings are distinctly different operations on different data types, and it helps that they are named as such. "Named" is the wrong word for that sentence. Names are for people, boats, pets, not data structures. You probably meant "data type named".
- codyb 12y agoThe alternative might make sense as well, that continuous mathematics is incredibly difficult to implement digitally. Fractions, tons of operators, rounding, irrationals, transcendentals, important constants, etc. The comparisons are interesting because of the limits of computer accuracy. In the end its probably a bit of both.
- nyir 12y agoBut also as an example of how fragmented the language becomes due to the splitting off of SRFI libraries instead of having a big but convenient ball of mud (CL).
- davexunit 12y ago>if numbers were as painful to use as ever other thing Other data structures aren't painful to use in Scheme.
- jrochkind1 12y agoI'm pretty sure that is part of how it was intended?