From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA08786 for caml-redistribution; Mon, 5 Oct 1998 17:52:10 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA13973 for ; Mon, 5 Oct 1998 16:27:19 +0200 (MET DST) Received: from post.tepkom.ru (post.tepkom.ru [195.19.226.38]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id QAA21921 for ; Mon, 5 Oct 1998 16:27:14 +0200 (MET DST) Received: from localhost (msk@localhost) by post.tepkom.ru (8.8.7/8.8.7) with ESMTP id SAA28518 for ; Mon, 5 Oct 1998 18:27:18 +0400 Date: Mon, 5 Oct 1998 18:27:18 +0400 (MSD) From: Anton Moscal To: caml-list@inria.fr Subject: Local definitions In-Reply-To: <199809280951.LAA27562@pauillac.inria.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis Hello! Why CaML doesn't not allow the following style of local definitions: declare ... in with following translation: let module Temp = struct ... let result = end in Temp.result or, the second variant: simply allow declaration of types, exceptions, open statements and others in "let-in" expressions with the same translation: let find x vec = let exception Return of int in try Array.iteri (fun i elem -> if elem = x then raise (Return i)) vec; None with Return i -> Some i can be translated as: let find x vec = let module T = struct exception Return of int let res = try Array.iteri (fun i elem -> if elem = x then raise (Return i)) vec; None with Return i -> Some i end in T.res This syntax allow more convenient notation for local types, classes, exceptions and others definitions, than explicit usage of local modules. Anton E. Moscal msk@vvv.niimm.spb.ru