[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
is too an application
Suppose I want to save a call to an inherited method into a hash table.
The procedure (another method) that does this is called "add-method"
The problem is that the inherited method takes zero or more args
and so I end up with an expression like this:
(define test-client%
(class (make-client test%)
(inherit add-method test1 test2)
(super-instantiate ())
(add-method 'test1 (lambda x (apply test1 x)))
(add-method 'test2 (lambda x (apply test2 x)))))
and an error like this:
#<struct:object:derived-from-definitions-text%>:109:41: class: misuse of
method (not in application) in: test1
Why is (apply test1 x) any less an application than (test1 x)?
The former is semantically correct since x is a list of args but is rejected
syntactically, the later would not work semantically, but is syntactically
accepted by the object system.
- References:
- 199.25
- From: Matthew Flatt <mflatt@cs.utah.edu>