Version française
Home     About     Download     Resources     Contact us    
Browse thread
caml: camlp4 revised syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tmp123@m...
Subject: caml: camlp4 revised syntax
Hello,

First of all, thanks to all people who develops this language and 
related tools, and to people who supports them using it.

I decided to use it in several developments. When finished, the 
developed modules will be made public, if they are enough generic (best 
place to publish it?)

Two points still causing some troubles:

1) The internal integer coding:

It seems that an integer of value "x" is internally stored like "2x*1" ( 
x shift 1 or 1 ). That is a loss of performance, not only when doing 
calculations, but also, by example, when using the integer as index of a 
string character, ... . Usage of native-int doesn't improves the subject.

2) Syntax:

It seems better to use the camlp4 revised syntax than the usual one. The 
reason is, by example, to skip this kind of errors:

initial version:
a1;
a2;
a3;
...

change to forget all exceptions produced by "a1": next source is 
incorrect with normal syntax (at execution time), but correct with 
revised one:

try
  a1
with
  _ -> ();
a2;
a3;

However, the revised syntax has a paradox. An "if" statement is, usually:

if ... then (
...
) else (
...
)

while a "for" statement can be:

for ... do
...
done

or

for ... do {
...
}

but not the expected one:
for ... (
)

why not a "for" that, as "let", "if" or "value", applies only to the 
next statment (or grouped list of them)? Knows someone if it is very 
dificult to modify the syntax to accept this?

Thanks again.

PS: direct mail to this address is filtered. To skip the filter, add 
word "caml" to the subject of the mail.