<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 12:16 PM, Juan Jose Garcia-Ripoll <span dir="ltr"><<a href="mailto:juanjose.garciaripoll@gmail.com" target="_blank">juanjose.garciaripoll@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>* Declaration of C variables</div>

<div><br></div><div>(let ((a (cos 1.0))</div>
<div>  (declare (:double a))</div><div>  ...)</div><div><br></div><div>* Direct references to C variables</div><div><br></div><div>(ffi:c-inline (a b) (:double :double) :void</div><div>   "#0 = cos(#1)")</div><div>


<br></div><div>* Embed imperative lisp in C (syntax not yet decided)</div><div><br></div><div></div></blockquote></div><br>Already working (beware of the dangers of improper use!)</div><div class="gmail_extra"><br></div>

<div class="gmail_extra"><div class="gmail_extra">> (disassemble '(lambda (i)</div><div class="gmail_extra"><span class="" style="white-space:pre">      </span>  (declare (optimize (speed 3) (safety 0)))</div><div class="gmail_extra">

<span class="" style="white-space:pre">       </span>  (let* ((limit i)</div><div class="gmail_extra"><span class="" style="white-space:pre">   </span>  <span class="" style="white-space:pre">        </span> (iterator 0))</div><div class="gmail_extra">

<span class="" style="white-space:pre">       </span>    (declare (:int limit iterator))</div><div class="gmail_extra"><span class="" style="white-space:pre">  </span>    (ffi:c-progn (limit iterator)</div><div class="gmail_extra">

<span class="" style="white-space:pre">       </span>      "for (#1 = 0; #1 < #0; #1++) {"</div><div class="gmail_extra"><span class="" style="white-space:pre">   </span>      (print iterator)</div><div class="gmail_extra">

<span class="" style="white-space:pre">       </span>      "}"))))</div><div class="gmail_extra"><br></div><div class="gmail_extra">;;; Compiling (DEFUN C::GAZONK ...).</div><div class="gmail_extra">;;; Emitting code for C::GAZONK.</div>

<div class="gmail_extra">/*<span class="" style="white-space:pre">    </span>function definition for GAZONK                                */</div><div class="gmail_extra">/*<span class="" style="white-space:pre">   </span>optimize speed 3, debug 0, space 0, safety 0                  */</div>

<div class="gmail_extra">static cl_object L1c__gazonk(cl_object v1i)</div><div class="gmail_extra">{</div><div class="gmail_extra"> const cl_env_ptr cl_env_copy = ecl_process_env();</div><div class="gmail_extra"> cl_object value0;</div>

<div class="gmail_extra">TTL:</div><div class="gmail_extra"> {</div><div class="gmail_extra">  int v2limit;</div><div class="gmail_extra">  int v3iterator;</div><div class="gmail_extra">  v2limit = ecl_fixnum(v1i);</div>
<div class="gmail_extra">
  v3iterator = (int)(0);</div><div class="gmail_extra">  for (v3iterator = 0; v3iterator < v2limit; v3iterator++) {</div><div class="gmail_extra">  ecl_print(ecl_make_int(v3iterator),ECL_NIL);</div><div class="gmail_extra">

  }</div><div class="gmail_extra">  value0 = ECL_NIL;</div><div class="gmail_extra">  cl_env_copy->nvalues = 1;</div><div class="gmail_extra">  return value0;</div><div class="gmail_extra"> }</div><div class="gmail_extra">

}</div><div><br></div><br clear="all"><div><br></div>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a>
</div></div>