caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: rich@annexia.org
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Constructors are not functions
Date: Wed, 07 Oct 2009 01:31:10 +0900 (JST)	[thread overview]
Message-ID: <20091007.013110.71115501.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <20091006152404.GA19326@annexia.org>

From: Richard Jones <rich@annexia.org>
> It would be so nice to have a macro tool which was aware of types, but
> that tool isn't camlp4.  There are probably theoretical problems with
> this, but having a "give_me_the_type_of (ocaml_subexpression)"
> function would be awesome indeed.

The trouble here is that the type of the subexpression depends on its
context... so that you would need to have already typed the whole
expression to do that. If you are extending the syntax, this is a
rather strong requirement. On the other hand, if you design your
extension so that the program is typable before transforming it, then
it would not be theoretically impossible to have campl4 read the
dumped types and use them for an extra pass. You would still need to
type everything once more after that for safety.

Jacques Garrigue


  reply	other threads:[~2009-10-06 16:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-06 12:01 Chantal KELLER
2009-10-06 12:19 ` [Caml-list] " Philippe Wang
2009-10-06 12:38   ` Jon Harrop
2009-10-06 13:38     ` Richard Jones
2009-10-10 11:49     ` blue storm
2009-10-06 12:45 ` David Allsopp
2009-10-06 12:46   ` David Allsopp
2009-10-06 13:14   ` Jim Farrand
2009-10-06 13:51     ` Michel Mauny
2009-10-06 13:15   ` Jon Harrop
2009-10-06 14:04     ` David Allsopp
2009-10-06 14:51       ` Jon Harrop
2009-10-06 15:24       ` Richard Jones
2009-10-06 16:31         ` Jacques Garrigue [this message]
2009-10-08 12:37       ` Goswin von Brederlow
2009-10-09  6:29         ` David Allsopp
2009-10-10  6:16           ` Goswin von Brederlow
2009-10-06 13:18 ` Gerd Stolpmann
2009-10-06 15:50 ` Jérémie Dimino
2009-10-06 21:55   ` blue storm

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=20091007.013110.71115501.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@yquem.inria.fr \
    --cc=rich@annexia.org \
    /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;
as well as URLs for NNTP newsgroup(s).