[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to switch to regular Scheme

> I have this code:
> (require (lib "42.ss" "srfi"))
> (define (two-power n)
>    (max-ec (:while (: i n)
>                    (zero? (remainder n (expt 2 i))))
>            i))
> (define (hanoi m)
>    (list-ec (: n 1 (expt 2 m))
>             (+ (two-power n) 1)))
> [...]

> if anyone can rewrite this procedure without the SRFI syntax, it
> will be very helpful. I want to see how it would look without the
> simple one line but instead seeing the entire procedure instead of
> just max-ec and list-ec.

Do you want to know the plain Scheme code into which you program
is being translated by SRFI-42, or do you want to know how one
would program these procedures in Scheme without SRFI-42?