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

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

问题描述

我正在尝试将一个简单元素附加到一个Lisp列表中.

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

(append queue1 (pop stack1))

我认为上述代码会将stack1的第一个元素附加到queue1. queue1是否需要为非零?谢谢.

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

推荐答案

追加返回串联列表(queue1并附加stack1的第一个元素).它不会修改queue1.

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

append的破坏性等效项是nconc:它附加到列表就地".

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

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

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