From: "Loup Vaillant" <loup.vaillant@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Misunderstandings about the AST
Date: Tue, 27 Mar 2007 15:44:16 +0200 [thread overview]
Message-ID: <6f9f8f4a0703270644r52490af8ieeedb8f474b95f8e@mail.gmail.com> (raw)
Good afternoon,
Pursuing my goal of making a lisp syntax for Ocaml, I began to take a
close look at the AST (Ocaml-3.09.3/parsing/parsetree.mli). I don't
understand some of the constructors in the type expression_desc:
| Pexp_function of label * expression option * (pattern * expression) list
What is the "expression option" for?
| Pexp_construct of Longident.t * expression option * bool
What is the boolean for?
| Pexp_variant of label * expression option
What is a "variant"? (Does not seem to be related to variant types, as
"Pexp_construct" is used for them)
| Pexp_record of (Longident.t * expression) list * expression option
What is the "expression option" for?
| Pexp_constraint of expression * core_type option * core_type option
Why two "core_type option", instead of just a "core_type"?
| Pexp_when of expression * expression
Why not "pattern * expression"?
| Pexp_send of expression * string
What does "Pexp_send" stand for?
| Pexp_new of Longident.t
What does "Pexp_new" stand for?
| Pexp_setinstvar of string * expression
What does "Pexp_setinstvar" stand for?
| Pexp_override of (string * expression) list
What does "Pexp_override" stand for?
| Pexp_lazy of expression
Why does this constructor even exist? Are some specific optimizations made?
| Pexp_poly of expression * core_type option
What does "Pexp_poly" stand for?
Phew, I am done, for now. Except one question: is the AST likely to
change, or else is it likely to be standardized (so any freak like me
can try her fancy syntax)?.
By the way, I would like to see documentation about the AST (or other
related part of Ocaml's implementation). The sources are great, and
highly readable, but I am afraid of hitting a wall.
Thanks
Loup
next reply other threads:[~2007-03-27 13:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 13:44 Loup Vaillant [this message]
2007-03-27 14:06 ` [Caml-list] " Nicolas Pouillard
[not found] ` <6f9f8f4a0703271034m3be7cdc8t43708c8a8a2144ce@mail.gmail.com>
2007-03-28 6:42 ` Loup Vaillant
2007-03-28 12:30 ` Nicolas Pouillard
2007-03-27 14:13 ` Jeremy Yallop
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=6f9f8f4a0703270644r52490af8ieeedb8f474b95f8e@mail.gmail.com \
--to=loup.vaillant@gmail.com \
--cc=caml-list@yquem.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