Version française
Home     About     Download     Resources     Contact us    
Browse thread
stupid q(2): camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] stupid q(2): camlp4
On Wed, Nov 12, 2008 at 04:13:00PM +0300, Anastasia Gornostaeva wrote:
> Hello.
> 
> Readihg http://martin.jambon.free.fr/extend-ocaml-syntax.html, I
> attempt to solve the exercise from chapter 13: 
> 
> "Suggested exercise: implement and test a syntax extension which supports a
>  where construct. For instance,
> 
>  a + b where a = 1 and b = 2
> 
>  means
> 
>  let a = 1 and b = 2 in a + b

You could cheat and have a look at pa_where ...

http://bluestorm.info/camlp4/pa_where/list.php
http://bluestorm.info/camlp4/pa_where/pa_where.ml.html

(Is bluestorm running a gopher server?)

Rich.

-- 
Richard Jones
Red Hat