Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* ocaml prefix syntax
@ 1997-05-28 18:19 Trent Larson
  1997-05-29 14:52 ` Pierre Weis
  0 siblings, 1 reply; 2+ messages in thread
From: Trent Larson @ 1997-05-28 18:19 UTC (permalink / raw)
  To: caml-list



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.)






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ocaml prefix syntax
  1997-05-28 18:19 ocaml prefix syntax Trent Larson
@ 1997-05-29 14:52 ` Pierre Weis
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre Weis @ 1997-05-29 14:52 UTC (permalink / raw)
  To: Trent Larson; +Cc: caml-list

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







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-05-29 15:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-28 18:19 ocaml prefix syntax Trent Larson
1997-05-29 14:52 ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox