[plt-scheme] inheritance of methods

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Oct 3 12:14:49 EDT 2003

In DrScheme, v205cvs-today, you can write it this OtherLanguage:

Welcome to DrScheme, version 205.3-cvs29sep2003.
Language: Python.
 > class Foo:
     def __init__(self, x):
         self.x = x
     def double(self):
         return 2 * self.x
 > class Bar(Foo):
     def __init__(self, x):
     def quadruple(self):
         return 2 * self.double()
 > f = Foo(2)
 > print f.double()
 > b = Bar(2)
 > print b.double()
 > print b.quadruple()

For a screen shot, see


-- Matthias

P.S. If you want to help, ask Daniel (cc'ed).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 663 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20031003/f2a8157c/attachment.bin>

Posted on the users mailing list.