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

RE: [Shootout] Ackermann.bat

Brent Fulgham writes:

> Are we supposed to handle error conditions?

Hmm. For this test the programs should behave the same way.

> For example, this script fails if you run it with no arguments.

> I was thinking:

>  (let ((n (if (= (vector-length args) 0)
>               1
>               (string->number (vector-ref args 0)))))

The C version reads

    int n = ((argc == 2) ? atoi(argv[1]) : 1);

so your version mimics this best.

Jens Axel Søgaard