[racket] class variables in racket

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Jan 19 18:00:09 EST 2012

Of course. 

On Jan 19, 2012, at 5:56 PM, Grant Rettke wrote:

> In Java for example which doesn't have modules you would create a
> class whose sole purpose in life was to hold those constants. Did you
> guys make that choice consciously?
> On Thu, Jan 19, 2012 at 3:58 PM, Robby Findler
> <robby at eecs.northwestern.edu> wrote:
>> But is this style of OOP thinking because of a weakness in the design
>> of the OOP that Racket (as it famously inherits from Scheme (ala
>> Clinger's intro to the RnRS reports)) avoids?
>> Robby
>> On Thu, Jan 19, 2012 at 1:41 PM, Christian Wagenknecht
>> <c.wagenknecht at hs-zigr.de> wrote:
>>> 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?
>>> ____________________
>>>  Racket Users list:
>>>  http://lists.racket-lang.org/users
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
> -- 
> http://www.wisdomandwonder.com/

Posted on the users mailing list.