Skip to content

Commit

Permalink
bugfix: make method redefinitions work
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel committed Jul 11, 2011
1 parent 7a68c81 commit 524de9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 0 additions & 2 deletions BUGS
Expand Up @@ -13,8 +13,6 @@
1) parses parameters -> produces sig
2) compiles optional parameter init forms in contour with sig

* Replacing methods doesn't seem to work.

* SETQ doesn't check whether binding exists.

* Printing of strings is broken.
Expand Down
9 changes: 9 additions & 0 deletions lisp/test-boot.lisp
Expand Up @@ -201,4 +201,13 @@
(assert (= 1 (if-option (x (some 1)) x 2)))
(assert (= nil (if-option (x none) x)))

;;; Methods

;; Redefining methods
(defclass test-x)
(defmethod test-m ((x test-x)) "x")
(assert (= "x" (test-m (make test-x))))
(defmethod test-m ((x test-x)) "y")
(assert (= "y" (test-m (make test-x))))

(provide "test-boot")
2 changes: 1 addition & 1 deletion runtime.js
Expand Up @@ -689,7 +689,7 @@ function lisp_make_method_entry(method, specializers)

function lisp_bif_put_method(_key_, generic, specializers, method)
{
for (var i = 0, len = generic.method_entries; i < len; i++) {
for (var i = 0, len = generic.method_entries.length; i < len; i++) {
var me = generic.method_entries[i];
if (lisp_lists_equal(me.specializers, specializers)) {
me.method = method;
Expand Down

0 comments on commit 524de9d

Please sign in to comment.