Skip to content

Commit

Permalink
Add superclasses to DEFINTERFACE.
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel committed Mar 21, 2012
1 parent 14bb874 commit 7808e4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions standard.virtua
Expand Up @@ -253,8 +253,8 @@
(eval (list defconstructor ctor-name name args) env))))))))
name)

(defmacro definterface (name) env
(eval (list defclass name ()) env))
(defmacro definterface (name . supers) env
(eval (list* defclass name supers) env))

(def defimplementation add-superclass!)

Expand Down
7 changes: 7 additions & 0 deletions test.virtua
Expand Up @@ -113,6 +113,13 @@
(defimplementation Bar Foo)
(assert (subclass? Bar Foo)))

(scope
(definterface A)
(definterface B (A))
(defclass C)
(defimplementation C B)
(assert (subclass? C B))
(assert (subclass? C A)))

(scope
(defclass Foo ()
Expand Down

0 comments on commit 7808e4f

Please sign in to comment.