|
Mathlete posted:The big example is implementing a prime number sieve. In python, I'd just make a bitstring or something and play whack-a-mole. It's true that you can always set! the elements of mutable vectors in Racket, but the process is so wordy that you are practically discouraged from doing it. What would you do in a language like Haskell where apparently you can't mutate anything? Funny you should ask - there's a rather interesting paper around exactly this question, which also explains quite well why the "straightforward" functional implementation one might write is actually completely terrible. Jabor fucked around with this message at 11:20 on Jul 20, 2015 |
# ¿ Jul 20, 2015 11:16 |
|
|
# ¿ May 1, 2024 22:11 |
|
Snak posted:You can tell that it's wrong right away, because c is not a list. So the tail function obviously does not belong there. The recursion itself needs to be implemented in the Seq case, since that's the only place the code knows there's more than one statement. What are the actual semantics of NewInt? It looks to me like you might be overthinking it a little bit.
|
# ¿ Nov 14, 2015 13:33 |