乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 98|回复: 7

[编程交流] Not understanding VL-SOME

[复制链接]

20

主题

49

帖子

29

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-5 23:30:08 | 显示全部楼层 |阅读模式
Dear all
 
Vl-some confused me. Why the variation in below lines...
 
  1. (setq nlst (list 0 2 pi pi 4))(vl-some '= nlst (cdr nlst))T(vl-some '= (list 1 2 3) (list 2 3))nil(vl-some '= '(1 2 3) '(2 3))nil
 
 
Thanks
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-5 23:47:11 | 显示全部楼层
 
The is true because the first item from the first list is equal to the first item in the second list so it is T .
 
This one is nill because each item from the two lists is not equal to each other so it is NIL .
 
 
 
This one is the same like the previous one .
回复

使用道具 举报

20

主题

49

帖子

29

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-5 23:47:52 | 显示全部楼层
 
(vl-some '= (list 0 2 pi pi 4) (list 2 pi pi 4))
 
T
 
Please Check the above line
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 00:02:49 | 显示全部楼层
 
My reply was correct and indicating to the correct one .
The following one is correct due to equal items in the two lists .
 
  1. (vl-some '= (list 0 2 [color=blue]pi[/color] pi 4) (list 2 pi [color=blue]pi[/color] 4))
Clear ?
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 00:11:07 | 显示全部楼层
Test these to see the differences .
 
  1. (vl-some '(lambda (j k)           (if (= j k)             (print j)           )         )        (list 0 1 7 10)        (list 1 2 7 10))
 
 
  1. (vl-some '(lambda (j k)           (if (= j k)             (print j)           )         )        (list 0 1 2 10)        (list 1 2 3 10))
回复

使用道具 举报

20

主题

49

帖子

29

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
100
发表于 2022-7-6 00:14:56 | 显示全部楼层
yes, now i understood thank you Mr. tharwat.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 00:23:23 | 显示全部楼层
 
You're welcome .
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 00:37:53 | 显示全部楼层
Please Google the question before posting a new thread, existing explanations may be found here:
 
vl-some function evaluation
vl-some function evaluation
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-11 01:18 , Processed in 0.668178 second(s), 79 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表