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

Re: How to switch to regular Scheme



I realized i made this unclear. I'm trying to translate this procedure into the plain Scheme code. In other words, I'm trying to make it work in Scheme as if SRFI never existed.

Thank you.

On 1/23/06, Amandeep Singh <varoadster@xxxxxxxxx> wrote:
I want the plain Scheme code without using max-ec, and list-ec. I tried to define list-ec and max-ec as assisting procedures but it was hard for me to figure out.

I want a simple way to translate this into the plain Scheme code without using any of the SRFI syntax (eg: max-ec, list-ec, i)

Thank you.


On 1/23/06, Sebastian Egner < sebastian.egner@xxxxxxxxxxx> wrote:

> 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?

Sebastian.