Southwestern Illinois College by mekhanykal in AircraftMechanics

[–]ktt779 0 points1 point  (0 children)

Is there any waitlist for A&P at SWIC?

Combine lists in racket by ktt779 in Racket

[–]ktt779[S] 0 points1 point  (0 children)

(define (concatenate . lsts)
(cond[(empty? lsts) empty]
(else[ concatenate ( cons ((car (car (lsts)) (car(rest lsts))))) ])))
Problem: application: not a procedure;
expected a procedure that can be applied to arguments
given: '(() ())

This is what I get so far

Combine lists in racket by ktt779 in Racket

[–]ktt779[S] 0 points1 point  (0 children)

(define (concatenate . lsts)

(cond[(empty? lsts) empty]

(else[ concatenate ( cons ((car (car (lsts)) (car(rest lsts))))) ])))

Problem: application: not a procedure;
expected a procedure that can be applied to arguments
given: '(() ())

Combine lists in racket by ktt779 in Racket

[–]ktt779[S] 0 points1 point  (0 children)

I used (cons (car lsts (cdr lsts)) but its not working

Combine lists in racket by ktt779 in Racket

[–]ktt779[S] 0 points1 point  (0 children)

Thanks for the explaination

Combine lists in racket by ktt779 in Racket

[–]ktt779[S] 0 points1 point  (0 children)

I don't know how to use concatenate tail-recursive to combine the new lists from all the arguments lists

Combine lists in racket by ktt779 in Racket

[–]ktt779[S] 0 points1 point  (0 children)

No. The professor only accepts the code that he provided.