(define (square-all lst) (if (null? lst)
'()
(cons (square (car lst))
(square-all (cdr lst)))))
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAEGV_UybZ_m15Np%2BrJ51JWPhVkMhahESp9pRUet1%3DOTG5YOddQ%40mail.gmail.com.
--JBH
An example is this:
(define (square-all lst) (if (null? lst)
'()
(cons (square (car lst))(square-all (cdr lst)))))
As you can see, you've got:
- methods included by default (define, cons)
- booleans (null?)
- user-introduced vars (lst)
shown in the same color. It's really not clear. I'd like for them to be in different colors.
--Adam.
Looks interesting. Do you know any package of this type for DrRacket (or another program) that works semantically while you program? (not just as a checking tool like View Syntax)