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 IAA31431; Mon, 22 Oct 2001 08:04:24 +0200 (MET DST) 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 IAA31357 for ; Mon, 22 Oct 2001 08:04:23 +0200 (MET DST) Received: from serveur1-1.labri.u-bordeaux.fr (serveur1-1.labri.u-bordeaux.fr [147.210.8.170]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f9M64MH11390 for ; Mon, 22 Oct 2001 08:04:22 +0200 (MET DST) Received: (from vanicat@localhost) by serveur1-1.labri.u-bordeaux.fr (8.11.2/8.11.2) id f9M64LS02241; Mon, 22 Oct 2001 08:04:21 +0200 X-Authentication-Warning: serveur1-1.labri.u-bordeaux.fr: vanicat set sender to vanicat@labri.u-bordeaux.fr using -f To: caml-list@inria.fr Subject: Re: [Caml-list] =?iso-8859-1?q?D=E9butant?= :) References: <001401c15a82$d238a320$0a00a8c0@agent007st1> From: Remi VANICAT In-Reply-To: Date: 22 Oct 2001 08:04:21 +0200 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.104 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Remi VANICAT writes: > "AgEnT007" writes: > > > Bonjour à tous, > > je viens de me mettre cette aprés midi mëme au language CAML et je bute deja sur un exemple que j'ai trouvé :) > > > > voici ce que j'ai: > > > > let rec exemple_1 f a l = > > if l = [] then a > > else exemple_1 f ( f a (List.hd l)) (List.tl l) ;; > > > > j'ai compris l'utilité d'une telle declaration mais pas celle du > > < a > qui se trouve à la 3eme ligne. > > Quelqu'un pourrait t'il m'éclairer sur la troisieme ligne? > > si l = [1; 2; 3; 4; 5; 6; 7; 8; 9] > > alors exemple_1 f a l va calculer > > (f (f (f (f ... (f (f a 9) 8) ...4) 3) 2) 1) mais qu'est ce que je raconte ? ce que ça calcule c'est (f (f (f (f ... (f (f a 1) 2) ...6) 7) 8) 9) en effet exemple_1 f a [1; 2; 3; 4; 5; 6; 7; 8; 9] = exemple_1 f (f a 1) [2; 3; 4; 5; 6; 7; 8; 9] = exemple_1 f (f (f a 1) 2) [ 3; 4; 5; 6; 7; 8; 9] = .... -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr