Fw: [cffi-devel] How would I wite the return value for a defcfun in my documentation

Martin Simmons martin at lispworks.com
Tue Mar 11 11:35:54 UTC 2014


Look again, it does add the return value ("shifted-integer" for ash).

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/


>>>>> On Mon, 10 Mar 2014 13:39:17 -0700 (PDT), Joeish W said:
> 
> 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
> 
> 
> 
> 
> On Monday, March 10, 2014 1:09 PM, Martin Simmons <martin at lispworks.com> wrote:
>  
> >See http://www.lispworks.com/documentation/HyperSpec/Body/f_ash.htm
> >
> >for an example of how CLHS uses the "Syntax" and "Arguments and Values"
> >sections to describe functions.
> >
> >-- 
> >Martin Simmons
> >LispWorks Ltd
> >http://www.lispworks.com/
> >
> >
> >
> >
> >>>>>> On Sun, 9 Mar 2014 00:46:33 -0800 (PST), Joeish W said:
> >> 
> >> Here is my defcfun as I normally write it,
> >> 
> >> ;; Size Mat::size() const 
> >> ;; Size* cv_Mat_size(Mat* self) 
> >> (defcfun ("cv_Mat_size" mat-size) (:pointer size) 
> >>   (self (:pointer mat)))
> >> 
> >> 
> >> the 
> >> 
> >> 
> >> ;; Size Mat::size() const 
> >> 
> >> 
> >> is the C++  function declaration with a Size return value
> >> 
> >> 
> >> The ;; Size* cv_Mat_size(Mat* self) is the  C wrapper function declaration with a Size* return value
> >> 
> >> 
> >> This is my defcfun with a (:pointer size) return value
> >> 
> >> (defcfun ("cv_Mat_size" mat-size) (:pointer size) 
> >>   (self (:pointer mat)))
> >> 
> >> In my Documentation for this function I list the Common Lisp function declaration as
> >> 
> >> (MAT-SIZE (SELF (:POINTER MAT))) 
> >> 
> >> 
> >> I couldn't figure out if I should add a return value
> >> 
> >> 
> >> but in C++ the return value always goes up front i/e ;; Size Mat::size() const 
> >> 
> >> Is it common to put return values on Lisp/CFFI function declarations and if so where 
> >> 
> >> 
> >> in this declaration  (MAT-SIZE (SELF (:POINTER MAT))) should I put mine
> >> 
> >> btw on the CLHS I didn't see or missed return values on any function declaration
> >> 
> >> Thanks in advance for any  takers=)
> >> 
> >> Good Day.
> >
> >
> >
> >
> 



More information about the cffi-devel mailing list