5 ms·
I'm not missing Scheme-like recursion from Python that much since Guido borrowed features from Icon and other languages that helps me do much of the crap that u
by xradionut 14y ago
I'm not missing Scheme-like recursion from Python that much since Guido borrowed features from Icon and other languages that helps me do much of the crap that used require nasty loops. (Love me some iterators!)
- pi18n 14y agoIterators are great! I think I prefer thinking in terms of recursion because it helps me break it into subproblems better. That doesn't invalidate anyone's preference for iterators or generators. And you Python devs have nice list comprehensions as well, so I don't doubt that you have no real need for recursion. But I will say it seems really weird to me to refuse tail-call recursion flat out. People even do it in C as an optimization (http://llvm.org/docs/Passes.html#tailcallelim-tail-call-elimination http://llvm.org/docs/Passes.html#tailcallelim-tail-call-elim...).
- chongli 14y agoMaybe not, but perhaps you'll later run into something you are missing from the language and Guido (PBUH) won't add add it. With Lisp (incl. Scheme), you can add it yourself.
- xradionut 14y agoI like Scheme, but I have this desire to be productive without reinventing the wheel or most of the automobile. If it's not in the core Python language, chances are it's a feature in one the almost infinite selection of third party modules. Or can be done in C and called from Python.
- cygwin98 14y agoMaybe you should give Clojure a try, which is a pragmatic Lisp in my opinion. You don't have to reinvent the wheel most of the time since you have access to a vast array of Java libraries.
- takeoutweight 14y agoUnfortunately Clojure is one of the few lisps without proper tail calls. (I love Clojure I just thought I should point this out in the context of the discussion).
- chongli 14y ago>Unfortunately Clojure is one of the few lisps without proper tail calls. (I love Clojure I just thought I should point this out in the context of the discussion). Fortunately, thanks to Clojure being a Lisp, you can add it yourself: https://github.com/cjfrisz/clojure-tco https://github.com/cjfrisz/clojure-tco
- S4M 14y agoThank you for posting this! I wanted for a long time to see a concrete example of adding a feature to a Lisp language, I will study that code.
- deleted 14y ago[deleted]