On Wed, Dec 12, 2012 at 7:19 PM, Dman P wrote:
> I was looking for a good example of the racket function for-eachI have
> been trying to implant it but can not seem to get it work
Have you been able to find the example in the documentation?
http://docs.racket-lang.org/reference/pairs.
A good example, it is like map, but for when you only care about side
effects.
On Wed, Dec 12, 2012 at 8:19 PM, Dman P wrote:
> I was looking for a good example of the racket function for-eachI
> have been trying to implant it but can not seem to get it work
>
>
>
>
I don't know if it's a particularly good example, but here's a basic usage
of for-each:
#lang racket
(define lst '(apple banana cherry))
(for-each
(lambda (x)
; x is bound to each item of lst in turn
(printf "item:~a~n" x)
; do something more with x
)
lst)
Hope this helps,
I was looking for a good example of the racket function for-eachI
have been trying to implant it but can not seem to get it work
Racket Users list:
http://lists.racket-lang.org/users
4 matches
Mail list logo