<?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: Return value of a lisp callable function in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159900#M75829</link>
    <description>Hello Daniel,&lt;BR /&gt;
&lt;BR /&gt;
Indeed, you and I  and many others in this newsgroup seem to find Tony's &lt;BR /&gt;
answers very  helpful &amp;amp; useful and so we say thank you and thanks again, &lt;BR /&gt;
which is only natural.&lt;BR /&gt;
&lt;BR /&gt;
Now, just imagine that for any reason on no reason at all, Tony stops &lt;BR /&gt;
posting here...&lt;BR /&gt;
&lt;BR /&gt;
What I mean is this: if AutoDesk is not going to produce decent &lt;BR /&gt;
documentation soon, or at least inform us when the aforementioned &lt;BR /&gt;
documentation will be forthcoming, then it would be unwise for those among &lt;BR /&gt;
us who are not in the know to go on inversting time in this .NET api thing.&lt;BR /&gt;
&lt;BR /&gt;
Could be that's exactly wat they want. There may be more money in it for &lt;BR /&gt;
them that way. !?&lt;BR /&gt;
I think I can smell a rat here...&lt;BR /&gt;
&lt;BR /&gt;
Kind greetings to you.&lt;BR /&gt;
Guido Rooms.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;DANIELM&gt; wrote in message news:5825190@discussion.autodesk.com...&lt;BR /&gt;
Ha! I never knew that! Thanks Tony!&lt;/DANIELM&gt;</description>
    <pubDate>Sat, 19 Jan 2008 16:50:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-01-19T16:50:47Z</dc:date>
    <item>
      <title>Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159896#M75825</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I was wondering if it's possible to return a plain nil (as opposed to a list &lt;BR /&gt;
containing just nil) from a lisp callable function.&lt;BR /&gt;
The other night I was experimenting a bit and the only thing I could think &lt;BR /&gt;
of was  this&lt;BR /&gt;
&lt;BR /&gt;
Return New ResultBuffer(New TypedValue(LispDataType.Nil))&lt;BR /&gt;
&lt;BR /&gt;
I'm also wondering if there's a way to typecast a VB boolean value to &lt;BR /&gt;
LispDataType.T_atom or LispDataType.Nil&lt;BR /&gt;
For now I'm doing something like this:&lt;BR /&gt;
&lt;BR /&gt;
 If Condition Ten&lt;BR /&gt;
      SomeTypedValue = New TypedValue(LispDataType.T_atom)&lt;BR /&gt;
 Else&lt;BR /&gt;
      SomeTypedValue = New TypedValue(LispDataType.Nil)&lt;BR /&gt;
 End If&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
and beg pardon if these are stupid questions.</description>
      <pubDate>Sat, 19 Jan 2008 10:51:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159896#M75825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T10:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159897#M75826</link>
      <description>These aren't stupid questions, if for no other reason because there is virtually no documentation on any of this.&lt;BR /&gt;
&lt;BR /&gt;
A method marked with the LispFunction attribute should return a ResultBuffer only if you are returning a list.&lt;BR /&gt;
&lt;BR /&gt;
If you are returning an atom, you just return that value directly.&lt;BR /&gt;
&lt;BR /&gt;
For example, this method will return the symbol T:&lt;BR /&gt;
&lt;BR /&gt;
   [LispFunction("foo")]&lt;BR /&gt;
   public static object Foo( ResultBuffer args )&lt;BR /&gt;
   {&lt;BR /&gt;
       return true;  &lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
and this will return the integer 99:&lt;BR /&gt;
&lt;BR /&gt;
   [LispFunction("bar")]&lt;BR /&gt;
   public static object Bar( ResultBuffer args )&lt;BR /&gt;
   {&lt;BR /&gt;
       return 99;  &lt;BR /&gt;
   }&lt;BR /&gt;
   &lt;BR /&gt;
and this will return the string "Hello":&lt;BR /&gt;
&lt;BR /&gt;
   [LispFunction("baz")]&lt;BR /&gt;
   public static object Baz( ResultBuffer args )&lt;BR /&gt;
   {&lt;BR /&gt;
       return "Hello";  &lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
IOW, the result of your lisp-callable function does not have to be a ResultBuffer, it can be that, or any value you can put into a TypedValue's Value field as well. The runtime looks at the result and converts it to the appropriate LISP result. In the case of System.Boolean, that would be the symbol T for True, or NIL for False.&lt;BR /&gt;
&lt;BR /&gt;
You cannot return COM objects to VisualLisp using LispFunction, but you write a COM-callable wrapper that can return COM objects or any other ActiveX compatible type, which can be called from LISP using VLAX-* functions.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Guido Rooms"  wrote in message news:5825119@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I was wondering if it's possible to return a plain nil (as opposed to a list &lt;BR /&gt;
containing just nil) from a lisp callable function.&lt;BR /&gt;
The other night I was experimenting a bit and the only thing I could think &lt;BR /&gt;
of was  this&lt;BR /&gt;
&lt;BR /&gt;
Return New ResultBuffer(New TypedValue(LispDataType.Nil))&lt;BR /&gt;
&lt;BR /&gt;
I'm also wondering if there's a way to typecast a VB boolean value to &lt;BR /&gt;
LispDataType.T_atom or LispDataType.Nil&lt;BR /&gt;
For now I'm doing something like this:&lt;BR /&gt;
&lt;BR /&gt;
 If Condition Ten&lt;BR /&gt;
      SomeTypedValue = New TypedValue(LispDataType.T_atom)&lt;BR /&gt;
 Else&lt;BR /&gt;
      SomeTypedValue = New TypedValue(LispDataType.Nil)&lt;BR /&gt;
 End If&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
and beg pardon if these are stupid questions.</description>
      <pubDate>Sat, 19 Jan 2008 13:53:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159897#M75826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T13:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159898#M75827</link>
      <description>Tony,&lt;BR /&gt;
&lt;BR /&gt;
On the one hand, thanks for your reply. As usual, I've saved it to my &lt;BR /&gt;
'Tanzillo' folder.&lt;BR /&gt;
&lt;BR /&gt;
On the other hand, I find this whole AutoCAD .NET api thing depressing. &lt;BR /&gt;
Visual Studio's object browser seems to be the only tool I've got to &lt;BR /&gt;
decipher it. But clearly, that's not enough. Moreover, nobody seems to know &lt;BR /&gt;
if and when Autodesk is going to descend from heaven to write decent &lt;BR /&gt;
documentation. Considering the price tag that comes with AutoCAD, I think &lt;BR /&gt;
this is scandalous. We're paying about the same amount as customers in the &lt;BR /&gt;
US, except that here the unit is one Euro. The only thing one could do is to &lt;BR /&gt;
pay even more for an ADN subscription. But they're telling me ADN isn't &lt;BR /&gt;
something to write home about, either. The apps I'm writing are just in &lt;BR /&gt;
house stuff, nothing commercial. There's only me and a colleague who &lt;BR /&gt;
actually use them. So,this gives us the option of dumping the idea of &lt;BR /&gt;
programming AutoCAD... If I lost some money only, I wouldn't complain so &lt;BR /&gt;
loud. But here, I'm losing time, which is much worse.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again for the reply.&lt;BR /&gt;
Greetings.&lt;BR /&gt;
&lt;BR /&gt;
Guido Rooms.&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:5825108@discussion.autodesk.com...&lt;BR /&gt;
These aren't stupid questions, if for no other reason because there is &lt;BR /&gt;
virtually no documentation on any of this.&lt;BR /&gt;
&lt;BR /&gt;
A method marked with the LispFunction attribute should return a ResultBuffer &lt;BR /&gt;
only if you are returning a list.&lt;BR /&gt;
&lt;BR /&gt;
If you are returning an atom, you just return that value directly.&lt;BR /&gt;
&lt;BR /&gt;
For example, this method will return the symbol T:&lt;BR /&gt;
&lt;BR /&gt;
   [LispFunction("foo")]&lt;BR /&gt;
   public static object Foo( ResultBuffer args )&lt;BR /&gt;
   {&lt;BR /&gt;
       return true;&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
and this will return the integer 99:&lt;BR /&gt;
&lt;BR /&gt;
   [LispFunction("bar")]&lt;BR /&gt;
   public static object Bar( ResultBuffer args )&lt;BR /&gt;
   {&lt;BR /&gt;
       return 99;&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
and this will return the string "Hello":&lt;BR /&gt;
&lt;BR /&gt;
   [LispFunction("baz")]&lt;BR /&gt;
   public static object Baz( ResultBuffer args )&lt;BR /&gt;
   {&lt;BR /&gt;
       return "Hello";&lt;BR /&gt;
   }&lt;BR /&gt;
&lt;BR /&gt;
IOW, the result of your lisp-callable function does not have to be a &lt;BR /&gt;
ResultBuffer, it can be that, or any value you can put into a TypedValue's &lt;BR /&gt;
Value field as well. The runtime looks at the result and converts it to the &lt;BR /&gt;
appropriate LISP result. In the case of System.Boolean, that would be the &lt;BR /&gt;
symbol T for True, or NIL for False.&lt;BR /&gt;
&lt;BR /&gt;
You cannot return COM objects to VisualLisp using LispFunction, but you &lt;BR /&gt;
write a COM-callable wrapper that can return COM objects or any other &lt;BR /&gt;
ActiveX compatible type, which can be called from LISP using VLAX-* &lt;BR /&gt;
functions.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2008&lt;BR /&gt;
Supporting AutoCAD 2000 through 2008&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Guido Rooms"  wrote in message news:5825119@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
I was wondering if it's possible to return a plain nil (as opposed to a list&lt;BR /&gt;
containing just nil) from a lisp callable function.&lt;BR /&gt;
The other night I was experimenting a bit and the only thing I could think&lt;BR /&gt;
of was  this&lt;BR /&gt;
&lt;BR /&gt;
Return New ResultBuffer(New TypedValue(LispDataType.Nil))&lt;BR /&gt;
&lt;BR /&gt;
I'm also wondering if there's a way to typecast a VB boolean value to&lt;BR /&gt;
LispDataType.T_atom or LispDataType.Nil&lt;BR /&gt;
For now I'm doing something like this:&lt;BR /&gt;
&lt;BR /&gt;
 If Condition Ten&lt;BR /&gt;
      SomeTypedValue = New TypedValue(LispDataType.T_atom)&lt;BR /&gt;
 Else&lt;BR /&gt;
      SomeTypedValue = New TypedValue(LispDataType.Nil)&lt;BR /&gt;
 End If&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
and beg pardon if these are stupid questions.&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Sat, 19 Jan 2008 15:27:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159898#M75827</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T15:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159899#M75828</link>
      <description>Ha! I never knew that! Thanks Tony!</description>
      <pubDate>Sat, 19 Jan 2008 16:14:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159899#M75828</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T16:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159900#M75829</link>
      <description>Hello Daniel,&lt;BR /&gt;
&lt;BR /&gt;
Indeed, you and I  and many others in this newsgroup seem to find Tony's &lt;BR /&gt;
answers very  helpful &amp;amp; useful and so we say thank you and thanks again, &lt;BR /&gt;
which is only natural.&lt;BR /&gt;
&lt;BR /&gt;
Now, just imagine that for any reason on no reason at all, Tony stops &lt;BR /&gt;
posting here...&lt;BR /&gt;
&lt;BR /&gt;
What I mean is this: if AutoDesk is not going to produce decent &lt;BR /&gt;
documentation soon, or at least inform us when the aforementioned &lt;BR /&gt;
documentation will be forthcoming, then it would be unwise for those among &lt;BR /&gt;
us who are not in the know to go on inversting time in this .NET api thing.&lt;BR /&gt;
&lt;BR /&gt;
Could be that's exactly wat they want. There may be more money in it for &lt;BR /&gt;
them that way. !?&lt;BR /&gt;
I think I can smell a rat here...&lt;BR /&gt;
&lt;BR /&gt;
Kind greetings to you.&lt;BR /&gt;
Guido Rooms.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;DANIELM&gt; wrote in message news:5825190@discussion.autodesk.com...&lt;BR /&gt;
Ha! I never knew that! Thanks Tony!&lt;/DANIELM&gt;</description>
      <pubDate>Sat, 19 Jan 2008 16:50:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159900#M75829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-19T16:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159901#M75830</link>
      <description>The documentation is just shameful, the helloworld example in the documentation throws an exception! I get more info by using reflector. If it weren’t for the good people here and at theswamp.org, willing to share and help others, I would be lost.&lt;BR /&gt;
&lt;BR /&gt;
Thanks Tony, you rock,</description>
      <pubDate>Sun, 20 Jan 2008 03:37:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159901#M75830</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-20T03:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159902#M75831</link>
      <description>I concur !&lt;BR /&gt;
&lt;BR /&gt;
//kwb&lt;BR /&gt;
&lt;BR /&gt;
&lt;DANIELM&gt; wrote in message news:5825318@discussion.autodesk.com...&lt;BR /&gt;
The documentation is just shameful, the helloworld example in the &lt;BR /&gt;
documentation throws an exception! I get more info by using reflector. If it &lt;BR /&gt;
weren't for the good people here and at theswamp.org, willing to share and &lt;BR /&gt;
help others, I would be lost.&lt;BR /&gt;
&lt;BR /&gt;
Thanks Tony, you rock,&lt;/DANIELM&gt;</description>
      <pubDate>Sun, 20 Jan 2008 05:39:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159902#M75831</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-20T05:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Return value of a lisp callable function</title>
      <link>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159903#M75832</link>
      <description>&lt;DIV id="jive-html-wrapper-div"&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;I concut, too.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;And I also have to thank you, Tony.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;"Kerry Brown" &amp;lt;&lt;/FONT&gt;&lt;A&gt;&lt;BR /&gt;
href="mailto:kwb@home"&amp;gt;&lt;FONT face="Arial" size="2"&gt;kwb@home&lt;/FONT&gt;&lt;/A&gt;&lt;FONT&gt;&lt;BR /&gt;
face=Arial size=2&amp;gt;&amp;gt; schrieb im Newsbeitrag &lt;/FONT&gt;&lt;A&gt;&lt;BR /&gt;
href="news:5825331@discussion.autodesk.com"&amp;gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;
size=2&amp;gt;news:5825331@discussion.autodesk.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;
size=2&amp;gt;...&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT face="Arial" size="2"&gt;I concur &lt;BR /&gt;
!&lt;BR /&gt;&lt;BR /&gt;//kwb&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Danielm&amp;gt; wrote in message &lt;/FONT&gt;&lt;A&gt;&lt;BR /&gt;
href="news:5825318@discussion.autodesk.com"&amp;gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;
size=2&amp;gt;news:5825318@discussion.autodesk.com&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;
size=2&amp;gt;...&lt;BR /&gt;The documentation is just shameful, the helloworld example in the &lt;BR /&gt;
&lt;BR /&gt;documentation throws an exception! I get more info by using reflector. If it &lt;BR /&gt;
&lt;BR /&gt;weren't for the good people here and at theswamp.org, willing to share and &lt;BR /&gt;
&lt;BR /&gt;help others, I would be lost.&lt;BR /&gt;&lt;BR /&gt;Thanks Tony, you &lt;BR /&gt;
rock,&lt;/FONT&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Jan 2008 06:45:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/return-value-of-a-lisp-callable-function/m-p/2159903#M75832</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-21T06:45:16Z</dc:date>
    </item>
  </channel>
</rss>

