lotrsimp12345 37 Posting Pro in Training

Here's my code.

(define L ())
(define (union L1 L2)
  ;continue until one list is empty
  (do()
    ((or (null? L1) (null? L2)))
    (cond
      ((<(car L1)(car L2)) (attach(car L1)(cdr L1)L2))
      ((eq?(car L1)(car L2)) (attach(car L1)(cdr L1)(cdr L2)))
      (else(>(car L1)(car L2)) (attach(car L2)L1(cdr L2)))
    )
  )
;after which you continue to add add while one list isn't empty and ;the second one isn't empty. I know I need a new attach function. 
)

(define (attach item List1 List2)
  (cons item L)
  (union List1 List2)
)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.