小编Teq*_*ila的帖子

在循环中使用Setf语法

为下面的变量做setf的正确方法是什么?

CG-USER(279): (defun LETTERSEARCH (string1 string2) 
  (let ((newString nil))
  (let ((letterSearchOn nil))
  (loop for i from 0 below (length string1)
      always
          (setf (letterSearchOn (char string1 i))           
          (print letterSearchOn))))))
LETTERSEARCH
CG-USER(280): (stringprod "abc" "abc")

NIL 
Error: `(SETF LETTERSEARCHON)' is not fbound
[condition type: UNDEFINED-FUNCTION]
CG-USER(281): 
Run Code Online (Sandbox Code Playgroud)

lisp common-lisp

1
推荐指数
1
解决办法
240
查看次数

标签 统计

common-lisp ×1

lisp ×1