From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id MAA11962 for caml-redistribution; Mon, 13 Nov 1995 12:41:20 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id OAA13115 for ; Sat, 11 Nov 1995 14:07:50 +0100 From: quercia@u-bourgogne.fr Received: from margaux.inria.fr (margaux.inria.fr [128.93.8.2]) by concorde.inria.fr (8.7.1/8.6.9) with ESMTP id OAA12826 for ; Sat, 11 Nov 1995 14:07:51 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by margaux.inria.fr (8.6.10/8.6.6) with ESMTP id OAA17739 for ; Sat, 11 Nov 1995 14:07:49 +0100 Received: from satie.u-bourgogne.fr (satie.u-bourgogne.fr [192.134.59.2]) by concorde.inria.fr (8.7.1/8.6.9) with SMTP id OAA12822 for ; Sat, 11 Nov 1995 14:07:49 +0100 (MET) Received: by satie.u-bourgogne.fr (AIX 3.2/UCB 5.64/4.03) id AA94394; Sat, 11 Nov 1995 14:08:02 +0100 Date: Sat, 11 Nov 1995 14:08:02 +0100 Message-Id: <9511111308.AA94394@satie.u-bourgogne.fr> To: caml-list@margaux.inria.fr Subject: test with several issues Sender: weis I apologize for my poor english. Please, if you can read french skip the 30 following lines. ------------------------------ "English" text -------------------------------- *match* together with *when* enables to code nicely a test with several issues : match 0 with _ when {condition-1} -> {action-1} | _ when {condition-2} -> {action-2} ... | _ -> {default action} This replaces the construct : if {condition-1} then {action-1} else if {condition-2} then {action-2} ... else {default action} wich seems to me less readable. Annoyingly, one has to provide a value to the match (0 here), but that value won't really be used. Could you support my demand to INRIA so that the next releases of Caml-light and Caml-special-light provide a nicer construct : select when {condition-1} -> {action-1} when {condition-2} -> {action-2} ... otherwise -> {default action} like for example in PL/1 and in Rexx ? ------------------------------ texte Francais -------------------------------- *match* associe avec *when* permet de coder elegament un test a plusieurs cas : match 0 with _ when {condition-1} -> {action-1} | _ when {condition-2} -> {action-2} ... | _ -> {action par defaut} Ceci remplace la construction : if {condition-1} then {action-1} else if {condition-2} then {action-2} ... else {action par defaut} qui me semble moins lisible. L'ennui est qu'il faut donner une valeur a tester a match (ici 0) alors qu'on n'en fera rien. Voulez-vous appuyer ma demande a l'INRIA pour que les prochaines versions de Caml-light et Caml-special-light autorisent une construction encore plus claire : select when {condition-1} -> {action-1} when {condition-2} -> {action-2} ... otherwise -> {action par defaut} qu'on peut trouver par exemple en PL/1 et en Rexx ? ------------------------------------------------------------------------------ Michel Quercia, Laboratoire d'informatique du lycee Carnot 16 bd Thiers 21000 Dijon France e-mail = quercia@u-bourgogne.fr ------------------------------------------------------------------------------