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=1.3 required=5.0 tests=AWL,RCVD_IN_WHOIS_BOGONS autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C7305BC6B for ; Fri, 29 Jun 2007 21:00:07 +0200 (CEST) Received: from sdmx1.scea.com (sdmx1.scea.com [160.33.44.36]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5TJ06Ke030407 for ; Fri, 29 Jun 2007 21:00:07 +0200 Received: from edenfox.989studios.com (edenfox.989studios.com [160.33.45.60]) by sdmx1.scea.com (8.13.6/8.13.1) with ESMTP id l5TIxSdW024333; Fri, 29 Jun 2007 11:59:28 -0700 X-Envelope-From: X-Envelope-To: X-Envelope-To: Received: from postal1-dog.naughtydog.com (testmail.naughtydog.com [10.15.0.5]) by edenfox.989studios.com (8.13.7/8.13.7/SCEAint-1.0) with ESMTP id l5TIxPOp014375; Fri, 29 Jun 2007 11:59:27 -0700 Received: from [127.0.0.1] ([150.0.6.116]) by postal1-dog.naughtydog.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 29 Jun 2007 11:58:17 -0700 Message-ID: <46855536.90409@naughtydog.com> Date: Fri, 29 Jun 2007 11:53:42 -0700 From: Pal-Kristian Engstad User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: skaller Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] let int = ?([' ' '\t'] '-') digits+ References: <200706291639.39529.jon@ffconsultancy.com> <1183141769.5305.22.camel@rosella.wigram> In-Reply-To: <1183141769.5305.22.camel@rosella.wigram> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 29 Jun 2007 18:58:17.0291 (UTC) FILETIME=[73FCD1B0:01C7BA7F] X-Scanned-By: MIMEDefang 2.48 on 160.33.44.36 X-Scanned-By: MIMEDefang 2.62 on 160.33.45.60 X-BorderEnvelope-To: X-BorderEnvelope-To: X-Miltered: at concorde with ID 468556B6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; pke:01 0100,:01 ocaml's:01 lexer:01 dog:98 parsed:01 wrote:01 wrote:01 caml-list:01 int:01 graphics:02 pal-kristian:03 let:03 engstad:04 engstad:04 I think you all misunderstand his proposal. He wants: q - 1 => Add(q, -1) q -1 => Apply(q, -1) q-1 => Add(q, -1) In other words, a space followed by a negative, followed by a number is to be parsed as a number. PKE. skaller wrote: > On Fri, 2007-06-29 at 16:39 +0100, Jon Harrop wrote: > >> If OCaml's lexer handled numbers of this format, would it be possible to >> write: >> >> f -1 -2 >> >> to mean: >> >> f (-1) (-2) >> >> rather than: >> >> f - 1 - 2 >> >> Is this a good idea? >> > > No, I don't think so, because > > -1 > > and > > - 1 > > would then be distinct, and there's be confusion with: > > x-1 > > which would actually mean > > x (-1) > > rather than > > x - 1 > > That would break reams of code .. ;( > > -- Pål-Kristian Engstad (engstad@naughtydog.com), Lead Graphics & Engine Programmer, "Uncharted"-team, Naughty Dog, Inc., 1601 Cloverfield Blvd, 6000 North, Santa Monica, CA 90404, USA. Ph.: (310) 633-9112. "Most of us would do well to remember that there is a reason Carmack is Carmack, and we are not Carmack.", Jonathan Blow, 2/1/2006, GD Algo Mailing List