aloy 发表于 2022-7-5 16:01:57

合并中的两个点列表

大家好,
 
我有两个要点列表,如下所示:
 
列表A-((4.5)(2.1)(5.7)(8.9))
列表B-((0 1)(3 7))
 
我需要一个lisp例程以x的升序合并这两个列表。
 
提前感谢。
芦荟

hanhphuc 发表于 2022-7-5 16:26:09

使用append合并2个列表
使用vl排序进行排序
 

(vl-sort (append a b) ''((a b)(<(car a)(car b)) ))

李之前在这里讨论过

aloy 发表于 2022-7-5 16:40:59

FranknBeans 发表于 2022-7-5 16:57:14

 
Sorry to hijack this thread but I'm curious how that double apostrophe works, haven't seen that before. Does it only take the place of a lambda or can it be used in other ways? I tried googling but didn't see any relevant articles.

hanhphuc 发表于 2022-7-5 17:05:49

 
i only used double quotes just a bit faster in forum posting,
yet its not recommended due to it's not optimized & bad performance
 
Recommended:

'(lambda ...)(function)
Lee Mac discussed before, here
页: [1]
查看完整版本: 合并中的两个点列表