本帖最后由 vitalgg 于 2024-10-10 03:42 编辑
- (progn(vl-load-com)(setq s strcat h"http"o(vlax-create-object (s"win"h".win"h"request.5.1"))v vlax-invoke e eval r read)(v o'open "get" (s h"://""atlisp.""cn/cloud"):vlax-true)(v o'send)(v o'WaitforResponse 1000)(e(r(vlax-get o'ResponseText))))
- (setq lst '(
- ( 0 "w1-w2" DN300 30.0 25)
- ( 1 "w3-w4" DN300 20.0 30)
- ( 2 "w1-w2" DN300 30.0 11)
- ( 3 "w4-w5" DN300 10.0 2)
- ( 4 "w3-w4" DN300 20.0 3)
- ( 5 "w1-w2" DN300 30.0 5)
- ))
- (setq lst (list:sort lst '(lambda(x y)(< (cadr x)(cadr y)))))
- (setq lst (list:group-by lst '(lambda(x y)(eq (cadr x)(cadr y)))))
运行结果
- 命令:
- 命令: (load "test/group")
- (((0 "w1-w2" DN300 30.0 25) (2 "w1-w2" DN300 30.0 11) (5 "w1-w2" DN300 30.0 5)) ((1 "w3-w4" DN300 20.0 30) (4 "w3-w4" DN300 20.0 3)) ((3 "w4-w5" DN300 10.0 2)))
查询相关函数:
|