<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MAPCAR optimization in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599188#M55953</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;(if (= (apply '+ (mapcar 'strlen (list "" "" ""))) 0) (mapcar 'set '(v1 v2 v3) '(nil nil nil)))&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I believe the condition were if "any" of the variable. I could be wrong but what you had applies to &amp;nbsp;if ALL variable is equivalent to "" then set to nil.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Sep 2021 13:23:46 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2021-09-04T13:23:46Z</dc:date>
    <item>
      <title>MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599066#M55944</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;I have a need to check if the variables&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#333399"&gt;&amp;nbsp;v1 v2 v3&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; are equivalent, and if true, then set these variables to nil. To solve this problem, I created the following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(mapcar
	'set '(v1 v2 v3)
	(mapcar
		'(lambda ( x ) (if (= "" x) (setq x nil) x))
		(list v1 va2 v3)
	)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is, is it possible to optimize this code so as not to repeat the list of variables twice?&amp;nbsp;That is, exclude the repetition&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;'(v1 v2 v3)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; and &lt;FONT face="courier new,courier" color="#333399"&gt;&lt;STRONG&gt;(list v1 v2 v3)&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;and define the list of variables once.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 11:50:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599066#M55944</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T11:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599098#M55945</link>
      <description>&lt;P&gt;No you can not. First list '(v1 v2 v2) is list of variable names, and other is list of values). Check autolisp function QUOTE (short ') and what it does.&amp;nbsp; Check &lt;A href="http://www.lee-mac.com/quote.html" target="_blank" rel="noopener"&gt;here&lt;/A&gt; quote explanation from &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/569456"&gt;@Lee_Mac&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 12:09:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599098#M55945</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-04T12:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599106#M55946</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4267914"&gt;@Browning_Zed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All,&lt;BR /&gt;I have a need to check if the variables&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#333399"&gt;&amp;nbsp;v1 v2 v3&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; are equivalent, and if true, then set these variables to nil. To solve this problem,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;As per your code&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(Setq v1 "Cake" Va2 "" v3 "")
(mapcar '(lambda ( x )
	   (set x (if (/= "" (eval x))(eval x) nil  )))
		'(v1 va2 v3)
	)
--------------------------------------
Result is
("Cake" nil nil) 
_$ v1
"Cake"
_$ va2
nil
_$ v3
nil&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;If you are not planning to use the resulting list from mapcar function, this will be enough&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(foreach itm '(v1 va2 v3)
  (if (eq "" (eval itm))
    (set itm nil)
  )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Or are you saying if &lt;STRONG&gt;any&lt;/STRONG&gt; of the variables is ""&amp;nbsp; then set all to nil?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 12:20:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599106#M55946</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-04T12:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599116#M55947</link>
      <description>&lt;P&gt;You understood me correctly, I needed to check each variable separately.&lt;/P&gt;&lt;P&gt;But I'm also interested in the option if any of the variables is equivalent to "" then return nil. How can this be done?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 12:26:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599116#M55947</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T12:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599129#M55948</link>
      <description>&lt;LI-CODE lang="markup"&gt;(if (= (apply '+ (mapcar 'strlen (list v1 v2 v3))) 0) (mapcar 'set '(v1 v2 v3) '(nil nil nil)))&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 Sep 2021 12:38:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599129#M55948</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-04T12:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599145#M55949</link>
      <description>&lt;P&gt;Thanks. But in this case, you have to repeat the list again. Is it possible to do the same without repeating the list of variables? Perhaps the FOREACH function?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 12:48:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599145#M55949</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T12:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599159#M55950</link>
      <description>&lt;P&gt;You need to check equivalency of v1 v2 v3, this is first list appearance. In second part if condition is true we assign values to all variables to nil. It's then completely irrelevant how you do it, either with foreach or mapcar. Those two functions are practically&amp;nbsp; similar.&lt;/P&gt;&lt;P&gt;You can read this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(if (= (apply '+ (mapcar 'strlen (list v1 v2 v3))) 0) (mapcar 'set '(v1 v2 v3) '(nil nil nil)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(if (= (apply '+ (mapcar 'strlen (list "" "" ""))) 0) (mapcar 'set '(v1 v2 v3) '(nil nil nil)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or with foreach&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(if (= (apply '+ (mapcar 'strlen (list v1 v2 v3))) 0) (foreach e '(v1 v2 v3) (set e nil)))&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:02:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599159#M55950</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-04T13:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599165#M55951</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4267914"&gt;@Browning_Zed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But I'm also interested in the option if any of the variables is equivalent to "" then return nil. How can this be done?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;There's a couple of ways to do that. [ you only "see" the list of variables once ]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;((lambda (l)
   (if (vl-some '(lambda (x) (= (eval x) "" )) l)
     (foreach itm l (set itm nil)))
 )
  '(v1 va2 v3)
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;If you want to see a result, you can add&amp;nbsp;&lt;STRONG&gt;(mapcar 'eval l) &lt;/STRONG&gt;as else in the if condition.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Either way, you need to define the list of variable names&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;as an argument for mapcar/vl-some/vl-every/foreach....&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;as the invidual names to be assigned a value&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:07:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599165#M55951</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-04T13:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599186#M55952</link>
      <description>&lt;P&gt;Thanks &lt;STRONG&gt;pbejse&lt;/STRONG&gt;. This option is the most suitable for me. But what do you think about the &lt;STRONG&gt;VL-EVERY&lt;/STRONG&gt; function? Is it possible to do optimization using this function? Like this:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;(vl-every '/= '("" "") (list v1 v2))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;but is there a way to get rid of the &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;'("" "")&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:21:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599186#M55952</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T13:21:17Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599188#M55953</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;LI-CODE lang="markup"&gt;(if (= (apply '+ (mapcar 'strlen (list "" "" ""))) 0) (mapcar 'set '(v1 v2 v3) '(nil nil nil)))&lt;/LI-CODE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I believe the condition were if "any" of the variable. I could be wrong but what you had applies to &amp;nbsp;if ALL variable is equivalent to "" then set to nil.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:23:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599188#M55953</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-04T13:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599199#M55954</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4267914"&gt;@Browning_Zed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But what do you think about the &lt;STRONG&gt;VL-EVERY&lt;/STRONG&gt; function? Is it possible to do optimization using this function? Like this:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333399"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;(vl-every '/= '("" "") (list v1 v2))&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;That is the reason why i ask earlier for the condition, Vl-every means "ALL" while vl-some "if any"&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;To answer you're question It actually depend on the variable type you are testing, &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;If you dont want to define a predicate function (lambda) you can do it this way&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;(Setq v1 &lt;STRONG&gt;"d"&lt;/STRONG&gt; V2&lt;STRONG&gt; ""&lt;/STRONG&gt; v3 &lt;STRONG&gt;""&lt;/STRONG&gt;)&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;(vl-every &lt;FONT color="#0000FF"&gt;'snvalid&lt;/FONT&gt; (list v1 v2 v3)) --&amp;gt; &lt;STRONG&gt;nil&lt;/STRONG&gt; because v2 and v3 is invalid value&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;(Setq v1 "&lt;STRONG&gt;d"&lt;/STRONG&gt; V2 &lt;STRONG&gt;"e"&lt;/STRONG&gt; v3 &lt;STRONG&gt;"f"&lt;/STRONG&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;(vl-every &lt;FONT color="#0000FF"&gt;'snvalid&lt;/FONT&gt; (list v1 v2 v3)) --&amp;gt; &lt;STRONG&gt;T&lt;/STRONG&gt; because all three are valid&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;HTH&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:47:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599199#M55954</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-04T13:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599209#M55955</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4267914"&gt;@Browning_Zed&lt;/a&gt;Stated "I have a need to check if the variables&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#333399"&gt;&amp;nbsp;v1 v2 v3&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; are equivalent"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if any of condition "any" apply then your solution works.&lt;/P&gt;&lt;P&gt;Or in my version without using vl functions&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(if (member 0 (mapcar 'strlen (list v1 v2 v3))) (mapcar 'set '(v1 v2 v3) '(nil nil nil)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are so many options to write it.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:48:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599209#M55955</guid>
      <dc:creator>hak_vz</dc:creator>
      <dc:date>2021-09-04T13:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599217#M55956</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264" target="_self"&gt;&lt;SPAN class="login-bold"&gt;pbejse&lt;/SPAN&gt;&lt;/A&gt;, thank's man. This is what I need, you are cool.&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 13:52:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599217#M55956</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T13:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599233#M55957</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5530556"&gt;@hak_vz&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;"I have a need to check if the variables&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT color="#333399"&gt;&amp;nbsp;v1 v2 v3&lt;/FONT&gt;&amp;nbsp;&lt;FONT color="#FF6600"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; are equivalent"&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;All is well now, It all became so clear at post # &lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Cheers&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 14:09:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599233#M55957</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-04T14:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599235#M55958</link>
      <description>&lt;P&gt;OOPS. As it turned out, &lt;STRONG&gt;SNVALID&lt;/STRONG&gt; checks other characters and if the value is also equivalent to "=" or "*", or "|" this returns nil as well. It doesn't suit me.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 14:09:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599235#M55958</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T14:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599239#M55959</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4267914"&gt;@Browning_Zed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...&lt;SPAN&gt;also equivalent to "=" or "*", or "|"&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;... it doesn't suit me.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;There you go. now you got it. It all depends on the condition/function.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Then you need to define a function&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(vl-every '(lambda (x)
		    (/= "" x )) (list v1 v2 v3))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 14:16:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599239#M55959</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-09-04T14:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599248#M55960</link>
      <description>&lt;P&gt;YEAH! This is it!&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 14:21:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599248#M55960</guid>
      <dc:creator>Browning_Zed</dc:creator>
      <dc:date>2021-09-04T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599771#M55961</link>
      <description>&lt;P&gt;Another way to approach this is to see what's left after removing empty strings...&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun remove_blank (lst)
  (vl-remove-if '(lambda (x)(= x "")) lst)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Sep 2021 21:34:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10599771#M55961</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-09-04T21:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10600158#M55962</link>
      <description>&lt;P&gt;Another maybe:&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(mapcar 'set '(v1 v2 v3) '("" "" ""))
(if (apply '= (list "" v1 v2 v3))
  (mapcar 'set '(v1 v2 v3) '(nil nil nil))
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 05 Sep 2021 04:02:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10600158#M55962</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2021-09-05T04:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: MAPCAR optimization</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10601003#M55963</link>
      <description>Very good!&lt;BR /&gt;Ya know most, if not all, the mapcar examples dealt with symbol names, but&lt;BR /&gt;mine did not.  Nor did mine set any symbols to nil.  Maybe I should think&lt;BR /&gt;before I write.&lt;BR /&gt;Anyway, since there's no knowing how many symbols might be in the list,&lt;BR /&gt;foreach might be the simplest approach...&lt;BR /&gt;(foreach item lst&lt;BR /&gt;  (if (= (eval item) "")(set item nil))&lt;BR /&gt;)&lt;BR /&gt;Of course that still leaves the list as '(v1 v2 v3 vn) if that matters.</description>
      <pubDate>Sun, 05 Sep 2021 15:18:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mapcar-optimization/m-p/10601003#M55963</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2021-09-05T15:18:31Z</dc:date>
    </item>
  </channel>
</rss>

