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

Re: proper tail recusion for `or'



In the teaching languages `or' actualy signals an error for 
non-boolean values. So, it sticks around to make sure there was a 
boolean.

   Welcome to DrScheme, version 103.5d105.
   Language: Beginning Student.
   > (or "abc" "def")
   Condition value is neither true nor false: "abc"

This is not true in the full scheme languages.

Robby

At 1:15 PM +0100 3/15/01, Marco Maggesi wrote:
>Please, correct me if I am wrong.  By using the stepper, it seems that
>DrScheme do not handle tail recursion properly for `or'.  Is this a bug?
>
>Here is an example:
>
>   (define (list-or l)
>     (if (null? l)
>         #t
>         (or (car l) (list-or (cdr l)))))
>
>   (list-or (list #f #f #f #f #f #f #t))
>
>Thank you.
>MM