From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8DDF0BC28 for ; Fri, 5 Nov 2004 19:28:30 +0100 (CET) Received: from ryxa.irisa.fr (ryxa.irisa.fr [131.254.50.45]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iA5ISUAS006116 for ; Fri, 5 Nov 2004 19:28:30 +0100 Received: (from pad@localhost) by ryxa.irisa.fr (8.11.6/8.11.6) id iA5ISTl02857; Fri, 5 Nov 2004 19:28:29 +0100 From: pad@ryxa.irisa.fr To: "Wolfgang =?iso-8859-1?q?M=FCller?=" Cc: , , Subject: Re: [Caml-list] [Too hard?] Print values like the toplevel's printerI Reply-To: padiolea@irisa.fr References: <200411051323.13339.wolfgang.mueller2@uni-bayreuth.de> <1065.80.8.0.152.1099661485.squirrel@80.8.0.152> <200411051454.13606.wolfgang.mueller2@uni-bayreuth.de> <35177.217.84.62.245.1099678046.squirrel@btn1x1.inf.uni-bayreuth.de> Date: 05 Nov 2004 19:28:29 +0100 In-Reply-To: <35177.217.84.62.245.1099678046.squirrel@btn1x1.inf.uni-bayreuth.de> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 418BC64E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; irisa:01 caml-list:01 toplevel's:01 criticizing:01 toplevel:01 ocaml:01 printf:01 exn:01 haskell:01 overloading:01 toplevel:01 typecheck:01 compile-time:01 cheers:01 caml-list:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.0 X-Spam-Level: "Wolfgang Müller" writes: > > why don't you like this solution ? is it because it is slow ? ugly ? > > I think your solution gives me the feeling that there must be something > simpler than that. :) > > This is not criticizing you, it is rather a question to the Caml people, > like e.g. X. Leroy and colleagues and/or the ExtLibs: > > (Why?) is there no really simple way getting the print functionality of > the standard toplevel? Here is my 50 cent: First because the type of this function will be wierd, print: 'a -> string (of course there are other wierd stuff in Ocaml such as the type of printf, or the type of exn) Haskell have solved this problem by introducing overloading (and the deriving Show) Secondly it would requires to add type information in the code. The toplevel have to maintain more information than the native code program (which leads to less efficiency). One of the advance of ML over Lisp is that it is strongly typed which allows to have code that dont have anymore type information and typecheck. All is done at compile-time. > > Cheers, > Wolfgang > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs