<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div><span>So CLHS doesn't add the return value to its declaration....so I guess its okay not to...Does anybody ever do it I mean would it be weird if I did it and if not what would be syntax pertaining to the code in my post<br></span></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Monday, March 10, 2014 1:09 PM, Martin Simmons <martin@lispworks.com> wrote:<br> </font> </div> <blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left:
5px;"> <div class="y_msg_container">See <a shape="rect" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_ash.htm" target="_blank">http://www.lispworks.com/documentation/HyperSpec/Body/f_ash.htm</a><br clear="none"><br clear="none">for an example of how CLHS uses the "Syntax" and "Arguments and Values"<br clear="none">sections to describe functions.<br clear="none"><br clear="none">-- <br clear="none">Martin Simmons<br clear="none">LispWorks Ltd<br clear="none"><a shape="rect" href="http://www.lispworks.com/" target="_blank">http://www.lispworks.com/</a><br clear="none"><br clear="none"><br clear="none"><div class="yqt6211401700" id="yqtfd80493"><br clear="none">>>>>> On Sun, 9 Mar 2014 00:46:33 -0800 (PST), Joeish W said:<br clear="none">> <br clear="none">> Here is my defcfun as I normally write it,<br clear="none">> <br clear="none">> ;; Size Mat::size() const <br clear="none">> ;; Size* cv_Mat_size(Mat*
self) <br clear="none">> (defcfun ("cv_Mat_size" mat-size) (:pointer size) <br clear="none">> (self (:pointer mat)))<br clear="none">> <br clear="none">> <br clear="none">> the <br clear="none">> <br clear="none">> <br clear="none">> ;; Size Mat::size() const <br clear="none">> <br clear="none">> <br clear="none">> is the C++ function declaration with a Size return value<br clear="none">> <br clear="none">> <br clear="none">> The ;; Size* cv_Mat_size(Mat* self) is the C wrapper function declaration with a Size* return value<br clear="none">> <br clear="none">> <br clear="none">> This is my defcfun with a (:pointer size) return value<br clear="none">> <br clear="none">> (defcfun ("cv_Mat_size" mat-size) (:pointer size) <br clear="none">> (self (:pointer mat)))<br clear="none">> <br clear="none">> In my Documentation for this function I list the Common Lisp
function declaration as<br clear="none">> <br clear="none">> (MAT-SIZE (SELF (:POINTER MAT))) <br clear="none">> <br clear="none">> <br clear="none">> I couldn't figure out if I should add a return value<br clear="none">> <br clear="none">> <br clear="none">> but in C++ the return value always goes up front i/e ;; Size Mat::size() const <br clear="none">> <br clear="none">> Is it common to put return values on Lisp/CFFI function declarations and if so where <br clear="none">> <br clear="none">> <br clear="none">> in this declaration (MAT-SIZE (SELF (:POINTER MAT))) should I put mine<br clear="none">> <br clear="none">> btw on the CLHS I didn't see or missed return values on any function declaration<br clear="none">> <br clear="none">> Thanks in advance for any takers=)<br clear="none">> <br clear="none">> Good Day.<br clear="none"><br clear="none"></div><br><br></div> </blockquote>
</div> </div> </div> </div></body></html>