adlep
Diamond Member
Help...
This lisp programming is something very diffrient from what I have seen before...
Anyhow
Is it possible to modify this code so it is going to remove 3rd element from the list instead of the second?
The code:
Thanks
This lisp programming is something very diffrient from what I have seen before...
Anyhow
Is it possible to modify this code so it is going to remove 3rd element from the list instead of the second?
The code:
Help...(define deletesecond (lambda (L)
(cond
; if L isn't a list return null
((not (list? L)) '())
; if L has length less than 2 return null
((> 2 (length L)) '())
; return the cons of the head of L
; with the tail of the tail of L
(else (cons (car L)
(cdr (cdr L))
)
)
)
))
Thanks