Re: ocaml prefix syntax

From: Pierre Weis (Pierre.Weis@inria.fr)
Date: Thu May 29 1997 - 16:52:07 MET DST


From: Pierre Weis <Pierre.Weis@inria.fr>
Message-Id: <199705291452.QAA12728@pauillac.inria.fr>
Subject: Re: ocaml prefix syntax
In-Reply-To: <199705281819.AA022293558@lynx.cs.byu.edu> from Trent Larson at "May 28, 97 12:19:18 pm"
To: larson@leopard.cs.byu.edu (Trent Larson)
Date: Thu, 29 May 1997 16:52:07 +0200 (MET DST)

> CAML allows me to define the following prefix identifier:
>
> let prefix !~ = ....
>
> Objective CAML documentation says it allows ! (and ? and ~) as prefix
> operators, too, but I get "Characters 11-13: Syntax error" when I try.
> How do I use prefix characters in OCAML?
>
> Trent
>
> (Apologies for no French.)

You should enclose your infix operator into parens, instead of using
the prefix keyword:

# let (!~) x = x + 1;;
val !~ : int -> int = <fun>

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:11 MET