Path: news.cs.au.dk!news.net.uni-c.dk!howland.erols.net!netnews.com!newsfeed.wirehub.nl!skynet.be!poster!not-for-mail From: Jean-Louis Leroy Newsgroups: comp.lang.beta Subject: Is Beta a statically typed language? Date: Sun, 10 Jan 1999 19:42:42 +0100 Organization: Starfleet Lines: 33 Message-ID: Reply-To: jll@skynet.be NNTP-Posting-Host: dialup286.brussels2.skynet.be Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news0.skynet.be 915993178 19761 195.238.24.30 (10 Jan 1999 18:32:58 GMT) X-Complaints-To: abuse@skynet.be NNTP-Posting-Date: 10 Jan 1999 18:32:58 GMT X-Newsreader: Virtual Access by Ashmount Research Ltd, http://www.ashmount.com Xref: news.cs.au.dk comp.lang.beta:11785 In my explorations I came up with the following oddity: (# Fruit: (# #); Apple: Fruit (# #); Banana: (# #); Animal: (# Food:< Object; f: ^Food enter f[] do INNER #); Monkey: Animal (# Food::< Banana #); cheetah: ^Animal do &Monkey[]->cheetah[]; &Banana[]->cheetah; &Apple[]->cheetah #) This program compiles but fails at runtime because of a 'qualification error in reference assignment'. In fact my program contains an implicit downcast which is quite well hidden. This experiment was inspired by the C++ FAQ that goes 'why doesn't Monkey::eat(Banana&) override virtual Animal::eat(Fruit&)?'. It is also a Frequently Proposed Extension, sometimes under the moniker 'covariant method signatures'. The canonical reply/rebuttal is 'because it would open a hole in the type system'. This posits Beta somewhere between typeless and statically typed languages, doesn't it? Jean-Louis Leroy http://ourworld.compuserve.com/homepages/jl_leroy/