On Tue, Jul 2, 2013 at 12:16 PM, Juan Jose Garcia-Ripoll <
juanjose.garciarip...@gmail.com> wrote:
> * Declaration of C variables
>
> (let ((a (cos 1.0))
> (declare (:double a))
> ...)
>
> * Direct references to C variables
>
> (ffi:c-inline (a b) (:double :double) :void
> "#0 = cos(#1)")
>
> * Embed imperative lisp in C (syntax not yet decided)
>
>
Already working (beware of the dangers of improper use!)
> (disassemble '(lambda (i)
(declare (optimize (speed 3) (safety 0)))
(let* ((limit i)
(iterator 0))
(declare (:int limit iterator))
(ffi:c-progn (limit iterator)
"for (#1 = 0; #1 < #0; #1++) {"
(print iterator)
"}"))))
;;; Compiling (DEFUN C::GAZONK ...).
;;; Emitting code for C::GAZONK.
/* function definition for GAZONK */
/* optimize speed 3, debug 0, space 0, safety 0 */
static cl_object L1c__gazonk(cl_object v1i)
{
const cl_env_ptr cl_env_copy = ecl_process_env();
cl_object value0;
TTL:
{
int v2limit;
int v3iterator;
v2limit = ecl_fixnum(v1i);
v3iterator = (int)(0);
for (v3iterator = 0; v3iterator < v2limit; v3iterator++) {
ecl_print(ecl_make_int(v3iterator),ECL_NIL);
}
value0 = ECL_NIL;
cl_env_copy->nvalues = 1;
return value0;
}
}
--
Instituto de FĂsica Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list