Version française
Home     About     Download     Resources     Contact us    
Browse thread
let int = ?([' ' '\t'] '-') digits+
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Robert C Fischer <robert@f...>
Subject: Re: [Caml-list] let int = ?([' ' '\t'] '-') digits+
How would I write f - 1 to mean "one less than the value of f"?

~~ Robert.

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?
>
>