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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 95EE1BBC1 for ; Thu, 10 Apr 2008 22:35:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocAAA4X/kfAXQInnWdsb2JhbACBXY9wAQEBAQEIDgeaFg X-IronPort-AV: E=Sophos;i="4.25,637,1199660400"; d="scan'208";a="9445975" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Apr 2008 22:35:39 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m3AKZc22019289 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 10 Apr 2008 22:35:39 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AowAANgW/keAArkpjWdsb2JhbACBXY9wAQEBAQkFCQUYmX4 X-IronPort-AV: E=Sophos;i="4.25,637,1199660400"; d="scan'208";a="24860300" Received: from chokecherry.srv.cs.cmu.edu ([128.2.185.41]) by mail4-smtp-sop.national.inria.fr with ESMTP; 10 Apr 2008 22:35:38 +0200 Received: from stratocaster.home (c-71-199-104-241.hsd1.pa.comcast.net [71.199.104.241]) (authenticated bits=0) by chokecherry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id m3AKZaGT000572 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 10 Apr 2008 16:35:36 -0400 (EDT) Received: from ecc by stratocaster.home with local (Exim 4.69) (envelope-from ) id 1Jk3Ue-0006J1-Ff for caml-list@inria.fr; Thu, 10 Apr 2008 16:35:36 -0400 Date: Thu, 10 Apr 2008 16:35:36 -0400 From: Eric Cooper To: caml-list@inria.fr Subject: Re: [Caml-list] break and continue for OCaml Message-ID: <20080410203536.GA23529@stratocaster.home> Mail-Followup-To: caml-list@inria.fr References: <5b0248170804091859s75c3f725s2db53f48fba6735c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5b0248170804091859s75c3f725s2db53f48fba6735c@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Miltered: at concorde with ID 47FE7A1A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 bool:01 syntax:01 semantics:01 10,:98 seo:98 wrote:01 caml-list:01 exceptions:01 expressive:01 imperative:01 loops:02 structures:02 functional:02 On Thu, Apr 10, 2008 at 10:59:16AM +0900, Sanghyeon Seo wrote: > I have the first cut of patch to implement break and continue inside > for and while loops for OCaml. > ... > What do you think? Yuck. It adds more imperative baggage to the language, going against its "mostly functional" style. And it doesn't add any expressive power, since you can easily use exceptions, or bool refs as in Pascal, to achieve the same effect. The syntax and semantics would become more much complicated and irregular. As others have pointed out, it's not even clear what a lot of cases should mean. If you want richer control structures, continuations and call/cc would be much more in the functional spirit. -- Eric Cooper e c c @ c m u . e d u