From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA09956; Thu, 3 Jun 2004 11:31:11 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA09936 for ; Thu, 3 Jun 2004 11:31:09 +0200 (MET DST) Received: from aomori.annexia.org (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i539V6SH030771 for ; Thu, 3 Jun 2004 11:31:09 +0200 Received: from rich by aomori.annexia.org with local (Exim 3.36 #1 (Debian)) id 1BVoZ0-0006pM-00 for ; Thu, 03 Jun 2004 10:31:06 +0100 Date: Thu, 3 Jun 2004 10:31:06 +0100 Cc: caml-list@inria.fr Subject: Re: [Caml-list] Default values for structures (feature request) Message-ID: <20040603093106.GA26175@redhat.com> References: <20040602121210.GA4385@redhat.com> <20040602.215655.68536952.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040602.215655.68536952.garrigue@kurims.kyoto-u.ac.jp> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 40BEEFDA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 0900,:01 jacques:01 supposes:01 type-safe:01 ltd:98 compiler:01 caml:01 caml:01 int:01 garrigue:01 interfaces:01 syntax:02 string:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Jun 02, 2004 at 09:56:55PM +0900, Jacques GARRIGUE wrote: > From: Richard Jones > > > Could have a syntax for default values for structures? Something > > like: > > > > type t = { field1 : int = 0; > > field2 : string; (* no default *) > > } > > The difficulty should be apparent in your example: this supposes > writing values in interfaces, which would be a major (huge) change in > language design... Out of interest, is there a theoretical reason why types shouldn't contain values, or is it just because it's a lot of work to change the compiler? Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment Perl4Caml lets you use any Perl library in your type-safe Objective CAML programs. http://www.merjis.com/developers/perl4caml/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners