From: Jacques Carette <carette@mcmaster.ca>
To: Damien Doligez <damien.doligez@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Syntax vs Operators
Date: Tue, 23 Aug 2005 14:05:03 -0400 [thread overview]
Message-ID: <430B654F.4080908@mcmaster.ca> (raw)
In-Reply-To: <3C37507F-C2C9-4E75-AC82-0CF742D87A18@inria.fr>
Damien Doligez wrote:
> On Aug 22, 2005, at 17:55, Jacques Carette wrote:
>
>> I have been going through the documentation, trying to figure out
>> which constructs in Ocaml are syntactic (like :: seems to be) and
>> cannot be oer-ridden, and others like + which are values in
>> Pervasives. Is there a simple way to find out which language
>> constructs are purely syntactic?
>
>
> You should look a the lexer documentation:
> < http://caml.inria.fr/pub/docs/manual-ocaml/manual009.html >,
> in the section titled "Prefix and Infix Symbols", you will get the
> syntax of
> all the user-definable symbols. Some of them are predefined, but you
> are
> guaranteed to be able to override them. You should avoid overriding
> the ones
> that are listed as keywords (in the next section), even if some of them
> are actually redefinable in the current implementations.
>
Actually, the whole point of this question is that I want to
redefine/override them - and I wanted to find out which I could not. I
know I can override + if I want, I want to know about the ones like ::
which have a pre-defined meaning but can not be overridden. By
carefully reading sections 9 and 15 of the manual, I have managed to
extract this information - I was just hoping that there was something
simpler that I had somehow overlooked.
The point is to see how much of a DSL I can create in Ocaml, using Ocaml
syntax, by using lots of Functors. Very much in the spirit of the
Lua-ML interpreter in fact, except that I want to use Caml syntax rather
than having to parse a new language. Or I may decide to adapt the
camlp4 macros for the ``revised syntax'' for my purposes.
Jacques
next prev parent reply other threads:[~2005-08-23 18:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-22 15:55 Jacques Carette
2005-08-23 10:16 ` [Caml-list] " Damien Doligez
2005-08-23 18:05 ` Jacques Carette [this message]
2005-08-23 19:42 ` Damien Doligez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=430B654F.4080908@mcmaster.ca \
--to=carette@mcmaster.ca \
--cc=caml-list@inria.fr \
--cc=damien.doligez@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox