;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname p4) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) (define (myprog mylist) (cond [(empty? mylist) 0] [(number? (first mylist)) (myprog (rest mylist))] [else (+ 1 (myprog (rest mylist)))] ) ) ;;> (myprog (list 'John 'Robert 'Bill 'Tom 12 'Robert)) ;;5