Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add numeric binops + - * /.

  • Loading branch information...
commit 2e3a5ac5b294bdc0ee3c5df7c38d66983b4683dc 1 parent 92bf181
@manuel authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 standard.virtua
View
17 standard.virtua
@@ -482,6 +482,23 @@
(to-string (get-slot frm "otree"))))
)
+;;;; Numbers
+
+(provide (+ - * /)
+ (defmacro define-js-number-binop (name) env
+ (def a (intern "a"))
+ (def b (intern "b"))
+ (def binop (js-binop name))
+ (eval (list def (intern name)
+ (list typed-lambda (list (list a Number) (list b Number))
+ (list binop a b)))
+ env))
+ (define-js-number-binop "+")
+ (define-js-number-binop "-")
+ (define-js-number-binop "*")
+ (define-js-number-binop "/"))
+
+
;;;; Property Lists
;; Calls fun with name and value of each property in plist.
Please sign in to comment.
Something went wrong with that request. Please try again.