; (validPoint point) ; ------------------ ; returns true if point is a valid x,y point, ; i.e. a list of two numbers, ; returns nil otherwise ; e.g. (validPoint '(10 2)) returns t ; (validPoint '(x)) returns nil |
Assuming our points list contained points (1 1) (2 5) and (-1 3) (in that order) show the results of each of the three calls below:
; call #1 (mapcar 'validPoint pointsList) ; call #2 (sumPoints pointsList) ; call #3 (maplist 'sumPoints pointsList)