Jump to content

Not understanding VL-SOME


prakashreddy

Recommended Posts

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

Link to comment
Share on other sites

(setq nlst (list 0 2 pi pi 4))

 

(vl-some '= nlst (cdr nlst))

T

 

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 .

 

 

(vl-some '= (list 1 2 3) (list 2 3))

nil

 

This one is nill because each item from the two lists is not equal to each other so it is NIL .

 

 

(vl-some '= '(1 2 3) '(2 3))

nil

 

This one is the same like the previous one .

Link to comment
Share on other sites

 

 

This one is nill because each item from the two lists is not equal to each other so it is NIL .

 

.

 

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

 

T

 

Please Check the above line

Link to comment
Share on other sites

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

 

T

 

Please Check the above line

 

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 [color=blue]pi[/color] pi 4) (list 2 pi [color=blue]pi[/color] 4))

Clear ?

Link to comment
Share on other sites

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)
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...