[Openmcl-devel] consing

Pascal J. Bourguignon pjb at informatimago.com
Tue May 14 17:47:42 UTC 2013


Taoufik Dachraoui <dachraoui.taoufik at gmail.com> writes:

> Or, how do you implement a VM using CCL for a new language? (any
> thing offered by CCL even if it is not
> standard would be acceptable).

You would implement a VM stack as a vector with a fill-pointer, possibly
adjustable if you want to allow the stack to grow over the initial size.


(defun make-vm-stack (size)
  (make-array size :fill-pointer 0 :adjustable t))

(defun vm-push (element stack)
   (vector-push-extend element stack))

(defun vm-pop (stack)
   (vector-pop stack))


For an example, see: 

http://fossil.nasium-lse.ogamita.com/nasium-lse/artifact/aaaed70c3800fb2794c752be7ab5412204151390


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.
You can take the lisper out of the lisp job, but you can't take the lisp out
of the lisper (; -- antifuchs




More information about the Openmcl-devel mailing list