From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 569B1BBCA for ; Thu, 28 Feb 2008 17:47:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFl0xkfB/BYXhWdsb2JhbACBVo8bAQEBCAQGDxMHnGQ X-IronPort-AV: E=Sophos;i="4.25,420,1199660400"; d="scan'208";a="9714682" Received: from smtp25.orange.fr ([193.252.22.23]) by mail3-smtp-sop.national.inria.fr with ESMTP; 28 Feb 2008 17:47:28 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2511.orange.fr (SMTP Server) with ESMTP id B64C51C00088 for ; Thu, 28 Feb 2008 17:47:27 +0100 (CET) Received: from localhost.localdomain (Mix-Lyon-303-1-107.w193-248.abo.wanadoo.fr [193.248.43.107]) by mwinf2511.orange.fr (SMTP Server) with ESMTP id 04A161C00087 for ; Thu, 28 Feb 2008 17:47:26 +0100 (CET) X-ME-UUID: 20080228164727191.04A161C00087@mwinf2511.orange.fr Date: Thu, 28 Feb 2008 16:47:37 +0100 From: Fabrice Marchant To: caml-list@yquem.inria.fr Subject: Please a simple Camlp5 example Message-ID: <20080228164737.45250e33@orange.fr> X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.7; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; camlp:01 string:02 string:02 macro:03 let:03 implement:06 bishop:08 bishop:08 function:08 function:08 fabrice:08 fabrice:08 rather:08 example:10 example:10 Hi ! Aware that this belongs to beginners-list, I first posted there three weeks ago, but without any answer : I bet this kind of code should be rather common : let string_of_piece_type = function King -> "King" | Queen -> "Queen" | Rook -> "Rook" | Bishop -> "Bishop" | Knight -> "Knight" | Pawn -> "Pawn" Please have you got an example where the macro helps to implement such kind of "string_of_type" function ? Thanks, Fabrice