dangrous true?
Posted: Wed Jul 27, 2016 12:32 pm
if you use true? as checking function for list, be attention to: blank list -> '(), would not match it.
If you often use it, advise you use :
Code: Select all
> (true? '())
nil
Code: Select all
> (define (bool x) (if (nil? x) nil true))
> (for-all bool '(1 2 3 4 () 6))