lisp线型center未定义,LISP中未定义的函数错误

I am working on a Lisp program that contains code to read in the dimensions of boxes and then sort them from shortest to longest lengths (and set each of these new lengths as new variables).

When I attempt to load my file into the interpreter, I get the following error:

*** - EVAL: undefined function NEW-D1

I am confused as to why I'd be getting this error because new-d1 isn't a function, it's a variable for the length of the shortest edge of a given box.

Here's the code where new-d1 is first initialized and set:

(defun get-box ()

(let ((d1 0) (d2 0) (d3 0) (new-d1 0) (new-d2 0) (new-d3 0))

(setf d1 (read))

(setf d2 (read))

(setf d3 (read))

(if (= d1 -1)

(exit)

(progn

(setq new-d1 (first (sort (list d1 d2 d3) #'

(setq new-d2 (second (sort (list d1 d2 d3) #'

(setq new-d3 (third (sort (list d1 d2 d3) #'

(next-part-of-program (new-d1 new-d2 new-d3))))))

How can I change my code so the interpreter knows new-d1 isn't a function and doesn't treat it as such? Thanks for any help!

Edited to add: Next part of program code:

(defun next-part-of-program(d1 d2 d3)

(if (> d2 b)

(put-on-c-list(d1 c-list))

(if (> d2 a) and (< d2 c)

(put-on-b-list (d1 b-list))

(put-on-a-list (d1 a-list)))))

Note: I've initialized a-list, b-list, and c-list earlier as global variables/lists to be added to later.

Thanks again!

解决方案

The last line of get-box should be:

(next-part-of-program new-d1 new-d2 new-d3)))))

You should not have parens around the arguments to next-part-of-program

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值