Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why is C++...

Name: Anonymous 2011-12-07 12:06

...so bad? Why does it have such a bad reputation?

I'm an experienced C++ programmer and, while the language has warts, I can't understand the reason for the enormous amount of criticism against the language.

I'd like to hear the honest opinions of /prog/rammers in this regard.

Name: Anonymous 2011-12-17 15:43

>>237
The (remove-duplicates (cdr xs)) call is a tail call, the (cons (car xs) (remove-duplicates (cdr xs))) is not. The first reuses the caller's stack frame, the second does not. (remove-duplicates '(a b b c c c d d d d)) will use only 4 stack frames in languages with proper tail calls, Clojure will use (length '(a b b c c c d d d d)).
That's what I meant with ``tail recursion isn't always tail recursive'': the recursive call doesn't have to be in tail position in all cases to benefit of proper tail calls.

>>238
Seriously, the lack of laziness in a lisp is a bigger deal breaker form e than the lack of automatic tail call elimination. Not to mention immutable sets/vectors/associative arrays.
And that's also wrong, or at least, it's wrong in Racket and some Scheme implementations, and probably in CL too.
SRFI-45 (lazy/eager/delay/force) isn't rocket science either, it's implementable in half an afternoon of macros, but you can't understand that without, you know, using a real Lisp.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List