标签:warning desc adr last ext turn procedure 一个 put
unless(fboundp(‘last2)
procedure(last2(list)
prog((index ouput)
unless(type(list) == ‘list
return(warn("The input type isnt a list"))
)
index = length(list) - 1
ouput = nth(index - 1 list)
return(ouput)
)
)
)
describe
RT,返回倒数第二个数据,省事。
extend
返回第一个:car(list)
返回第二个:cadr(list)
返回倒数第一个:last(list)
example
last2(list(1 2 3 4))
=>3
last2(1234)
=>*WARNING* The input type isnt a list
标签:warning desc adr last ext turn procedure 一个 put
原文地址:https://www.cnblogs.com/yeungchie/p/12861318.html