prakashreddy 发表于 2022-7-5 23:30:08

Not understanding VL-SOME

Dear all
 
Vl-some confused me. Why the variation in below lines...
 

(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

Tharwat 发表于 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 .

prakashreddy 发表于 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

Tharwat 发表于 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 .
 

(vl-some '= (list 0 2 pi pi 4) (list 2 pi pi 4))Clear ?

Tharwat 发表于 2022-7-6 00:11:07

Test these to see the differences .
 

(vl-some '(lambda (j k)         (if (= j k)             (print j)         )         )      (list 0 1 7 10)      (list 1 2 7 10))
 
 

(vl-some '(lambda (j k)         (if (= j k)             (print j)         )         )      (list 0 1 2 10)      (list 1 2 3 10))

prakashreddy 发表于 2022-7-6 00:14:56

yes, now i understood thank you Mr. tharwat.

Tharwat 发表于 2022-7-6 00:23:23

 
You're welcome .

Lee Mac 发表于 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
页: [1]
查看完整版本: Not understanding VL-SOME