[wg-camlp4] Why Quotation is a good idea with decent Editor support

Hongbo Zhang hongboz at seas.upenn.edu
Thu Jan 31 16:03:12 GMT 2013


Dear all,

   The functionality of Editor lies in two aspects:
   1. Semantic analysis (auto completion, go to definition, etc)
   2. layout, syntax coloring

For the first part, quotation works perfect with editor support, since when
you goto a delimited
language {:lex| .... |} , the IDE gets enough information to do the
auto-completion. Besides, the
code is *readable, semantics is clear,* you know  the exactly scope where
the language lies.
If you use something like sedlex, I really don't know how to read the code.
It gives you an illusion that
it is normal ocaml, but it is not, should there be anything worse than this?

Also, since any exception to normal oaml is clearly delimited, *you can
select the region, see the expanded*
*code on the fly with the ide support.*

For the second part, namespace came to rescue, for example if we want the
lay out rules still follow
the caml syntax, put the language you defined in Fan.Lang.Caml namespace.
If we want the syntax highlighting
like javascript, we can put it in Fan.Lang.Js namespace, like
http://www.emacswiki.org/emacs/MmmMode
This solves the problem once for all, instead just ignore it


-- 
-- Regards, Hongbo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/wg-camlp4/attachments/20130131/4760415b/attachment.html>


More information about the wg-camlp4 mailing list