unless(fboundp(‘InListp)
procedure(InListp(scan keylist)
prog((times)
times = 0
foreach(key keylist
if(scan == key then
times++
)
)
if(times > 0 then
return(times)
else
return(nil)
)
)
)
)
describe
扫描keylist中是否含有scan并计数,有则返回计数,否则返回nil。
example
InListp(1 list(1 2 3 2 1 2 1))
=>2
InListp(1 list(2 3 2 2))
=>nil
原文:https://www.cnblogs.com/yeungchie/p/12830408.html