added a few operations and expanded standard library
This commit is contained in:
@@ -20,10 +20,15 @@
|
||||
;; (print op)
|
||||
;; (print *stack*)
|
||||
(case (car op)
|
||||
(:divmod (let ((top (pop*)))
|
||||
(multiple-value-bind (div mod) (truncate (pop*) top)
|
||||
(push* div)
|
||||
(push* mod))))
|
||||
(:push-int (push* (cadr op)))
|
||||
(:+ (push* (+ (pop*) (pop*))))
|
||||
(:- (let ((top (pop*)))
|
||||
(push* (- (pop*) top))))
|
||||
(:* (push* (* (pop*) (pop*))))
|
||||
(:dump (format t "~a~%" (pop*)))
|
||||
(:= (push* (if (= (pop*) (pop*)) 1 0)))
|
||||
(:eş (let ((top (pop*)))
|
||||
@@ -36,6 +41,8 @@
|
||||
(setf i (third op))))
|
||||
(:< (let ((top (pop*)))
|
||||
(push* (if (< (pop*) top) 1 0))))
|
||||
(:> (let ((top (pop*)))
|
||||
(push* (if (> (pop*) top) 1 0))))
|
||||
(:iken (when (= 0 (pop*))
|
||||
(setf i (cadr op))))
|
||||
(:döngü nil)
|
||||
|
||||
Reference in New Issue
Block a user