Path: news.daimi.aau.dk!news.uni-c.dk!newsfeed.sunet.se!news00.sunet.se!sunic!mn6.swip.net!plug.news.pipex.net!pipex!tube.news.pipex.net!pipex!dish.news.pipex.net!pipex!tank.news.pipex.net!pipex!newsfeed.internetmci.com!vixen.cso.uiuc.edu!news.ecn.bgu.edu!psuvax1!news.cc.swarthmore.edu!netnews.upenn.edu!news From: Wolfgang Ziller Newsgroups: comp.lang.beta Subject: Re: polymorphism Date: 26 Dec 1995 15:41:12 GMT Organization: University of Pennsylvania Lines: 36 Message-ID: <4bp52o$kp4@netnews.upenn.edu> References: <4bnjm4$cvg@krone.daimi.aau.dk> NNTP-Posting-Host: ts11-44.upenn.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 1.1N (Windows; I; 16bit) To: AL@BRUSPSCE.BitNet Albertina Lourenci wrote: >Hi, all| > Could someone tell me if BETA supports polymorphism? If yes, >can you demonstrate how? Special thanks. Yes, polymorphism is a vital part of Object-Oriented Technology. BETA does support it and I believe the following code is correct: polygon: (# draw:< (# do inner #) #); circle: (# draw:<< (# do (* draw a circle *) #); square: (# draw:<< (# do (* draw a sqare *) #); (# a_polygon: @polygon; a_circle: @circle; a_square: @sqaure; do a_circle -> a_polygon; a_polygon.draw; a_square -> a_polygon; a_polygon.draw; #); That's roughly the idea. I'm not sure if the above code is totally correct (esp. the a_polygon.draw parts. Also not sure if you could condense the above and write a_circle -> a_polygon.draw). Anyway, BETA definately supports polymorphism. Regards, Wolfgang Ziller