Version française
Home     About     Download     Resources     Contact us    
Browse thread
Where are the AST specs?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Loup Vaillant <loup.vaillant@g...>
Subject: Re: [Caml-list] Where are the AST specs?
> BTW camlp4 provides a simple macro system through a dynamic syntax
> extension. It features DEFINE, IFDEF, INDEF, and INCLUDE.

Actually, I didn't meant C macros.

> However camlp4 is itself a powerful way to manage the OCaml syntax as
> AST through it's quotation system.

That is what I meant. However, I want it as simple as possible.

> Have you a simple specification of what you want for OCaml (or some examples).

For instance, I woud have wanted
(defun f x y z (+ x (* y z)))

expanded into:
(value f (fun (x y z) (+ x (* y z)))

Through a simple macro.
another example:
(+ x y z)

(plus (plus x y) z)

I havent specified the macro system yet. I think I shoud wait untill i
have written a reader. (And therefore specified an AST)