我正在编写代码来模拟类:
(define (className)
(define value 1)
(define (obj arg1) ;constructor
(define (increment)
((+ value 1)))
(define (get)
(value))
(if (equal? arg1 "increment")
(increment)
(get)))
obj)
(define a className)
(display a) ;returns #<procedure className ()>
(display (a "get")) ;trying to call get procedure
我得到了ERROR: Wrong number of arguments to #<procedure className ()>
。我的代码有什么问题?