scheme

What's wrong with this coin change python implementation?

What's wrong with this coin change python implementation? Question: I’m reading through Structure and Interpretation of Computer Programs, and on section 1.2.2 there’s a brute force implementation of the coin change problem given: (define (count-change amount) (cc amount 5)) (define (cc amount kinds-of-coins) (cond ((= amount 0) 1) ((or (< amount 0) (= kinds-of-coins 0)) …

Total answers: 2

Convert to Racket(Scheme)

Convert to Racket(Scheme) Question: I have this code that works, on python. I am new to DRrACKET, how can I translate it into DRrACKET. I am struggling to write a DRrACKET code that produces the exact result. Your help is highly appreciated. # python program to find the length of the largest subarray which has …

Total answers: 3

Why are Python and Ruby so slow, while Lisp implementations are fast?

Why are Python and Ruby so slow, while Lisp implementations are fast? Question: I find that simple things like function calls and loops, and even just loops incrementing a counter take far more time in Python and Ruby than in Chicken Scheme, Racket, or SBCL. Why is this so? I often hear people say that …

Total answers: 4