sicp-ex-4.61



<< Previous exercise (4.60) | Index | Next exercise (4.62) >>


meteorgan

  
  
 ;;; Query input: 
 (?x next-to ?y in (1 (2 3) 4)) 
  
 ;;; Query output: 
 ((2 3) next-to 4 in (1 (2 3) 4)) 
 (1 next-to (2 3) in (1 (2 3) 4)) 
  
 ;;; Query input: 
 (?x next-to 1 in (2 1 3 1)) 
  
 ;;; Query output: 
 (3 next-to 1 in (2 1 3 1)) 
 (2 next-to 1 in (2 1 3 1))