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 SAA05979; Thu, 17 Oct 2002 18:39:21 +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 SAA06027 for ; Thu, 17 Oct 2002 18:39:20 +0200 (MET DST) Received: from str12.sobor.org (adsl-63-198-183-99.dsl.snfc21.pacbell.net [63.198.183.99]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9HGdID16508; Thu, 17 Oct 2002 18:39:18 +0200 (MET DST) Received: from localhost (localhost.localdomain [127.0.0.1]) by str12.sobor.org (Postfix) with ESMTP id 36F9810C5C; Thu, 17 Oct 2002 12:28:32 -0400 (EDT) Date: Thu, 17 Oct 2002 09:28:31 -0700 (PDT) Message-Id: <20021017.092831.59477872.avv@quasar.ipa.nw.ru> To: daniel.de_rauglaudre@inria.fr Cc: caml-list@inria.fr Subject: [Caml-list] a quick question on camlp4 From: "Alexander V.Voinov" In-Reply-To: <20021017182648.G32600@verdot.inria.fr> References: <20021017160837.GA29662@cs.unibo.it> <20021017182242.A30465@ouessant.trusted-logic.fr> <20021017182648.G32600@verdot.inria.fr> X-Mailer: Mew version 2.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, For a presentation which I'm about to make, I created a simple (normal) syntax extension to imitate Python loop over a sequnce: iterate with which maps to List.iter . This results in examples like: iterate [1; 2; 3; 4] with function | 2 -> printf "two\n" | n -> printf "%d\n" Is it possible to eliminate the keyword 'function' from this, that is to implement an extension like: iterate with -> | -> ... mapping to List.iter (function -> | -> ...) . I'm asking this just because I don't have time now to investigate this by my own :-). Also, I was thinking about extensions like let sum = fold [10; 20; 30; 40] from 0.0 with | val, sum -> val + sum mapping to fold_left/fold_right. Thank you in advance Alexander ------------------- 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