caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pal-Kristian Engstad <pal_engstad@naughtydog.com>
To: skaller <skaller@users.sourceforge.net>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] let int = ?([' ' '\t'] '-') digits+
Date: Fri, 29 Jun 2007 11:53:42 -0700	[thread overview]
Message-ID: <46855536.90409@naughtydog.com> (raw)
In-Reply-To: <1183141769.5305.22.camel@rosella.wigram>

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




  reply	other threads:[~2007-06-29 19:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 15:39 Jon Harrop
2007-06-29 15:56 ` [Caml-list] " Robert C Fischer
2007-06-29 16:32   ` Brian Hurt
2007-06-29 16:40   ` Jon Harrop
2007-06-29 18:21     ` Philippe Wang
2007-06-29 15:57 ` pzimmer
2007-06-29 16:35   ` Robert C Fischer
2007-06-29 16:41   ` Jon Harrop
2007-06-29 17:57 ` Stefan Monnier
2007-06-29 18:11   ` [Caml-list] " Robert C Fischer
2007-06-29 21:05     ` Jon Harrop
2007-06-29 18:29 ` [Caml-list] " skaller
2007-06-29 18:53   ` Pal-Kristian Engstad [this message]
2007-06-29 19:21     ` Daniel Bünzli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46855536.90409@naughtydog.com \
    --to=pal_engstad@naughtydog.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).