<?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: &amp;quot;and&amp;quot;, no not the function. Help with evaluating 2 expressions in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537259#M128973</link>
    <description>&lt;P&gt;Thanks for the info regarding an empty string, BeekeeCZ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it's weird that an empty string is T, but an empty list is nil...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: (and "")&lt;BR /&gt;T&lt;/P&gt;&lt;P&gt;Command: (and '())&lt;BR /&gt;nil&lt;/P&gt;&lt;P&gt;Command: (= '() nil)&lt;BR /&gt;T&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2016 17:24:18 GMT</pubDate>
    <dc:creator>steve_carson</dc:creator>
    <dc:date>2016-09-01T17:24:18Z</dc:date>
    <item>
      <title>"and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537141#M128968</link>
      <description>&lt;P&gt;Hi all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need to call on your expertise again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I find many times where I want to say "and" in my routines,&amp;nbsp;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;For example in "plain" English:&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;"If &lt;STRONG&gt;Angle1&amp;nbsp;&lt;/STRONG&gt;is less than 0&amp;nbsp;&lt;EM&gt;and&amp;nbsp;&lt;/EM&gt;&lt;STRONG&gt; Angle2&amp;nbsp;&lt;/STRONG&gt;is greater than 0, then SETQ....blah blah blah&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;Is there a function or expression that lets you do this? &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;Ultimately find a work around with multiple &lt;FONT color="#3366FF"&gt;if&lt;/FONT&gt; statements or &lt;FONT color="#3366FF"&gt;cond.&amp;nbsp;&lt;FONT color="#000000"&gt;It always seems to get messy and convoluted.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a simpler way to evaluate/compare to arguments like that?&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 16:36:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537141#M128968</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-01T16:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537189#M128969</link>
      <description>&lt;P&gt;You're saying you're looking for an alternative to the AND&amp;nbsp;function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(If (and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Angle1 0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; (&amp;gt;&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;Angle2&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; );and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; (setq .....)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; );if&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 16:53:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537189#M128969</guid>
      <dc:creator>Shneuph</dc:creator>
      <dc:date>2016-09-01T16:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537193#M128970</link>
      <description>&lt;P&gt;And actually IS the function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your&amp;nbsp;example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(if (and (&amp;lt; angle1 0)
	 (&amp;gt; angle2 0)
	 )
  (setq blah "blah"))&lt;/PRE&gt;
&lt;P&gt;It could even be used in following syntax. The result is the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(and (&amp;lt; angle1 0)
     (&amp;gt; angle2 0)
     (setq blah "blah")
     )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:01:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537193#M128970</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-09-01T17:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537208#M128971</link>
      <description>&lt;P&gt;Thank You! Your examples were quite helpful&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was confused by the cryptic definition of AND I was looking at.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"...Arguments&lt;BR /&gt;expr Any expression.&lt;BR /&gt;Return Values&lt;BR /&gt;Nil, if any of the expressions evaluate to nil; otherwise T. If and is issued&lt;BR /&gt;without arguments, it returns T.&lt;BR /&gt;Examples&lt;BR /&gt;Command: (setq a 103 b nil c "string")&lt;BR /&gt;"string"&lt;BR /&gt;Command: (and 1.4 a c)&lt;BR /&gt;T&lt;BR /&gt;Command: (and 1.4 a b c)&lt;BR /&gt;nil"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;your examples make perfect sense.&lt;/P&gt;&lt;P&gt;Thanks Again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 16:59:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537208#M128971</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-01T16:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537220#M128972</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Thank You! Your examples were quite helpful&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was confused by the cryptic definition of AND I was looking at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"...Arguments&lt;BR /&gt;expr Any expression.&lt;BR /&gt;Return Values&lt;BR /&gt;Nil, if any of the expressions evaluate to nil; otherwise T. If and is issued&lt;BR /&gt;without arguments, it returns T.&lt;BR /&gt;Examples&lt;BR /&gt;Command: (setq a 103 b nil c "string")&lt;BR /&gt;"string"&lt;BR /&gt;Command: (and 1.4 a c)&lt;BR /&gt;T&lt;BR /&gt;Command: (and 1.4 a b c)&lt;BR /&gt;nil"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;your examples make perfect sense.&lt;/P&gt;
&lt;P&gt;Thanks Again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The number 1.4 inside of &lt;EM&gt;and&lt;/EM&gt; does not make much sence. It's always T. But testing variables (and a b c) for not nil, that makes the sence.&lt;/P&gt;
&lt;P&gt;BTW an empty string variable (setq a "") is True.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:09:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537220#M128972</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-09-01T17:09:26Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537259#M128973</link>
      <description>&lt;P&gt;Thanks for the info regarding an empty string, BeekeeCZ.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it's weird that an empty string is T, but an empty list is nil...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command: (and "")&lt;BR /&gt;T&lt;/P&gt;&lt;P&gt;Command: (and '())&lt;BR /&gt;nil&lt;/P&gt;&lt;P&gt;Command: (= '() nil)&lt;BR /&gt;T&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:24:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537259#M128973</guid>
      <dc:creator>steve_carson</dc:creator>
      <dc:date>2016-09-01T17:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537284#M128974</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/508259"&gt;@steve_carson&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it's weird that an empty string is T, but an empty list is nil...&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Just to add another to that list of empty things that may or may not be nil:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result of (ssget), if nothing is selected or found,&amp;nbsp;is nil, not an empty selection set.&amp;nbsp; But empty selection sets &lt;EM&gt;can&lt;/EM&gt; "exist" -- if you remove everything from a selection set with (ssdel) functions, or start an empty one&amp;nbsp;via (ssadd) with no items-do-add argument, it may be empty and have an (sslength) of 0, but it still "exists" and is &lt;EM&gt;not&lt;/EM&gt; nil.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2016 17:38:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537284#M128974</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2016-09-01T17:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537928#M128975</link>
      <description>Kudos to you!&lt;BR /&gt;Do you remember Stephan Koster too?&lt;BR /&gt;He's the one that got me hooked on anding.&lt;BR /&gt;Technically, it stops further evaluations if any returns nil.</description>
      <pubDate>Thu, 01 Sep 2016 22:43:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6537928#M128975</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2016-09-01T22:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6538518#M128976</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt; wrote:&lt;BR /&gt;Kudos to you!&lt;BR /&gt;Do you remember Stephan Koster too?&lt;BR /&gt;He's the one that got me hooked on anding.&lt;BR /&gt;Technically, it stops further evaluations if any returns nil.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks! Unfortunately I have no idea how this guy is, although I know you've noticed him before. But I remember were I saw this 'odd' usage of &lt;EM&gt;and&lt;/EM&gt; function for the first time - it made me a little thinking about it. It was&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;'s ReportAngle routine &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/transforming-angle/td-p/3857504" target="_self"&gt;HERE&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another interesting constructions using similar principle are...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(or dst
    (initget 5)
    (setq dst (getdist "\nSet distance: "))
    )

;;;;;

(setq dst (cond ((getdist "\nSet distance &amp;lt;10&amp;gt;: "))
		(10)))&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 07:59:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6538518#M128976</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-09-02T07:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6538556#M128977</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The rules about truth values in the Lisp language family (except Scheme) can be expressed quite simply:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. The symbol NIL and the empty list are the same object, there is no way to distinguish between them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. NIL is the only thing that is considered false in a boolean context (IF, COND, AND, OR etc.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Anything else whatsoever is considered as true.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 08:28:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6538556#M128977</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2016-09-02T08:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: "and", no not the function. Help with evaluating 2 expressions</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6538572#M128978</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd write the last one slightly differently:&lt;/P&gt;&lt;PRE&gt;(setq dst (cond ((getdist "\nSet distance &amp;lt;10&amp;gt;: "))
		(T 10)))&lt;/PRE&gt;&lt;P&gt;but that is just a style preference.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a little contrived construction, usually only seen in AutoLISP.&lt;/P&gt;&lt;P&gt;That would be legal also in other Lisps, but there this can be done in a simpler way, because in other Lisps OR returns the value of the last thing it evaluated, instead of T:&lt;/P&gt;&lt;PRE&gt;(setq dst (or (getdist "\nSet distance &amp;lt;10&amp;gt;: ")
              10))&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 08:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/quot-and-quot-no-not-the-function-help-with-evaluating-2/m-p/6538572#M128978</guid>
      <dc:creator>martti.halminen</dc:creator>
      <dc:date>2016-09-02T08:39:11Z</dc:date>
    </item>
  </channel>
</rss>

