Lisp Append 无法正常工作 [英] Lisp Append Not Working Properly

查看:20
本文介绍了Lisp Append 无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi I am trying append a simple element to a lisp list.

(append queue1 (pop stack1))

I thought the above code would append the first element of stack1 to queue1. Does queue1 need to be non nil? Thanks.

解决方案

Append returns the concatenated list (queue1 with the first element of stack1 appended). It does not modify queue1.

The destructive equivalent of append is nconc: this appends to the list "in place."

这篇关于Lisp Append 无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆