Money quote for the non-lisper:
> For simplicity, let’s use the notation
Yes, let's! Except in lisp, you can't. ;)
(Yes, feeling snarky.)
> For simplicity, let’s use the notation
Yes, let's! Except in lisp, you can't. ;)
(Yes, feeling snarky.)
defun diff(expr, x){
if(expr == x) 1
else if(car(expr) == 'plus') ['plus', diff(cadr(expr), x), caddr(expr), x]
else if(car(expr) == 'times')[
'plus',
['times', cadr(expr), diff(caddr(expr), x)],
['times', diff(cadr(expr), x), caddr(expr)]
]else 0
}But would your example code still be considered lisp?