Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Inline operators in the revised syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jim Farrand <jim@f...>
Subject: [Caml-list] Inline operators in the revised syntax
Hi,

Is there a simple way to define and use an inline operator in the revised
syntax?  It seems they can be defined but not used.

Silly example:

> Objective Caml version 3.06

> Camlp4 Parsing version 3.06

> # value \=== a b = a=b ;
> value ( === ) : 'a -> 'a -> bool = <fun>
> # 1 === 1 ;
> Toplevel input:
> # 1 === 1 ;
>     ^^^
> Parse error: ';' expected after [str_item] (in [phrase])

The equivelent in the old syntax works fine.  (I realise it's probably
possible to use camlp4's grammar extension features to do the same, but
I don't know how to do this, and it seems like overkill when it was so
easy in the old syntax.)

As an aside, do many people actually use the revised syntax?

Kind regards,
Jim

-- 
Jim Farrand
-- 

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners