From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id KAA21852 for caml-redistribution; Wed, 24 Jul 1996 10:44:40 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id IAA21255 for ; Wed, 24 Jul 1996 08:32:47 +0200 Received: from news2.tokyo.intervia.ad.jp (news2.tokyo.intervia.ad.jp [202.235.64.84]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id IAA28917 for ; Wed, 24 Jul 1996 08:32:43 +0200 (MET DST) Received: from sparc1.nextsolution.co.jp (sparc1.nextsolution.co.jp [202.235.80.1]) by news2.tokyo.intervia.ad.jp (8.6.12+2.4W/intervia-1.7u) with SMTP id PAA23849 for ; Wed, 24 Jul 1996 15:32:37 +0900 Received: from sparc3.nextsolution.co.jp by sparc1.nextsolution.co.jp (5.x/SMI-SVR4) id AA03082; Wed, 24 Jul 1996 15:30:33 +0900 Received: by sparc3.nextsolution.co.jp (5.x/SMI-SVR4) id AA00506; Wed, 24 Jul 1996 15:30:32 +0900 Date: Wed, 24 Jul 1996 15:30:32 +0900 From: christo@nextsolution.co.jp (Frank Christoph) Message-Id: <9607240630.AA00506@sparc3.nextsolution.co.jp> To: caml-list@pauillac.inria.fr Subject: Language improvements (?) Sender: weis Since we are griping about language features, allow me to put in my two cents about a few (admittedly even more) trivial matters. First, it would be nice to be able to hide pervasives so that, in order to use a pervasive, you would need to qualify it explicitly, e.g., "Pervasives.char". I know that you can redefine a pervasive if you want to (at least in the interpreter), but unless you can hide the Pervasives module, you run into problems in recursive scopes like class definitions. I ran into this problem defining a unicode module where I wanted to reuse the names "char" and "string" so I could refer to them as "Unicode.char" and "Unicode.string". Second, if you are going to put objects in the language, it would be useful to make some of the primitives objects as well. For example, it would have been nice to be able to coerce a "c:char" to a unicode character via the coercion operator, "c:char :> Unicode.char". Of course you can define your own character class, but that introduces a new type so you can't use it with all the library functions that operate on chars. In fact, the same could be said for most of the library as well. I realize most of it was taken from Caml Light and hasn't been fully converted yet, but many library modules are well-suited to the object paradigm, for example, hash tables. Third, since the trend in O'Caml is toward curried function types, it would be useful to be able to section binary operators as in Haskell, e.g., "(1+)" would mean "(function x -> 1 + x)". Also, and perhaps more importantly, it would be useful to be able to refer to methods independently of a particular object. For example, if "f" is a method of class "t", and "x" is a "t list", I would like to be able to write List.map #f x or perhaps even List.map f x instead of List.map (function obj -> obj#f) x. Either way, this lets you separate overloading somewhat from the OO paradigm, potentially making it more useful, IMHO. And, at the risk of instigating a syntax war, I would prefer a more Haskell-like syntax overall; for example, offside scoping, uppercase types so there is no need for quotes in front of type variables, and user-definable symbolic binary operators... Then again, I guess there's no point in turning O'Caml into an eager Haskell. Anyway, I suppose there is a philosophical reason why there are no user-defined symbolic identifiers in Caml although SML allows them. ------------------------------------------------------------------------ Frank Christoph Next Solution Co. Tel: 0424-98-1811 christo@nextsolution.co.jp Fax: 0424-98-1500