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=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 29D45BBCA for ; Sat, 26 Apr 2008 09:42:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqABAON5EkhQRFuwiGdsb2JhbACRWwEBAQ8gmSE X-IronPort-AV: E=Sophos;i="4.25,710,1199660400"; d="scan'208";a="11477956" Received: from furbychan.cocan.org ([80.68.91.176]) by mail1-smtp-roc.national.inria.fr with ESMTP; 26 Apr 2008 09:41:59 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Jpf2j-00045u-RX; Sat, 26 Apr 2008 08:41:57 +0100 Date: Sat, 26 Apr 2008 08:41:57 +0100 To: Arthur Chan Cc: David Teller , Caml Subject: Re: [Caml-list] [OSR] Standard syntax extensions ? Message-ID: <20080426074157.GA15640@annexia.org> References: <1209052182.6180.35.camel@Blefuscu> <74cabd9e0804251337m40811532yb359710630cdbdfd@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <74cabd9e0804251337m40811532yb359710630cdbdfd@mail.gmail.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; syntax:01 syntax:01 hashtbl:01 python's:01 mylist:01 'list:01 wrote:01 caml-list:01 latex:02 python:03 let:03 chan:04 fri:05 exists:05 extension:06 On Fri, Apr 25, 2008 at 01:37:47PM -0700, Arthur Chan wrote: > Would it be difficult to have python-like syntax for List.exists? Could we > add it to Hashtbl and Array too? I'm not too fond of python's general > sloppiness, but the (x in mylist) syntax seemed very pretty to me. At the > least, it correspondes directly to mathematical syntax (x \in blah, for > Latex ppl). > > Does this already exist in a syntax extension? I'm guessing that there will be ambiguity because you're wanting to add yet another meaning to the reserved word 'in'. However I'm not sure why you don't just use 'List.mem', or even: let mem = List.mem ;; mem 1 [1;2;3] Did I miss something about how the Python syntax works? Rich. -- Richard Jones Red Hat