Tail Call Optimization: The Musical!!

Oh yes, I can really feel my brain dissolving after having implemented those.
(define (map proc . items) (define (iter acc remaining) (if (null? items) acc (iter (cons (proc (car remaining))) (cdr remaining)))) (reverse! (iter '() items)))(define (reduce initial proc items) (define (iter acc remaining) (if (null? remaining) acc (iter (proc acc (car remaining)) (cdr remaining)))) (iter initial items))

There is nothing confusing about map or reduce, those are first-chapter beginner's exercises in SICP. The reason they are included is because they are so frequently used that it would make no sense not to have them included.

wtf
Nobody actually writes programs in this language, right? It's just a bunch of LARPers jerking each other off because >muh homoiconicity, right?

The point is that writing the equivalent of map with a for loop is not confusing. Writing the equivalent of reduce with a for loop, ie an accumulation, is also not confusing. Mix them together, add logging or early exit or anything else and it still isn't confusing. Writing the equivalent of map using recursion is confusing, as is reduce, and I notice that your demonstration used "iter" (ie a for loop) for both.

Wrong.
gnu.org/software/guix/
gnu.org/software/shepherd/
gnu.org/software/guile/libraries/
After one month of programming in a LISP dialect ))) stop being problematic.
Programmers using languages with C-like syntax have small brains indeed.

Every recursion can be expressed as a loop and every loop can be expressed as recursion, I don't understand what you are getting at. The iter in my code is just another function I defined, which I can tail-recursively, it is not part of the language. I could have called it bash-the-fash for all it matters.


Programming in Lisp made me realize that syntax is just unnecessary bloat that obscures the view. The (((parentheses))) just vanish from view mentally and my editor balances them automatically anyway.

lol
This is your brain on (((LISP))). Utter braindamage.

>Programming in Lisp made me realize that syntax is just unnecessary bloat that obscures the view. The (((parentheses))) just vanish from view mentally and my editor balances them automatically anyway.
This. It is funny, but they actually vanish, brain removes them in some way.
I've never had something like this with languages using C-like syntax. LISP really changes the way you think.

Unbased.

You lose.
Shame because I'm pro recursion.

The Indian has better showmanship than the Jewess. That was a surprise seeing as how the Jews run showbiz.

I hate seeing females, it makesbme want to die.