Path: news.daimi.aau.dk!olevi From: olevi@daimi.aau.dk (Ole Villumsen) Newsgroups: comp.lang.beta Subject: Adding methods without renaming the class (was Re: What's wrong with this picture?) Date: 20 Dec 1995 15:40:40 GMT Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 27 Message-ID: <4b9apo$aop@krone.daimi.aau.dk> References: <4aodps$70h@netnews.upenn.edu> <4b6p2p$dua@fbi-news.Informatik.Uni-Dortmund.DE> NNTP-Posting-Host: indium.daimi.aau.dk Wilfried Rupflin writes: >>One language question (which I need answered in order to >>compare Dylan and BETA -- I'm still not sure which to go >>with). Is it possible to add methods to a class without >>having to rename the class. I would think yes since >>extension of patterns is allowed. >> >You are right in the case of virtual classes: > A_class: (# my_class:< (# a: ... #); ... #); > B_class: A_class (# my_class::< (# b: ... #); ... #); There's another possibility: using an attributes slot. myClass: (# <> methodA: (# ... #) ... #); Such a slot allows you to define in a different fragment, additional methods for myClass, even if myClass is written by someone else, frozen and delivered to you. Ole V.