<div dir="ltr">Thank you Pascal exactly what I needed; the example you referenced is most helpful, thank you.<div><br><div>I was thinking of implementing stacks using arrays; the code in the example will certainly be<br></div>
<div>very helpful.</div><div><br></div><div><div><br></div><div>Taoufik</div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 14, 2013 at 7:47 PM, Pascal J. Bourguignon <span dir="ltr"><<a href="mailto:pjb@informatimago.com" target="_blank">pjb@informatimago.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Taoufik Dachraoui <<a href="mailto:dachraoui.taoufik@gmail.com">dachraoui.taoufik@gmail.com</a>> writes:<br>
<br>
> Or, how do you implement a VM using CCL for a new language? (any<br>
> thing offered by CCL even if it is not<br>
> standard would be acceptable).<br>
<br>
</div>You would implement a VM stack as a vector with a fill-pointer, possibly<br>
adjustable if you want to allow the stack to grow over the initial size.<br>
<br>
<br>
(defun make-vm-stack (size)<br>
(make-array size :fill-pointer 0 :adjustable t))<br>
<br>
(defun vm-push (element stack)<br>
(vector-push-extend element stack))<br>
<br>
(defun vm-pop (stack)<br>
(vector-pop stack))<br>
<br>
<br>
For an example, see:<br>
<br>
<a href="http://fossil.nasium-lse.ogamita.com/nasium-lse/artifact/aaaed70c3800fb2794c752be7ab5412204151390" target="_blank">http://fossil.nasium-lse.ogamita.com/nasium-lse/artifact/aaaed70c3800fb2794c752be7ab5412204151390</a><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
__Pascal Bourguignon__ <a href="http://www.informatimago.com/" target="_blank">http://www.informatimago.com/</a><br>
A bad day in () is better than a good day in {}.<br>
You can take the lisper out of the lisp job, but you can't take the lisp out<br>
of the lisper (; -- antifuchs<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
Openmcl-devel mailing list<br>
<a href="mailto:Openmcl-devel@clozure.com">Openmcl-devel@clozure.com</a><br>
<a href="http://clozure.com/mailman/listinfo/openmcl-devel" target="_blank">http://clozure.com/mailman/listinfo/openmcl-devel</a><br>
</div></div></blockquote></div><br></div>