我剛開始使用LISP,來自C語言的背景。到目前爲止,儘管它有着令人難以置信的學習曲線(我也是emacs新手),但它很有趣。subq(LISP)的簡單問題
無論如何,我在解析來自c源代碼的include語句時遇到了一個愚蠢的問題 - 如果任何人都可以對此進行評論並提出解決方案,那將會有很大幫助。
(defun include-start (line)
(search "#include " line))
(defun get-include(line)
(let ((s (include-start line)))
(if (not (eq NIL s))
(subseq line s (length line)))))
(get-include "#include <stdio.h>")
我希望最後一行返回
"<stdio.h>"
但是實際結果是
"#include <stdio.h>"
有什麼想法?
*啪啪額頭*當然,我的邏輯顯然是錯誤的 - 我們會看到第二天的結局如何:-) – Justicle 2009-09-09 23:33:30