Mon May 25 09:34:13 CEST 2009

removed old vm commands

;; quoted here for later reference.  this code is probably broken.

 ;; Entry point for (syntax-only!) live interaction -> prj code
 ;; transformation.
 (define (live->prj code)

   (define default
      (number?  ((n)  (n tlit)))
      (symbol?  ((w)  ('w tinterpret)))))

    '(live) default code))

 ;; Append a line to a log of lines.

 (define (log-line str stack)
   (if (or
        (null? stack)
        (not (equal? str (car stack))))
       (cons str stack)

 (provide vm->native/compile

 (define (underscore stx)
      (symbol->string (->datum stx))))))

 (define (vm->native/compile code)

   (define default
      (symbol?      ((w)       (|'| #,(underscore #'w)
                                    |'| _compile macro/default)))
      (number?      ((n)       (n _literal)))))

    '(compile-vm) default code))


  (0cmd         ((w)       (w)))
  (|:|          ((_ name)  (: #,(underscore #'name) enter)))
  (|;|          ((_)       (_exit))))

   (named-parser-clones (compile-vm)
                        (0cmd pa clear))

   ;; FIXME abstract out ns/default thingy

   (define (live/vm->prj code)

     (define default
        (symbol?   ((w)   ('#,(underscore #'w) tf
                           _tlit 'dtc tfind texec/w)))
        (number?   ((n)   (n _tlit)))))

      '(live-vm) default code))

   ;; FIXME: find a way to extend the other live commands.
   ;; map these to their '_' counterpart

   ;; FIXME: commands that take no args can be simply mapped.
   ;;(define (_command? x)  (element-of x '(ts tss tsx cold ping)))


    (0cmd      ((w)   (w))) ;; just use same as native
    (_0cmd     ((w)   (#,(underscore #'w)))) ;; special

    (1cmd      ((w)   (_t> #,(underscore #'w)))))


    (0cmd   commit clear pa ppa cold ping)
    (_0cmd  ts tss tsx)
    (1cmd   p ps px kb))