This is what I have done , I Guess I am missing something<br><br><br>; This function takes a list of symbols and list of numbers and produces all possible pairs of numbers and symbols <br>; Data definition A list of symbols is either an empty or a los , lon is either empty or lon<br>
; contract : cross los * lon - list of lists<br>; Purpose : for every item in the los make a list with every item in lon and make a list of all these lists<br>;examples : (cross '(a b c) '(1 2))<br>;(list (list 'a 1) (list 'a 2) (list 'b 1) (list 'b 2) (list 'c 1) (list 'c 2))<br>
;template : - (define cross (first los ) ( rest los) (first lon ) (rest lon))<br>(define cross (lambda ( los lon)<br> (cond <br> [(or (empty? los)(empty? lon)) empty]<br> <br>
[else ((cr (first los) lon)(cross (rest los) lon))])))<br>;contract symbol * lon -> list list of symbols and number<br>;purpose:-take the symbol and make a list of list of symbol and every element of lon<br>
;examples : (list (list a 1) (list a 2))<br>(define cr (lambda (sym lon)<br> (cond<br> [(empty? lon) empty]<br> [else (append (list sym (first lon))(list(cr sym (rest lon)))) ])))<br>
<br>;(cr 'a '(1 2))<br> <br>(cross '(a) '(1))<br>;(cross '(a b c) '())<br><br>procedure application: expected procedure, given: (list 'a 1 empty); arguments were: empty<br>
<br>Thanks <br>Aditya<br>