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 CAA32089; Wed, 3 Jul 2002 02:39:46 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 CAA32158 for ; Wed, 3 Jul 2002 02:39:46 +0200 (MET DST) Received: from leia.mandrakesoft.com (office.mandrakesoft.com [195.68.114.34]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g630djb23167; Wed, 3 Jul 2002 02:39:45 +0200 (MET DST) Received: by leia.mandrakesoft.com (Postfix, from userid 505) id DDC6A3EF1; Wed, 3 Jul 2002 02:39:02 +0200 (CEST) To: Pierre Weis Cc: caml-list@inria.fr Subject: Re: [Caml-list] simple typing question References: <200207022059.WAA29845@pauillac.inria.fr> From: Pixel Date: 03 Jul 2002 02:39:02 +0200 In-Reply-To: <200207022059.WAA29845@pauillac.inria.fr> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Pierre Weis writes: > > what about changing the semantic of partial application, restoring > > eta-equivalence: a function is not evaluated unless every arguments > > are given: > > Could you precisely state this notion ? In the presence of higher > order functions and imperative features, this does not appear to be > simple and evident to me... well, wrap every functions: # let make_toggle_ () = let r = ref [] in fun x -> let old = !r in r := x; old with # let make_toggle a b = make_toggle_ a b based on the number of parameters of functions (given by the type). This disables evaluation of a function until every parameters are provided. The program transformation involved is something like: let t = foo in fun x -> bar gives fun x -> let t = foo in bar ie (fun t -> (fun x -> bar)) foo gives (fun x -> (fun t -> bar) foo) > (Let alone recursive functions and types as in > $ ocaml -rectypes > # let rec print x = print_int x; print;; > val print : int -> 'a as 'a = > # print 1 2 3;; > 123- : int -> 'a as 'a = of course it doesn't work nicely for this since the "number of parameters" doesn't mean anything, so you can't know when you can start evaluating. ------------------- 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