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 IAA27743; Thu, 2 May 2002 08:50:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA27738 for caml-list@pauillac.inria.fr; Thu, 2 May 2002 08:50:04 +0200 (MET DST) 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 UAA21262 for ; Wed, 1 May 2002 20:22:26 +0200 (MET DST) Received: from mallaury.noc.nerim.net (mallaury.noc.nerim.net [62.4.17.82]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g41IMMX20670 for ; Wed, 1 May 2002 20:22:26 +0200 (MET DST) Received: from Samaris (unknown [80.65.225.191]) by mallaury.noc.nerim.net (Postfix) with ESMTP id 706CF62D1B for ; Wed, 1 May 2002 20:02:12 +0200 (CEST) Received: from fare by Samaris with local (Exim 3.35 #1) id 172yPN-0003VR-00 for caml-list@inria.fr; Wed, 01 May 2002 20:00:53 +0200 Date: Wed, 1 May 2002 20:00:53 +0200 From: Francois-Rene Rideau To: caml-list@inria.fr Subject: [Caml-list] printf and scanf Message-ID: <20020501180052.GA13445@hell.mine.nu> Reply-To: Francois-Rene Rideau Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.28i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jerome Marant wrote: There are some cases where you may know the format string only at runtime; the most obvious example is internationalization through something like gettext. Rather, the format strings are known at compile-time, but you don't know which string will be used. So you can precompile all strings, and select the right formatter at run-time. Even if you want to do things at runtime, you can compile the default string at compile-time, and then you know the type to expect. Switching strings can then be done in a type-safe way: throw an exception if the type of the replacement string's compiled printer doesn't match. You'll need this type of mechanism, anyway. [ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ] [ TUNES project for a Free Reflective Computing System | http://tunes.org ] Guns & bullets don't kill people -- blood loss and organ damage kills people. ------------------- 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