Re: [racket-users] Questions on a very simple class

2020-02-15 Thread Alain De Vos
When i try typed/racket : #lang typed/racket (define (integerclass x) (define (getx) x) (define (setx! [x_new : Integer]) (set! x x_new)) (define (add [y : integerclass]) : integerclass (integerclass (+ 1 (y 'getx (lambda (message . args) (case message ((getx) (apply

Re: [racket-users] Questions on a very simple class

2020-02-15 Thread Sage Gerard
1. If the intention is to create a class, then I'd use the class form. https://docs.racket-lang.org/reference/createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%2A%29%29 Not that there's anything overtly wrong with using a closure, but common validation tasks