tcl - I want to find the entries which doesn't match with given pattern in the list and the list name is a variable -


i want find entries in list doesn't match given pattern. list name variable. want in loop.

for example:

set li {{1 2} {1 3} {-1 -1}}  lsearch -all -inline -exact -not $li {-1 -1} 

ans: {1 2} {1 3}.

but problem is, want give variable name in place "li". li vary in loop.

your question unclear. i'm assuming when 'i want give variable name in place "li"' mean want use variable designate name of variable.

you can using set:

set varname li lsearch -all -inline -exact -not [set $varname] {-1 -1} 

when [set $varname], tcl first substitute "li" $varname. transforms statement lsearch ... [set li] ..., , [set li] functionally identical $li.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -