From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pB8ELVwl030141 for ; Thu, 8 Dec 2011 15:21:33 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYBAD3H4E7U436rkWdsb2JhbAApGpo6kC0iAQEBAQkLCwcUAyKBcgEBBAFuCxAFBiUhRRIGEwkIAQmHbAIGI7cZg3eHRASMdBMVAZl1 X-IronPort-AV: E=Sophos;i="4.71,320,1320620400"; d="scan'208";a="122601706" Received: from moutng.kundenserver.de ([212.227.126.171]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Dec 2011 15:21:33 +0100 Received: from office1.lan.sumadev.de (dslb-188-097-005-129.pools.arcor-ip.net [188.97.5.129]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lo3Ka-1R5wo83yyu-00gXls; Thu, 08 Dec 2011 15:21:33 +0100 Received: from gps.dynxs.de (localhost [127.0.0.1]) by office1.lan.sumadev.de (Postfix) with ESMTP id 2BDDAC00C7; Thu, 8 Dec 2011 15:21:32 +0100 (CET) Received: from 84.233.128.147 (SquirrelMail authenticated user gerd) by gps.dynxs.de with HTTP; Thu, 8 Dec 2011 15:21:32 +0100 Message-ID: <0eb782f52b0657238463c6a52b0d37c7.squirrel@gps.dynxs.de> In-Reply-To: <4EE0A6C6.8040703@lri.fr> References: <1323271707.32238.17.camel@arrakis> <4EDF9AAE.5050604@crans.org> <1323279292.32238.48.camel@arrakis> <4EE0A6C6.8040703@lri.fr> Date: Thu, 8 Dec 2011 15:21:32 +0100 From: "Gerd Stolpmann" To: "Romain Bardou" Cc: caml-list@inria.fr User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 (Normal) Importance: Normal X-Provags-ID: V02:K0:8Ojrh7QB6Hv9J1SdV8VEe0CS29Pb6B4ZURhOstw+HIj Rxr+JFv4eXFpZOv0mi8adrvbCI3Pkn98PdoKvbEes7plwKKcAP 8WjFpUaPgJZZ0ZxiauNpADb3QbbXvoyrd/spmopIBfB276yYYG WSAZI7Op7h+xn8U6JTASnQk8Ex2j1+fKE4dycwJCcXOv4YSRvl TuUNsxubxxUOjXHfqvVeo8MGdYTUo+tgEjAkby+sMvME5rdXB3 EFce1v9iZqamcE3je3Vyr4dWw7UTRedwrOwL7JYKg63g5Crifx ZhQX9HPJT7vKE7JjFj3cBZn1nDT3bESuFr7Zt7XC+psPDDaYME HeGz345XSRbN6ggQt8Wtzbmnei6oZGfT0qlKZPkhWaPzARY87o kQrMmuvV+FcRa3sAdGepo2bpZ+mT0rDO1U= Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id pB8ELVwl030141 Subject: Re: [Caml-list] Generic printer patch >>> 2) Could you imagine to generalize it to Format.formatter or to >>> out_channel (without creating a string and concatenating)? Romain >>> Bardou >>> add in the mantis tracker (I can't give you the bugtracking number >>> since >>> mantis "is currently offline for maintenance") a feature wish for a new >>> conversion specification that can print anything. Do you think you can >>> fulfill is dream? > > Here is the feature request I proposed: > > http://caml.inria.fr/mantis/view.php?id=4956 > > Here is the response by Pierre Weis: > > "This is a major feature wish that requires careful thinking and a lot > of work! > > Furthermore, we would not have a completely satisfactory solution in the > end (due to this catch all case that tend to propagate, as far as > you use polymorphic functions). The correct solution to get this feature > in its full glory is a major modification of the type system along the > lines of G'Caml. Well, G'Caml did not appear finally. But this explains why no generic printer has been added so far: There was always the hope to get this feature automatically by some generalization in the compiler. Same for type-safe unmarshalling, and other features needing introspection. On the one hand, these features are badly needed by users. On the other hand, the language designers strive for an excellent solution, and not one that will become obsolete sooner or later. The situation is different today. We'll now have GADTs in the next release, which work quite differently, and which are no replacement for a separate introspection solution (like the one Alain suggests), but could be a clever add-on. So, it has become more likely that the pragmatism wins this time, because it makes the new playground GADTs more enjoyable (in particular when the compiler supports the generation of "standard GADTs" just representing the structure of a type). Gerd > > In short, a natural feature wish in a strongly typed polymorphic > language; we had it in mind for decades; unfortunately, we are not yet > ready to offer it, even in the rather limited extent you proposed." > > In other words: what you did is awesome but I'm not sure that it will be > added in the trunk :( > > Cheers, > > -- > Romain Bardou > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > -- Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de *** Searching for new projects! Need consulting for system *** programming in Ocaml? Gerd Stolpmann can help you.