[racket] class variables in racket
I expected to find some special-form, like 'class-variable' or something like that.
For pedagogical reasons I'd prefer to implement two syntactically different programs representing the oop thinking style quite obvious: the first one makes absolutely no use of the bindings provided by the 'class' library that comes with Racket whereas the second one is mainly limited to take them. The first one helps the students to understand lots behind the scene of how oop works and why. The second one abstracts of that and really allows for oo programming.
What I mean is that the terms describing the basic concepts of object oriented programming should be mapped to related code. Using 'let' to get the right variable scope causes to mix both levels of thinking / abstraction. Thats exactly what I like to avoid.
Am 19.01.2012 18:09, schrieb Matthias Felleisen:
>
> On Jan 19, 2012, at 11:57 AM, Christian Wagenknecht wrote:
>
>> How class variables/methods (instead of instance variables/methods) can be implemented be means of Racket's class definition expressions? An unsatisfying way I found is by using a let expression enclosing the whole definition of the class.
>
> What's unsatisfying about it?