开始学习 Common Lisp!

41 1

Lisp 真是一门神奇的语言

我使用的学习资料:https://acl.readthedocs.io/en/latest/zhCN/

学习环境搭建过程: 

sudo zypper in emacs
git clone -b release https://github.com/roswell/roswell.git
nano src/cmd-run.h
sh bootstrap
./configure
make -j$(nproc)
sudo make install

ros setup # sbcl-bin + quicklisp
ros install sly
echo '(load (expand-file-name "~/.roswell/helper.el"))' >> ~/.emacs
emacs

然后在 EMACS 中:

M-x sly
C-x 1
 

这样就可以进入 REPL 进行学习了😋

(用 nano 改的是这里:https://github.com/roswell/roswell/issues/604#issuecomment-3130222012

我刚刚写的习题:

CL-USER> (defun listinlistd (ls)                                                                     
          (let ((result nil))                                                                       
            (do ((rest ls (cdr rest)))                                                              
                ((null rest) nil)                                                                   
              (setf result (or result (listp (car rest)))))                                         
            result))
LISTINLISTD
CL-USER> (defun listinlistr (ls)                                                                     
          (cond                                                                                     
            ((null ls) nil)                                                                         
            ((listp (car ls)) t)                                                                    
            (t (listinlistr (cdr ls)))))                                      
LISTINLISTR

 

带鱼是卖带鱼的带鱼摊主。本科生;HTML/CSS/JS小白。略通英语、日语。正在学习 Common Lisp. 博客“海鲜市场的带鱼摊子”
最新回复 ( 1 )
  • 2
    0
    滚来滚去……~(~o ̄▽ ̄)~o 。。。滚来滚去……o~(_△_o~) ~。。。
  • 游客
    3

    您需要登录后才可以回帖

    登录 注册

发新帖