[GSLL-devel] looking for a grid declaration to store nil/t
I am writing a library on top of grid/foreign-array that provides math functions corresponding to the ones in the Numbers Dictionary of the hyperspec (http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm) (I will share it when it is done) For those that are interested into details, it parses declarations of the type: ... (cos ((!F :return !F) (!C :return !C))) (tan ((!F :return !F) (!C :return !C))) ... to generate generic functions and methods that will accept grid vectors: (grid-cos #1(....)) returns a grid double-float of cosines of double floats (grid-cos #2(...)) returns a grid complex double-float of cosines of complex arguments. Question: I am not sure how to store results for predicate type functions, such as minusp, zerop, and comparison functions >, = that return t or nil. Is there a foreign-array or cl-array type that stores nils and t's? Thanks, Mirko
The purpose of foreign-array is to communicate with foreign libraries. In general I don't think there's a standard for the representation of booleans in foreign code. I'm not sure how C stores booleans, and whether there's even a standard for that, but you might aim in that direction. Whatever it is, if CFFI supports it, it should be pretty easy to make an array of that type. Liam On Fri, Dec 17, 2010 at 3:59 PM, Mirko Vukovic <mirko.vukovic@gmail.com> wrote:
I am writing a library on top of grid/foreign-array that provides math functions corresponding to the ones in the Numbers Dictionary of the hyperspec (http://www.lispworks.com/documentation/HyperSpec/Body/c_number.htm)
(I will share it when it is done)
For those that are interested into details, it parses declarations of the type:
... (cos ((!F :return !F) (!C :return !C))) (tan ((!F :return !F) (!C :return !C))) ...
to generate generic functions and methods that will accept grid vectors:
(grid-cos #1(....)) returns a grid double-float of cosines of double floats (grid-cos #2(...)) returns a grid complex double-float of cosines of complex arguments.
Question: I am not sure how to store results for predicate type functions, such as minusp, zerop, and comparison functions >, = that return t or nil.
Is there a foreign-array or cl-array type that stores nils and t's?
Thanks,
Mirko
_______________________________________________ GSLL-devel mailing list GSLL-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/gsll-devel
participants (2)
-
Liam Healy
-
Mirko Vukovic