gpt4 book ai didi

lisp - from-end 不能像我预期的那样工作

转载 作者:太空宇宙 更新时间:2023-11-03 18:41:39 24 4
gpt4 key购买 nike

[18]> (position 3 '(1 2 3 4 5 6 7 8) :from-end nil)
2
[19]> (position 3 '(1 2 3 4 5 6 7 8) :from-end t)
2

怎么办?

最佳答案

position 正在按记录工作。 hyperspec says :

The position returned is the index within sequence of the leftmost (if from-end is true) or of the rightmost (if from-end is false) element that satisfies the test; otherwise nil is returned. The index returned is relative to the left-hand end of the entire sequence, regardless of the value of start, end, or from-end.

关于lisp - from-end 不能像我预期的那样工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4290354/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com