<?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: in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804851#M161543</link>
    <description>Regardless of how you try to spin this, you are wrong.&lt;BR /&gt;
&lt;BR /&gt;
The statement "apply is not meant to be used with unary &lt;BR /&gt;
operators" is wrong, regardless of whether one accepts &lt;BR /&gt;
your contorted description of a function that takes only &lt;BR /&gt;
a single argument ('unary operator'), or not.&lt;BR /&gt;
&lt;BR /&gt;
The fact of the matter is that (apply) can be used&lt;BR /&gt;
with what you call 'unary operators' (such as the&lt;BR /&gt;
NOT function), but if you supply the wrong number of&lt;BR /&gt;
arguments in the list, than it is no different than&lt;BR /&gt;
calling NOT directly, with the wrong number of arguments.&lt;BR /&gt;
&lt;BR /&gt;
This completely refutes your assertion:&lt;BR /&gt;
&lt;BR /&gt;
  (apply 'not '(nil)) ----------&amp;gt; T&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &amp;gt; I also don't know where you got the idea that "apply&lt;BR /&gt;
&amp;gt; &amp;gt; is not meant to be used with unary operators" either.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Let's not get hung up on terminology. Regardless of how you want to term it,&lt;BR /&gt;
&amp;gt; apply will not operate correctly with NULL or NOT since they only accept one&lt;BR /&gt;
&amp;gt; argument. (apply 'not '(1 2 3)) is equivalent to (not 1 2 3) which is&lt;BR /&gt;
&amp;gt; clearly incorrect. If you can prove otherwise, I'll eat my hat.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
/*********************************************************/&lt;BR /&gt;
/*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
/* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
/* ----------------------------------------------------- */&lt;BR /&gt;
/*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
/*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
/*********************************************************/</description>
    <pubDate>Fri, 07 Jan 2000 00:43:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2000-01-07T00:43:36Z</dc:date>
    <item>
      <title>APPLY function problem/strangeness...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804834#M161526</link>
      <description>Amigos,&lt;BR /&gt;
&lt;BR /&gt;
I've come across the following AutoLISP strangeness/inconsistency in&lt;BR /&gt;
R14.01 and ADT2, and I was wondering if any of you could&lt;BR /&gt;
confirm/duplicate this behavior.  Or perhaps clue me in as to if/where&lt;BR /&gt;
this has been discussed before.&lt;BR /&gt;
&lt;BR /&gt;
I noticed it whilst trying to program a check on a list of strings to&lt;BR /&gt;
verify that no member is equivalent to "0" - but it seems that the&lt;BR /&gt;
problem lies on a deeper level than that.&lt;BR /&gt;
&lt;BR /&gt;
Here is a snip of my original function, which is supposed to take a&lt;BR /&gt;
string like "FR10.0/15.0", split it up, then check to make sure it is&lt;BR /&gt;
formatted correctly.  [The function STD-STRTOK splits up a string (in&lt;BR /&gt;
this case *FSM_STR*) based on a supplied delimeter (in this case the&lt;BR /&gt;
"/"), and returns a list containing the substrings...  IOW, (STD-STRTOK&lt;BR /&gt;
"10.0/15.0" "/") -&amp;gt; ("10.0" "15.0")] :&lt;BR /&gt;
&lt;BR /&gt;
(apply 'not (mapcar 'zerop (mapcar 'atof (STD-STRTOK (substr *FSM_STR*&lt;BR /&gt;
3) "/"))))))&lt;BR /&gt;
&lt;BR /&gt;
Perhaps there is a much better way to do this, but my point is that&lt;BR /&gt;
entire construct is throwing out some strange error messages...&lt;BR /&gt;
&lt;BR /&gt;
IOW, given any list: &lt;LST&gt;, I can't get:&lt;BR /&gt;
&lt;BR /&gt;
(apply 'not &lt;LST&gt;)&lt;BR /&gt;
&lt;BR /&gt;
to work in either R14.01 or ADT2&lt;BR /&gt;
&lt;BR /&gt;
However, if I use 'null, instead, as in:&lt;BR /&gt;
&lt;BR /&gt;
(apply 'null &lt;LST&gt;)&lt;BR /&gt;
&lt;BR /&gt;
this DOES work in R14.01 - but NOT in ADT2.  (?!)&lt;BR /&gt;
&lt;BR /&gt;
I thought that just in case the STDLIB functions might *possibly* have&lt;BR /&gt;
something to do with this, I decided to try it without them loaded up.&lt;BR /&gt;
As you can see below, this made no difference.&lt;BR /&gt;
&lt;BR /&gt;
Here are two snips from my command line&lt;BR /&gt;
(Tried immediately after starting fresh sessions of AutoCAD):&lt;BR /&gt;
&lt;BR /&gt;
----------------------------------------------------------------&lt;BR /&gt;
R14.01 Command Line output:&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
Command: ARX&lt;BR /&gt;
&lt;BR /&gt;
?/Load/Unload/Commands/Options: ?&lt;BR /&gt;
&lt;BR /&gt;
Loaded Runtime Extension Programs:&lt;BR /&gt;
&lt;BR /&gt;
    acadapp.arx&lt;BR /&gt;
    acmted.arx&lt;BR /&gt;
    autocell.arx&lt;BR /&gt;
    doslib14.arx&lt;BR /&gt;
    livetext.arx&lt;BR /&gt;
    oleaprot.arx&lt;BR /&gt;
    qpik14.arx&lt;BR /&gt;
    toolr14.arx&lt;BR /&gt;
&lt;BR /&gt;
End of List.&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NOT '(1 2 3 4 5))&lt;BR /&gt;
error: too many arguments&lt;BR /&gt;
(NOT (&lt;&gt; 1) (&lt;&gt; 2) (&lt;&gt; 3)&lt;BR /&gt;
(&lt;&gt;&lt;BR /&gt;
#28f3e40&amp;gt; 4) (&lt;&gt; 5))&lt;BR /&gt;
(APPLY (QUOTE NOT) (QUOTE (1 2 3 4 5)))&lt;BR /&gt;
*Cancel*&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NOT (list 1 2 3 4 5))&lt;BR /&gt;
error: too many arguments&lt;BR /&gt;
(NOT (&lt;&gt; 1) (&lt;&gt; 2) (&lt;&gt; 3)&lt;BR /&gt;
(&lt;&gt;&lt;BR /&gt;
#28f3e40&amp;gt; 4) (&lt;&gt; 5))&lt;BR /&gt;
(APPLY (QUOTE NOT) (LIST 1 2 3 4 5))&lt;BR /&gt;
*Cancel*&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NULL '(1 2 3 4 5))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NULL '(nil nil nil nil nil))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'AND '(1 2 3 4 5))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'AND '(1 NIL 3 4 5))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'OR '(1 NIL 3 4 5))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'OR '(NIL NIL NIL NIL NLI))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
----------------------------------------------------------------&lt;BR /&gt;
ADT2 Command Line output:&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
Command: arx&lt;BR /&gt;
&lt;BR /&gt;
Enter an option [?/Load/Unload/Commands/Options]: ?&lt;BR /&gt;
&lt;BR /&gt;
Loaded Runtime Extension Programs:&lt;BR /&gt;
&lt;BR /&gt;
    acadapp.arx  - MDI Aware.&lt;BR /&gt;
    acdim.arx  - MDI Aware.&lt;BR /&gt;
    aceplotx.arx  - MDI Aware.&lt;BR /&gt;
    acetutil.arx  - MDI Aware.&lt;BR /&gt;
    achapi15.dbx  - MDI Aware.&lt;BR /&gt;
    achlnkui.arx  - MDI Aware.&lt;BR /&gt;
    aecstartup.arx  - MDI Aware.&lt;BR /&gt;
    appload.arx  - MDI Aware.&lt;BR /&gt;
    doslib2k.arx  - MDI Aware.&lt;BR /&gt;
    modemacro.arx  - MDI Aware.&lt;BR /&gt;
    oleaprot.arx  - MDI Aware.&lt;BR /&gt;
    qpik15.arx  - MDI Aware.&lt;BR /&gt;
    stdlib15.arx  - MDI Aware.&lt;BR /&gt;
    vl.arx  - MDI Aware.&lt;BR /&gt;
&lt;BR /&gt;
End of List.&lt;BR /&gt;
&lt;BR /&gt;
Command: arx&lt;BR /&gt;
&lt;BR /&gt;
Enter an option [?/Load/Unload/Commands/Options]: u&lt;BR /&gt;
&lt;BR /&gt;
Enter ARX/DBX file name to unload:  stdlib15.arx&lt;BR /&gt;
&lt;BR /&gt;
stdlib15.arx successfully unloaded.&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NOT '(1 2 3 4 5))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NOT (list 1 2 3 4 5))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NULL '(1 2 3 4 5))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'NULL '(nil nil nil nil nil))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'AND '(1 2 3 4 5))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'AND '(1 nil 3 4 5))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'OR '(1 nil 3 4 5))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'OR '(nil nil nil nil nil))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
----------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
This is really weird;  (apply 'and... , as well as (apply 'or... ,&lt;BR /&gt;
both work as I would expect, but not (apply 'not...  [as well as (apply&lt;BR /&gt;
'null... in ADT2)]&lt;BR /&gt;
&lt;BR /&gt;
BTW, my 'puter OS is WinNT4.0 SP4, FWIW, and I'm using a plenty good&lt;BR /&gt;
machine w/ plenty o' memory for this paltry exercise.&lt;BR /&gt;
&lt;BR /&gt;
So, first of all, can anyone duplicate/very this behavior?&lt;BR /&gt;
&lt;BR /&gt;
Is it possible that the problem could be related to one of the other&lt;BR /&gt;
third party programs I'm using?&lt;BR /&gt;
(I truly hope that this isn't the case.)  Perhaps NOT (and NULL) have&lt;BR /&gt;
been setq redefined somehow/somewhere?  [I'm 99.999% certain my own&lt;BR /&gt;
programs have not done this.]&lt;BR /&gt;
&lt;BR /&gt;
If this is indeed an AutoCAD/AutoLISP bug, does anyone have a good&lt;BR /&gt;
simple workaround for this?&lt;BR /&gt;
&lt;BR /&gt;
Sorry for the long post, but I hope I have explained this sufficiently&lt;BR /&gt;
well.&lt;BR /&gt;
&lt;BR /&gt;
Appreciative of any assistance/feedback tracking down this problemo,&lt;BR /&gt;
David Kozina&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/LST&gt;&lt;/LST&gt;&lt;/LST&gt;</description>
      <pubDate>Wed, 05 Jan 2000 23:12:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804834#M161526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-05T23:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: APPLY function problem/strangeness...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804835#M161527</link>
      <description>So can anyone tell me what their R14 or AutoCAD 2000&lt;BR /&gt;
Command Line outputs after each of the following inputs?:&lt;BR /&gt;
&lt;BR /&gt;
(apply 'not '(1 2 3))&lt;BR /&gt;
&lt;BR /&gt;
(apply 'null '(1 2 3))&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
David Kozina</description>
      <pubDate>Thu, 06 Jan 2000 16:02:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804835#M161527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T16:02:21Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804836#M161528</link>
      <description>David Kozina escribió en mensaje &amp;lt;852e6h$9o320@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&amp;gt;So can anyone tell me what their R14 or AutoCAD 2000&lt;BR /&gt;
&amp;gt;Command Line outputs after each of the following inputs?:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;(apply 'not '(1 2 3))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;(apply 'null '(1 2 3))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&lt;BR /&gt;
Acad 2000 (Plain _VERNUM = "T.0.98")&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'not '(1 2 3))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(1 2 3))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
-------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Acad 2000 (included with MDT 4.0 ; _VERNUM = "T.1.33")&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'not '(1 2 3))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(1 2 3))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
MDT 4.0 (_VERNUM = "T.1.33")&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'not '(1 2 3))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(1 2 3))&lt;BR /&gt;
; error: too many arguments&lt;BR /&gt;
&lt;BR /&gt;
---------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Acad 14 (Spanish ; _VERNUM = "S.0.80" )&lt;BR /&gt;
&lt;BR /&gt;
Comando: (apply 'not '(1 2 3))&lt;BR /&gt;
error: demasiados argumentos&lt;BR /&gt;
(NOT (&lt;&gt; 1) (&lt;&gt; 2) (&lt;&gt; 3))&lt;BR /&gt;
(APPLY (QUOTE NOT) (QUOTE (1 2 3)))&lt;BR /&gt;
*Cancelar*&lt;BR /&gt;
&lt;BR /&gt;
Comando: (apply 'null '(1 2 3))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Eduardo Muñoz&lt;/&gt;&lt;/&gt;&lt;/&gt;</description>
      <pubDate>Thu, 06 Jan 2000 16:14:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804836#M161528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T16:14:35Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804837#M161529</link>
      <description>I keep getting "too many arguments" but it is easily fixed by enclosing your&lt;BR /&gt;
list in TWO sets of parens:&lt;BR /&gt;
&lt;BR /&gt;
(apply 'not '((1 2 3)))&lt;BR /&gt;
(apply 'null '((1 2 3)))&lt;BR /&gt;
&lt;BR /&gt;
"David Kozina" &lt;DJKOZINA&gt; wrote in message&lt;BR /&gt;
news:852e6h$9o320@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; So can anyone tell me what their R14 or AutoCAD 2000&lt;BR /&gt;
&amp;gt; Command Line outputs after each of the following inputs?:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (apply 'not '(1 2 3))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (apply 'null '(1 2 3))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; David Kozina&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/DJKOZINA&gt;</description>
      <pubDate>Thu, 06 Jan 2000 16:44:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804837#M161529</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T16:44:17Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804838#M161530</link>
      <description>Frank, I think what he is trying to do is get a T when an atom in a list is&lt;BR /&gt;
nil. By nesting the list within another one, he never gets that test. I&lt;BR /&gt;
think I see what he is getting at.&lt;BR /&gt;
&lt;BR /&gt;
If you do an (apply 'and '(1 2)) you get T, expected behavior.&lt;BR /&gt;
If you do an (apply '+ '(1 2)) you get 3, expected behavior.&lt;BR /&gt;
&lt;BR /&gt;
If you do an (apply 'null '(1 2)) you get error: too many arguments, _why_?&lt;BR /&gt;
&lt;BR /&gt;
I think this is a good question. This should be a simple way to test valid&lt;BR /&gt;
atoms in a list, _if it worked_. How would you perform this test yourself?&lt;BR /&gt;
--&lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
Network Administrator &amp;amp; Top Gun&lt;BR /&gt;
(remove the not. for e-mail)&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo &lt;FRANKO&gt; wrote in message&lt;BR /&gt;
news:852h0a$bq31@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; I keep getting "too many arguments" but it is easily fixed by enclosing&lt;BR /&gt;
your&lt;BR /&gt;
&amp;gt; list in TWO sets of parens:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (apply 'not '((1 2 3)))&lt;BR /&gt;
&amp;gt; (apply 'null '((1 2 3)))&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; "David Kozina" &lt;DJKOZINA&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:852e6h$9o320@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; &amp;gt; So can anyone tell me what their R14 or AutoCAD 2000&lt;BR /&gt;
&amp;gt; &amp;gt; Command Line outputs after each of the following inputs?:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (apply 'not '(1 2 3))&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (apply 'null '(1 2 3))&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; Thanks,&lt;BR /&gt;
&amp;gt; &amp;gt; David Kozina&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;&lt;/DJKOZINA&gt;&lt;/FRANKO&gt;</description>
      <pubDate>Thu, 06 Jan 2000 17:08:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804838#M161530</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T17:08:56Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804839#M161531</link>
      <description>The why of the matter was so simple, I chided myself for missing it. Apply&lt;BR /&gt;
is not meant to be used with unary operators. + as well as AND expect&lt;BR /&gt;
mutiple operands. NOT and NULL expect only one. Here's a little routine to&lt;BR /&gt;
indicate whether a list contains one or more nil values:&lt;BR /&gt;
&lt;BR /&gt;
(defun ContainsNil (lst / item retVal)&lt;BR /&gt;
  (foreach item lst&lt;BR /&gt;
    (if (not item) (setq retVal T))&lt;BR /&gt;
  )&lt;BR /&gt;
  retVal&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
"R. Robert Bell" &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
news:852ia5$bq53@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Frank, I think what he is trying to do is get a T when an atom in a list&lt;BR /&gt;
is&lt;BR /&gt;
&amp;gt; nil. By nesting the list within another one, he never gets that test. I&lt;BR /&gt;
&amp;gt; think I see what he is getting at.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; If you do an (apply 'and '(1 2)) you get T, expected behavior.&lt;BR /&gt;
&amp;gt; If you do an (apply '+ '(1 2)) you get 3, expected behavior.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; If you do an (apply 'null '(1 2)) you get error: too many arguments,&lt;BR /&gt;
_why_?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I think this is a good question. This should be a simple way to test valid&lt;BR /&gt;
&amp;gt; atoms in a list, _if it worked_. How would you perform this test yourself?&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator &amp;amp; Top Gun&lt;BR /&gt;
&amp;gt; (remove the not. for e-mail)&lt;/NOT.ROBERTB&gt;</description>
      <pubDate>Thu, 06 Jan 2000 17:42:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804839#M161531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T17:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: APPLY function problem/strangeness...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804840#M161532</link>
      <description>In r14 both (not item) and (null item) are supposed to accept only one&lt;BR /&gt;
argument.&lt;BR /&gt;
(null) doesn't return an error when supplied with more than one argument (is&lt;BR /&gt;
it bug?), but evaluates only the first one.&lt;BR /&gt;
&lt;BR /&gt;
So, I wouldn't use (apply 'null [or 'not] list) in the first place.&lt;BR /&gt;
&lt;BR /&gt;
to check for zeroes in the list, I would use&lt;BR /&gt;
(apply 'or (mapcar 'zerop numlist))&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
Adi Buturovic&lt;BR /&gt;
af.buturovic@berwanger.com&lt;BR /&gt;
****************************************&lt;BR /&gt;
Berwanger Inc. is not responsible for any opinion, recommendation,&lt;BR /&gt;
solicitation, offer or agreement or any information contained in this&lt;BR /&gt;
communication.&lt;BR /&gt;
&lt;BR /&gt;
David Kozina &lt;DJKOZINA&gt; wrote in message&lt;BR /&gt;
news:850j2l$7gc7@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Amigos,&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I've come across the following AutoLISP strangeness/inconsistency in&lt;BR /&gt;
&amp;gt; R14.01 and ADT2, and I was wondering if any of you could&lt;BR /&gt;
&amp;gt; confirm/duplicate this behavior.  Or perhaps clue me in as to if/where&lt;BR /&gt;
&amp;gt; this has been discussed before.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I noticed it whilst trying to program a check on a list of strings to&lt;BR /&gt;
&amp;gt; verify that no member is equivalent to "0" - but it seems that the&lt;BR /&gt;
&amp;gt; problem lies on a deeper level than that.&lt;BR /&gt;
[snip]&lt;/DJKOZINA&gt;</description>
      <pubDate>Thu, 06 Jan 2000 17:54:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804840#M161532</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T17:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: APPLY function problem/strangeness...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804841#M161533</link>
      <description>Haven't seen you in a while. Did you Enjoy the holidays?&lt;BR /&gt;
&lt;BR /&gt;
"Michael Puckett" &lt;PUCKETTM&gt; wrote in message&lt;BR /&gt;
news:852l39$bq413@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; or ...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun HasNil (lst)&lt;BR /&gt;
&amp;gt;   (apply 'or (mapcar 'null lst))&lt;BR /&gt;
&amp;gt; )&lt;/PUCKETTM&gt;</description>
      <pubDate>Thu, 06 Jan 2000 17:55:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804841#M161533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T17:55:29Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804842#M161534</link>
      <description>or ...&lt;BR /&gt;
&lt;BR /&gt;
(defun HasNil (lst)&lt;BR /&gt;
  (apply 'or (mapcar 'null lst))&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
________________________________&lt;BR /&gt;
&lt;BR /&gt;
puckettm@bantrel.com&lt;BR /&gt;
&amp;gt; Not &amp;lt; an AutoDESK classroom monitor&lt;BR /&gt;
Imagination makes all things possible&lt;BR /&gt;
________________________________&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote in message &amp;lt;852kdq$bq310@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
The why of the matter was so simple, I chided myself for missing it. Apply&lt;BR /&gt;
is not meant to be used with unary operators. + as well as AND expect&lt;BR /&gt;
mutiple operands. NOT and NULL expect only one. Here's a little routine to&lt;BR /&gt;
indicate whether a list contains one or more nil values:&lt;BR /&gt;
&lt;BR /&gt;
(defun ContainsNil (lst / item retVal)&lt;BR /&gt;
  (foreach item lst&lt;BR /&gt;
    (if (not item) (setq retVal T))&lt;BR /&gt;
  )&lt;BR /&gt;
  retVal&lt;BR /&gt;
)</description>
      <pubDate>Thu, 06 Jan 2000 17:56:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804842#M161534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T17:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: APPLY function problem/strangeness...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804843#M161535</link>
      <description>David Kozina wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I've come across the following AutoLISP strangeness/inconsistency in&lt;BR /&gt;
&amp;gt; R14.01 and ADT2 ...&lt;BR /&gt;
&lt;BR /&gt;
You've uncovered a difference between AutoLISP and Visual LISP, which might&lt;BR /&gt;
be considered a defect in AL.&lt;BR /&gt;
&lt;BR /&gt;
There are a number of AL functions which are defined as taking one&lt;BR /&gt;
argument, but do not complain if additional arguments are supplied.&lt;BR /&gt;
'(null)' is one such function.&lt;BR /&gt;
&lt;BR /&gt;
When you write:&lt;BR /&gt;
&lt;BR /&gt;
  (apply 'null '(nil T))&lt;BR /&gt;
&lt;BR /&gt;
you are actually evaluating:&lt;BR /&gt;
&lt;BR /&gt;
  (null nil T)&lt;BR /&gt;
&lt;BR /&gt;
In AL the NIL argument will be evaluated (returning T) and the T argument&lt;BR /&gt;
will be ignored.  In VL you will receive a "too many arguments" error.&lt;BR /&gt;
&lt;BR /&gt;
Given that your:&lt;BR /&gt;
&lt;BR /&gt;
  (mapcar 'zerop ...)&lt;BR /&gt;
&lt;BR /&gt;
code returns a list of NIL or T values and any T value indicates an invalid&lt;BR /&gt;
value, you should use:&lt;BR /&gt;
&lt;BR /&gt;
  (not (apply 'or (mapcar 'zerop ...)))&lt;BR /&gt;
--&lt;BR /&gt;
Frank Whaley&lt;BR /&gt;
Autodesk, Inc.&lt;BR /&gt;
few@autodesk.com&lt;BR /&gt;
http://www.autodesk.com/expresstools&lt;BR /&gt;
Express Tools - Your wish is our (command ...)</description>
      <pubDate>Thu, 06 Jan 2000 18:01:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804843#M161535</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T18:01:57Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804844#M161536</link>
      <description>Yes, thanks; hope yours was good.&lt;BR /&gt;
&lt;BR /&gt;
Been way buzy with web development and haven't been able to play here for weeks; kind of miss this&lt;BR /&gt;
place.&lt;BR /&gt;
&lt;BR /&gt;
________________________________&lt;BR /&gt;
&lt;BR /&gt;
puckettm@bantrel.com&lt;BR /&gt;
&amp;gt; Not &amp;lt; an AutoDESK classroom monitor&lt;BR /&gt;
Imagination makes all things possible&lt;BR /&gt;
________________________________&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote in message &amp;lt;852l5r$bq312@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
Haven't seen you in a while. Did you Enjoy the holidays?&lt;BR /&gt;
&lt;BR /&gt;
"Michael Puckett" &lt;PUCKETTM&gt; wrote in message&lt;BR /&gt;
news:852l39$bq413@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; or ...&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (defun HasNil (lst)&lt;BR /&gt;
&amp;gt;   (apply 'or (mapcar 'null lst))&lt;BR /&gt;
&amp;gt; )&lt;/PUCKETTM&gt;</description>
      <pubDate>Thu, 06 Jan 2000 18:02:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804844#M161536</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T18:02:28Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804845#M161537</link>
      <description>Well, fellas,&lt;BR /&gt;
&lt;BR /&gt;
(I'm writing this before I see any additional responses to Robert Bell's&lt;BR /&gt;
post)&lt;BR /&gt;
&lt;BR /&gt;
First of all, thanks for verifying this.&lt;BR /&gt;
Now I'm wondering just what I'm actually trying to do, heh.  &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Maybe this particular kind of test simply makes no sense.&lt;BR /&gt;
(Wouldn't be the first time!)&lt;BR /&gt;
&lt;BR /&gt;
BTW, I tried a couple of other tests using 'null in R14...&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(1 2 3 4 5))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(1 nil 3 4 5))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(nil nil 3 4 5))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (apply 'null '(nil 3 4 5))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
It seems obvious now that whatever I'm testing for shouldn't be done&lt;BR /&gt;
this way!&lt;BR /&gt;
Apparently, only the *first* member of the list is checked.  And even&lt;BR /&gt;
this doesn't work in ADT2.&lt;BR /&gt;
&lt;BR /&gt;
What I was looking for was a simple test to check if *any* of the&lt;BR /&gt;
members in a number list evaluated to zero, and if so, return nil, so&lt;BR /&gt;
that the subroutine would loop until all members were not zero, so it&lt;BR /&gt;
looks like maybe I just need to turn things around a bit and use this&lt;BR /&gt;
test, instead:&lt;BR /&gt;
&lt;BR /&gt;
(not (apply 'or (mapcar 'zerop &lt;LST&gt;)))&lt;BR /&gt;
&lt;BR /&gt;
So that...&lt;BR /&gt;
&lt;BR /&gt;
Command: (not (apply 'or (mapcar 'zerop '(1 2 3 4))))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
Command: (not (apply 'or (mapcar 'zerop '(1 2 0 4))))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (not (apply 'or (mapcar 'zerop '(0 2 2 4))))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (not (apply 'or (mapcar 'zerop '(2 2 4 0))))&lt;BR /&gt;
nil&lt;BR /&gt;
&lt;BR /&gt;
Command: (not (apply 'or (mapcar 'zerop '(2 2 4 7))))&lt;BR /&gt;
T&lt;BR /&gt;
&lt;BR /&gt;
This accomplishes what I need to do.&lt;BR /&gt;
&lt;BR /&gt;
Again, thanks for your responses.&lt;BR /&gt;
&lt;BR /&gt;
Still trying to work on my logic,&lt;BR /&gt;
David Kozina&lt;BR /&gt;
&lt;BR /&gt;
PS.  Now before posting this, I see several other replys...  I thought&lt;BR /&gt;
so...&lt;BR /&gt;
Thanks for helping me clear this up, everyone.&lt;BR /&gt;
&lt;BR /&gt;
R. Robert Bell &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
news:852ia5$bq53@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; Frank, I think what he is trying to do is get a T when an atom in a&lt;BR /&gt;
list is&lt;BR /&gt;
&amp;gt; nil. By nesting the list within another one, he never gets that test.&lt;BR /&gt;
I&lt;BR /&gt;
&amp;gt; think I see what he is getting at.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; If you do an (apply 'and '(1 2)) you get T, expected behavior.&lt;BR /&gt;
&amp;gt; If you do an (apply '+ '(1 2)) you get 3, expected behavior.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; If you do an (apply 'null '(1 2)) you get error: too many arguments,&lt;BR /&gt;
_why_?&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I think this is a good question. This should be a simple way to test&lt;BR /&gt;
valid&lt;BR /&gt;
&amp;gt; atoms in a list, _if it worked_. How would you perform this test&lt;BR /&gt;
yourself?&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; Network Administrator &amp;amp; Top Gun&lt;BR /&gt;
&amp;gt; (remove the not. for e-mail)&lt;/NOT.ROBERTB&gt;&lt;/LST&gt;</description>
      <pubDate>Thu, 06 Jan 2000 18:36:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804845#M161537</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T18:36:39Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804846#M161538</link>
      <description>David Kozina escribió en mensaje &amp;lt;852n84$bq79@adesknews2.autodesk.com&amp;gt;...&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;BR /&gt;
&amp;gt;What I was looking for was a simple test to check if *any* of the&lt;BR /&gt;
&amp;gt;members in a number list evaluated to zero, and if so, return nil, so&lt;BR /&gt;
&amp;gt;that the subroutine would loop until all members were not zero, so it&lt;BR /&gt;
&amp;gt;looks like maybe I just need to turn things around a bit and use this&lt;BR /&gt;
&amp;gt;test, instead:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;(not (apply 'or (mapcar 'zerop &lt;LST&gt;)))&lt;BR /&gt;
&lt;BR /&gt;
[...]&lt;BR /&gt;
&lt;BR /&gt;
well... the apply mapcar thing is 'cute'&lt;BR /&gt;
but what about this?&lt;BR /&gt;
&lt;BR /&gt;
(while (member 0 '(1 2 3 0 ))&lt;BR /&gt;
    (do_stuff)&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
The trees don't let you see the forest?  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
Eduardo Muñoz&lt;/LST&gt;</description>
      <pubDate>Thu, 06 Jan 2000 19:39:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804846#M161538</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T19:39:13Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804847#M161539</link>
      <description>Hola Eduardo,&lt;BR /&gt;
&lt;BR /&gt;
Well, it all depends on when where and what you're trying to do, I guess...&lt;BR /&gt;
In this case, in fact, the test happened to be part of a larger test all tied together by an&lt;BR /&gt;
(and... statement so I needed a T or nil response for that particular test.&lt;BR /&gt;
&lt;BR /&gt;
However, the larger test was indeed wrapped inside a (while... loop&lt;BR /&gt;
(variables have additional prefixes in the actual program)&lt;BR /&gt;
Don't know how efficient it is, but it's ended up like so...&lt;BR /&gt;
(MS Outlook is probably going to word wrap this into a mess, I'm afraid,&lt;BR /&gt;
but I hope you get the idea, anyway)&lt;BR /&gt;
&lt;BR /&gt;
...&lt;BR /&gt;
(while (and (not STR_OK) CONT_FLG)                                 ; CONT_FLG from earlier test&lt;BR /&gt;
  (setq *STR*  (cond ((and *STR*                                   ; *STR* already exist?&lt;BR /&gt;
                           (STRINGP *STR*)                         ; String?&lt;BR /&gt;
                           (wcmatch (substr *STR* 1 2) "FC,FS,FR") ; Good Prefix?&lt;BR /&gt;
                           (STD-NUMBER-LIST-P                      ; Number(s) in the Suffix?&lt;BR /&gt;
                             (mapcar&lt;BR /&gt;
                               'atof&lt;BR /&gt;
                               (setq STRLST (STD-STRTOK (substr *STR* 3) "/")))))&lt;BR /&gt;
                           (strcat                                 ; If so, then increase&lt;BR /&gt;
value(s)...&lt;BR /&gt;
                             (substr *STR* 1 2)                    ;   and see how well I can guess&lt;BR /&gt;
                             (STD-STRLIST-&amp;gt;STRING                  ;   the next value...&lt;BR /&gt;
                                (mapcar '(lambda (STR) (rtos (+ 0.5 (atof STR)) 2 1)) STRLST)&lt;BR /&gt;
"/"))))&lt;BR /&gt;
        *STR*  (ABE-G$ "Enter Mark Name" *STR* "FC2.0")            ; Get String - *STR* is the&lt;BR /&gt;
default&lt;BR /&gt;
        STR_OK (cond ((wcmatch *STR* ""))                          ; Quit? -&amp;gt; T&lt;BR /&gt;
                     ((and (wcmatch (substr *STR* 1 2) "FC,FS,FR") ; Check Prefix again...&lt;BR /&gt;
                           (STD-NUMBER-LIST-P                      ; Number(s) in the Suffix?&lt;BR /&gt;
                             (mapcar                               ; ... If format turns out OK -&amp;gt; T&lt;BR /&gt;
                               'atof&lt;BR /&gt;
                               (setq STRLST (STD-STRTOK (substr *STR* 3) "/"))))&lt;BR /&gt;
                           (not (apply 'or (mapcar 'zerop (mapcar 'atof STRLST)))))) ; &amp;lt;- Look&lt;BR /&gt;
familiar?&lt;BR /&gt;
                     (T                                            ; NO GOOD! Bad Format! BAD I say!&lt;BR /&gt;
                      (prompt                                      ; -&amp;gt; nil&lt;BR /&gt;
                        (strcat "\n**Invalid Mark Name Value or Format, please try again.**"&lt;BR /&gt;
                                "\n[Format Style: FC#, FS#, or FR#/#]"))&lt;BR /&gt;
                      (setq *STR* nil)))))&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
Best regards,&lt;BR /&gt;
David Kozina</description>
      <pubDate>Thu, 06 Jan 2000 22:00:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804847#M161539</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T22:00:52Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804848#M161540</link>
      <description>I don't know why you need to go through all of that to&lt;BR /&gt;
detect a nil element in a list.&lt;BR /&gt;
&lt;BR /&gt;
(apply 'and &lt;LIST&gt;) returns T if no element in &lt;LIST&gt; is nil.&lt;BR /&gt;
&lt;BR /&gt;
I also don't know where you got the idea that "apply&lt;BR /&gt;
is not meant to be used with unary operators" either.&lt;BR /&gt;
&lt;BR /&gt;
There are no such thing as "operators" in LISP. The&lt;BR /&gt;
apply function cannot be used with special forms&lt;BR /&gt;
(functions that don't evaluate one or several of their &lt;BR /&gt;
arguments, such as defun, setq, if, and so on).&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; The why of the matter was so simple, I chided myself for missing it. Apply&lt;BR /&gt;
&amp;gt; is not meant to be used with unary operators. + as well as AND expect&lt;BR /&gt;
&amp;gt; mutiple operands. NOT and NULL expect only one. Here's a little routine to&lt;BR /&gt;
&amp;gt; indicate whether a list contains one or more nil values:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; (defun ContainsNil (lst / item retVal)&lt;BR /&gt;
&amp;gt;   (foreach item lst&lt;BR /&gt;
&amp;gt;     (if (not item) (setq retVal T))&lt;BR /&gt;
&amp;gt;   )&lt;BR /&gt;
&amp;gt;   retVal&lt;BR /&gt;
&amp;gt; )&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; "R. Robert Bell" &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:852ia5$bq53@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; &amp;gt; Frank, I think what he is trying to do is get a T when an atom in a list&lt;BR /&gt;
&amp;gt; is&lt;BR /&gt;
&amp;gt; &amp;gt; nil. By nesting the list within another one, he never gets that test. I&lt;BR /&gt;
&amp;gt; &amp;gt; think I see what he is getting at.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; If you do an (apply 'and '(1 2)) you get T, expected behavior.&lt;BR /&gt;
&amp;gt; &amp;gt; If you do an (apply '+ '(1 2)) you get 3, expected behavior.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; If you do an (apply 'null '(1 2)) you get error: too many arguments,&lt;BR /&gt;
&amp;gt; _why_?&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; I think this is a good question. This should be a simple way to test valid&lt;BR /&gt;
&amp;gt; &amp;gt; atoms in a list, _if it worked_. How would you perform this test yourself?&lt;BR /&gt;
&amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; &amp;gt; Network Administrator &amp;amp; Top Gun&lt;BR /&gt;
&amp;gt; &amp;gt; (remove the not. for e-mail)&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
/*********************************************************/&lt;BR /&gt;
/*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
/* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
/* ----------------------------------------------------- */&lt;BR /&gt;
/*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
/*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
/*********************************************************/&lt;/NOT.ROBERTB&gt;&lt;/LIST&gt;&lt;/LIST&gt;</description>
      <pubDate>Thu, 06 Jan 2000 22:44:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804848#M161540</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T22:44:45Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804849#M161541</link>
      <description>&amp;gt; I also don't know where you got the idea that "apply&lt;BR /&gt;
&amp;gt; is not meant to be used with unary operators" either.&lt;BR /&gt;
&lt;BR /&gt;
Let's not get hung up on terminology. Regardless of how you want to term it,&lt;BR /&gt;
apply will not operate correctly with NULL or NOT since they only accept one&lt;BR /&gt;
argument. (apply 'not '(1 2 3)) is equivalent to (not 1 2 3) which is&lt;BR /&gt;
clearly incorrect. If you can prove otherwise, I'll eat my hat.</description>
      <pubDate>Thu, 06 Jan 2000 22:46:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804849#M161541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T22:46:49Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804850#M161542</link>
      <description>Bravo, Tony, for a simple test. Funny, while I was playing with the (apply&lt;BR /&gt;
'and . . .) that I didn't glom on to that!&lt;BR /&gt;
&lt;BR /&gt;
--&lt;BR /&gt;
R. Robert Bell, MCSE&lt;BR /&gt;
Network Administrator &amp;amp; Top Gun&lt;BR /&gt;
(remove the not. for e-mail)&lt;BR /&gt;
&lt;BR /&gt;
Tony Tanzillo &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:38751ADD.731270D8@worldnet.att.net...&lt;BR /&gt;
&amp;gt; I don't know why you need to go through all of that to&lt;BR /&gt;
&amp;gt; detect a nil element in a list.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; (apply 'and &lt;LIST&gt;) returns T if no element in &lt;LIST&gt; is nil.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; I also don't know where you got the idea that "apply&lt;BR /&gt;
&amp;gt; is not meant to be used with unary operators" either.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; There are no such thing as "operators" in LISP. The&lt;BR /&gt;
&amp;gt; apply function cannot be used with special forms&lt;BR /&gt;
&amp;gt; (functions that don't evaluate one or several of their&lt;BR /&gt;
&amp;gt; arguments, such as defun, setq, if, and so on).&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; Frank Oquendo wrote:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; The why of the matter was so simple, I chided myself for missing it.&lt;BR /&gt;
Apply&lt;BR /&gt;
&amp;gt; &amp;gt; is not meant to be used with unary operators. + as well as AND expect&lt;BR /&gt;
&amp;gt; &amp;gt; mutiple operands. NOT and NULL expect only one. Here's a little routine&lt;BR /&gt;
to&lt;BR /&gt;
&amp;gt; &amp;gt; indicate whether a list contains one or more nil values:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; (defun ContainsNil (lst / item retVal)&lt;BR /&gt;
&amp;gt; &amp;gt;   (foreach item lst&lt;BR /&gt;
&amp;gt; &amp;gt;     (if (not item) (setq retVal T))&lt;BR /&gt;
&amp;gt; &amp;gt;   )&lt;BR /&gt;
&amp;gt; &amp;gt;   retVal&lt;BR /&gt;
&amp;gt; &amp;gt; )&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; "R. Robert Bell" &lt;NOT.ROBERTB&gt; wrote in message&lt;BR /&gt;
&amp;gt; &amp;gt; news:852ia5$bq53@adesknews2.autodesk.com...&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Frank, I think what he is trying to do is get a T when an atom in a&lt;BR /&gt;
list&lt;BR /&gt;
&amp;gt; &amp;gt; is&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; nil. By nesting the list within another one, he never gets that test.&lt;BR /&gt;
I&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; think I see what he is getting at.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; If you do an (apply 'and '(1 2)) you get T, expected behavior.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; If you do an (apply '+ '(1 2)) you get 3, expected behavior.&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; If you do an (apply 'null '(1 2)) you get error: too many arguments,&lt;BR /&gt;
&amp;gt; &amp;gt; _why_?&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; I think this is a good question. This should be a simple way to test&lt;BR /&gt;
valid&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; atoms in a list, _if it worked_. How would you perform this test&lt;BR /&gt;
yourself?&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; --&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; R. Robert Bell, MCSE&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; Network Administrator &amp;amp; Top Gun&lt;BR /&gt;
&amp;gt; &amp;gt; &amp;gt; (remove the not. for e-mail)&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; --&lt;BR /&gt;
&amp;gt; /*********************************************************/&lt;BR /&gt;
&amp;gt; /*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
&amp;gt; /* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
&amp;gt; /* ----------------------------------------------------- */&lt;BR /&gt;
&amp;gt; /*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
&amp;gt; /*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
&amp;gt; /*********************************************************/&lt;/NOT.ROBERTB&gt;&lt;/LIST&gt;&lt;/LIST&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 06 Jan 2000 23:41:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804850#M161542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-06T23:41:12Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804851#M161543</link>
      <description>Regardless of how you try to spin this, you are wrong.&lt;BR /&gt;
&lt;BR /&gt;
The statement "apply is not meant to be used with unary &lt;BR /&gt;
operators" is wrong, regardless of whether one accepts &lt;BR /&gt;
your contorted description of a function that takes only &lt;BR /&gt;
a single argument ('unary operator'), or not.&lt;BR /&gt;
&lt;BR /&gt;
The fact of the matter is that (apply) can be used&lt;BR /&gt;
with what you call 'unary operators' (such as the&lt;BR /&gt;
NOT function), but if you supply the wrong number of&lt;BR /&gt;
arguments in the list, than it is no different than&lt;BR /&gt;
calling NOT directly, with the wrong number of arguments.&lt;BR /&gt;
&lt;BR /&gt;
This completely refutes your assertion:&lt;BR /&gt;
&lt;BR /&gt;
  (apply 'not '(nil)) ----------&amp;gt; T&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; &amp;gt; I also don't know where you got the idea that "apply&lt;BR /&gt;
&amp;gt; &amp;gt; is not meant to be used with unary operators" either.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Let's not get hung up on terminology. Regardless of how you want to term it,&lt;BR /&gt;
&amp;gt; apply will not operate correctly with NULL or NOT since they only accept one&lt;BR /&gt;
&amp;gt; argument. (apply 'not '(1 2 3)) is equivalent to (not 1 2 3) which is&lt;BR /&gt;
&amp;gt; clearly incorrect. If you can prove otherwise, I'll eat my hat.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
/*********************************************************/&lt;BR /&gt;
/*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
/* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
/* ----------------------------------------------------- */&lt;BR /&gt;
/*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
/*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
/*********************************************************/</description>
      <pubDate>Fri, 07 Jan 2000 00:43:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804851#M161543</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-07T00:43:36Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804852#M161544</link>
      <description>No one an ounce of common sense would feed a single member list to apply.&lt;BR /&gt;
Except maybe for someone trying to save face. Glad to have you back, Mr.&lt;BR /&gt;
Tanzillo.&lt;BR /&gt;
&lt;BR /&gt;
Tony Tanzillo &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:387536B8.7AD6D4C5@worldnet.att.net...&lt;BR /&gt;
&amp;gt; Regardless of how you try to spin this, you are wrong.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; The statement "apply is not meant to be used with unary&lt;BR /&gt;
&amp;gt; operators" is wrong, regardless of whether one accepts&lt;BR /&gt;
&amp;gt; your contorted description of a function that takes only&lt;BR /&gt;
&amp;gt; a single argument ('unary operator'), or not.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; The fact of the matter is that (apply) can be used&lt;BR /&gt;
&amp;gt; with what you call 'unary operators' (such as the&lt;BR /&gt;
&amp;gt; NOT function), but if you supply the wrong number of&lt;BR /&gt;
&amp;gt; arguments in the list, than it is no different than&lt;BR /&gt;
&amp;gt; calling NOT directly, with the wrong number of arguments.&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt; This completely refutes your assertion:&lt;BR /&gt;
&amp;gt;&lt;BR /&gt;
&amp;gt;   (apply 'not '(nil)) ----------&amp;gt; T&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 07 Jan 2000 03:21:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804852#M161544</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-07T03:21:31Z</dc:date>
    </item>
    <item>
      <title>Re:</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804853#M161545</link>
      <description>Frank - It appears that you now think you are infallable.&lt;BR /&gt;
&lt;BR /&gt;
Well, I'm sorry to have to be the one to deliver this&lt;BR /&gt;
massive blow to your overblown ego, but here again are&lt;BR /&gt;
your own words:&lt;BR /&gt;
&lt;BR /&gt;
"Regardless of how you want to term it, apply will not &lt;BR /&gt;
operate correctly with NULL or NOT since they only accept &lt;BR /&gt;
one argument."&lt;BR /&gt;
&lt;BR /&gt;
You are wrong. I just got done showing that apply does &lt;BR /&gt;
operate correctly with NOT, contrary to your statement.&lt;BR /&gt;
&lt;BR /&gt;
You are wrong, got that Frank? As much as you may not&lt;BR /&gt;
like it, you are wrong.&lt;BR /&gt;
&lt;BR /&gt;
Frank Oquendo wrote:&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; No one an ounce of common sense would feed a single member list to apply.&lt;BR /&gt;
&amp;gt; Except maybe for someone trying to save face. Glad to have you back, Mr.&lt;BR /&gt;
&amp;gt; Tanzillo.&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Tony Tanzillo &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
&amp;gt; news:387536B8.7AD6D4C5@worldnet.att.net...&lt;BR /&gt;
&amp;gt; &amp;gt; Regardless of how you try to spin this, you are wrong.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; The statement "apply is not meant to be used with unary&lt;BR /&gt;
&amp;gt; &amp;gt; operators" is wrong, regardless of whether one accepts&lt;BR /&gt;
&amp;gt; &amp;gt; your contorted description of a function that takes only&lt;BR /&gt;
&amp;gt; &amp;gt; a single argument ('unary operator'), or not.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; The fact of the matter is that (apply) can be used&lt;BR /&gt;
&amp;gt; &amp;gt; with what you call 'unary operators' (such as the&lt;BR /&gt;
&amp;gt; &amp;gt; NOT function), but if you supply the wrong number of&lt;BR /&gt;
&amp;gt; &amp;gt; arguments in the list, than it is no different than&lt;BR /&gt;
&amp;gt; &amp;gt; calling NOT directly, with the wrong number of arguments.&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt; This completely refutes your assertion:&lt;BR /&gt;
&amp;gt; &amp;gt;&lt;BR /&gt;
&amp;gt; &amp;gt;   (apply 'not '(nil)) ----------&amp;gt; T&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
/*********************************************************/&lt;BR /&gt;
/*    Tony Tanzillo     Design Automation Consulting     */&lt;BR /&gt;
/* Programming &amp;amp; Customization for AutoCAD &amp;amp; Compatibles */&lt;BR /&gt;
/* ----------------------------------------------------- */&lt;BR /&gt;
/*            tony.tanzillo@worldnet.att.net             */&lt;BR /&gt;
/*    http://ourworld.compuserve.com/homepages/tonyt     */&lt;BR /&gt;
/*********************************************************/&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 07 Jan 2000 04:18:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/apply-function-problem-strangeness/m-p/804853#M161545</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2000-01-07T04:18:32Z</dc:date>
    </item>
  </channel>
</rss>

