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 KAA07716; Thu, 25 Apr 2002 10:56:06 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA07644 for ; Thu, 25 Apr 2002 10:56:05 +0200 (MET DST) Received: from verdot.inria.fr (verdot.inria.fr [128.93.11.7]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3P8u4T21481 for ; Thu, 25 Apr 2002 10:56:04 +0200 (MET DST) Received: (from ddr@localhost) by verdot.inria.fr (8.9.3/8.9.3) id KAA00778 for caml-list@inria.fr; Thu, 25 Apr 2002 10:55:59 +0200 Date: Thu, 25 Apr 2002 10:55:59 +0200 From: Daniel de Rauglaudre To: caml-list@inria.fr Subject: Re: [Caml-list] How to read three integers from a text-file... ? Message-ID: <20020425105559.C392@verdot.inria.fr> References: <15557.14957.358556.545541@absurd.mimuw.edu.pl> <20020424212316.GA26318@cs.net.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020424212316.GA26318@cs.net.pl>; from zielony@cs.net.pl on Wed, Apr 24, 2002 at 11:23:16PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, On Wed, Apr 24, 2002 at 11:23:16PM +0200, Tomasz Zielonka wrote: > 3) Create CamlP4 macro/(syntax extension) which will expand to > 'let's binding subsequent ints to given names. Something like: > > READINTS(a, b, c, d) I think that it should be possible to have a Camlp4 syntax extension to have the equivalent of the C function scanf. I can try to implement that, if people are interested. BTW, it is perfectly possible to write printf as a Camlp4 syntax extension not using the special type "format". In such an implementation, "printf" is a keyword always followed by a string. Camlp4 analyses the string and generates calls to print_string, print_int, and so on. The result is normally typed by OCaml. -- Daniel de RAUGLAUDRE daniel.de_rauglaudre@inria.fr http://cristal.inria.fr/~ddr/ ------------------- 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