Search found 1 match

by crimsondoll
Mon Nov 12, 2012 9:16 am
Forum: Homework
Topic: Finding Depth of an Expression
Replies: 3
Views: 10691

Finding Depth of an Expression

Hi, I'm incredibly new to Lisp and I've got to write a program that calculates the depth of an expression. Here's what I've got so far: (DEFUN depth (L) (IF (NIL L) 0) (IF (NIL (SECOND L)) 0) (IF (ATOM (SECOND L)) (1+depth(CDR L))) ) What it's supposed to do is return 0 if the list L is empty or onl...