Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Pierre Weis <Pierre.Weis@inria.fr>
To: larson@leopard.cs.byu.edu (Trent Larson)
Cc: caml-list@inria.fr
Subject: Re: ocaml prefix syntax
Date: Thu, 29 May 1997 16:52:07 +0200 (MET DST)	[thread overview]
Message-ID: <199705291452.QAA12728@pauillac.inria.fr> (raw)
In-Reply-To: <199705281819.AA022293558@lynx.cs.byu.edu> from Trent Larson at "May 28, 97 12:19:18 pm"

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







      reply	other threads:[~1997-05-29 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-28 18:19 Trent Larson
1997-05-29 14:52 ` Pierre Weis [this message]

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=199705291452.QAA12728@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=larson@leopard.cs.byu.edu \
    /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