Kevin Chiha
Kevin Chiha

Reputation: 69

lisp - error: no function definition: BUTLAST

I am trying to use butlast but for some reason, I get this error: no function definition: BUTLAST. Any ideas why?

Upvotes: 1

Views: 464

Answers (1)

Sylwester
Sylwester

Reputation: 48775

butlast does not exist in AutoLisp so that the error says there is such function is on point.

You can define it though

(defun butlast (lst)
  (reverse (cdr (reverse lst))))

Upvotes: 3

Related Questions