[wg-camlp4] [Caml-devel] Structure/signature attributes suggestion

Drup drupyog+caml at zoho.com
Tue Apr 15 10:48:09 BST 2014


I agree, but the added verbosity with all those additional brackets 
bother me even more, especially for attributes. I wonder if we could 
drop some brackets when there is no added expression : "x at foo" instead 
of "x[@foo]" .

Also, to follow some shortcuts with extension nodes on keyword, would it 
be possible to add those syntax :

1) "let%foo x = 3" => "[%%foo let x = 3]"
Since "let ... " is not an expression (but a toplevel declaration), the 
%foo doesn't work on them.
We could use %% for consistency, but the added symbol doesn't bring any 
added value, since the % character is already specific enough.

2) "( ... )%foo"
It would be equivalent to "begin%foo ... end" or [%foo ... ] but (imho) 
easier on the eyes and closer to a natural ocaml syntax, even it  it's 
not much shorter, character wise.

My use cases for those are top level server and client declarations and 
client values in eliom.

Le 15/04/2014 08:03, Mark Shinwell a écrit :
> On 14 April 2014 16:40, Damien Doligez <damien.doligez at inria.fr> wrote:
>> IIUC, we now have three kinds of attributes:
>>
>> [@foo]   attached to an expression
>> [@@foo]  attached to a structure item
>> [@@@foo] attached to the whole module (with location being significant?)
> Seems like a nice hierarchy, but: doesn't anyone else find this syntax
> increasingly ugly?  I do!
>
> Mark
> _______________________________________________
> wg-camlp4 mailing list
> wg-camlp4 at lists.ocaml.org
> http://lists.ocaml.org/listinfo/wg-camlp4




More information about the wg-camlp4 mailing list