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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 42E39BBC1 for ; Sun, 27 Apr 2008 08:59:01 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJLAE0hbucRE/2dsb2JhbACpWA X-IronPort-AV: E=Sophos;i="4.25,712,1199660400"; d="scan'208";a="25557886" Received: from post.literal.si ([91.185.196.68]) by mail4-smtp-sop.national.inria.fr with ESMTP; 27 Apr 2008 08:59:01 +0200 Received: from localhost (post.literal.si [91.185.196.68]) by post.literal.si (Postfix) with ESMTP id 11C4310E4A1B for ; Sun, 27 Apr 2008 08:59:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at literal.si Received: from post.literal.si ([91.185.196.68]) by localhost (post.literal.si [91.185.196.68]) (amavisd-new, port 10024) with ESMTP id oqpYXj-Fm+04 for ; Sun, 27 Apr 2008 08:58:57 +0200 (CEST) Received: from [192.168.1.119] (BSN-77-148-136.static.dsl.siol.net [193.77.148.136]) by post.literal.si (Postfix) with ESMTP id 76AA110E4A1A for ; Sun, 27 Apr 2008 08:58:57 +0200 (CEST) Message-ID: <48142430.9000705@andrej.com> Date: Sun, 27 Apr 2008 08:58:56 +0200 From: Andrej Bauer Reply-To: Andrej.Bauer@andrej.com User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: Caml Subject: Re: [Caml-list] [OSR] Standard syntax extensions ? References: <1209052182.6180.35.camel@Blefuscu> <74cabd9e0804251337m40811532yb359710630cdbdfd@mail.gmail.com> <20080426074157.GA15640@annexia.org> <74cabd9e0804261432o116f4db5w2f5777496da17d94@mail.gmail.com> In-Reply-To: <74cabd9e0804261432o116f4db5w2f5777496da17d94@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; andrej:01 andrej:01 syntax:01 infix:01 syntax:01 corresponds:01 notation:01 notation:01 type-safe:01 ocaml:01 compiler:01 type-safe:01 ocaml:01 semantics:01 semantics:01 Arthur Chan wrote: > That > said, there are some of us who feel that that the python infix syntax is > clearer, and as it corresponds more directly to the mathematical > notation, it is just as provably correct as the List.mem notation is. > If reusing "in" is a big deal, then maybe we could do "in_list" or > "inlist"? That'd be more type-safe too. Just a small correction, if you will alow me. When we speak of correctness of a programming language we do not say that "syntax is provably correct" but rather that the "implementation is correct". For example, we could say "Ocaml has a correct compiler" in the sense that type-safe programs don't explode (which is false), or "functional core of Ocaml has correct operational semantics" with respect to standard domain-theoretic denotational semantics. But we do not say "the mem syntax is provably correct". Actually, the whole phrase "provably correct" is often misused in computer science, at least the way I understand it. If you prove something then it is "proved correct", while a thing is "provably correct" if we _could_ prove it correct. Perhaps a native speaker of English can clarify this point. > The python syntax goes further than just the "in" bit, in fact. They > can do list comprehensions like [for x in blah if f(x)]. Now every > functional guru will recognize this immediately as the bastardization of > List.filter. While it'd be nice to have that, I come across List.filter > much less than List.exists/mem. I rather like the Python comprehension syntax, as well as Haskell's. I also really like Haskell's infix notation x `op` y. > Whatever.... it's just a minor quibble, but this thread was about > syntax extensions, after all. Isn't everything on this list a minor quibble? ;-) Best regards, Andrej