From: "Yaron Minsky" <yminsky@gmail.com>
To: "Richard Jones" <rich@annexia.org>
Cc: "Jeremy Yallop" <jeremy.yallop@ed.ac.uk>,
caml-list@inria.fr, dan_mski@hotmail.com
Subject: Re: [Caml-list] Custom lexer in Camlp4
Date: Tue, 24 Jun 2008 12:59:00 -0400 [thread overview]
Message-ID: <891bd3390806240959y1c8f75b2l83dc9c0317676d33@mail.gmail.com> (raw)
In-Reply-To: <20080624151626.GA8424@annexia.org>
[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]
You might want to take a look at an OSP project that is going on this summer
that is aiming to implement something rather similar to what you describe:
http://osp.janestcapital.com/files/delimited-overloading.pdf
y
On Tue, Jun 24, 2008 at 11:16 AM, Richard Jones <rich@annexia.org> wrote:
> On Tue, Jun 24, 2008 at 03:30:23PM +0100, Jeremy Yallop wrote:
> > Ok, I've built a slightly modified clone of PreCast. What's the best
> > way to persuade Camlp4 to use it? The original PreCast seems fairly
> > hardwired, e.g. in the Register module.
>
> If you get an answer to this, please post it. I would love to be able
> to add new integer literals to the language (0UL and so on).
>
> On a related note I had a crazy brainwave that we could use camlp4 to
> use 'ordinary' operators in an overloaded context. Something like:
>
> INT64 (2L * n / 3L)
>
> The INT64(expr) macro would inspect the AST of expr and change + ->
> Int64.add etc. Of course one can do this using the pa_openin macro
> and a module which overrides (+) etc, but maybe this is better? I was
> going to try modifying parts of virt-df to use this syntax to see if
> it would be beneficial.
>
> After writing virt-df which uses mixed int64, int32, int and int63[*]
> types I'm starting to come around to Jon's opinion that some limited
> overloading or type classes or whatever would be worthwhile.
>
> Rich.
>
> [*] int63 is my own type: It turns into an efficient int on 64 bit
> platforms, and is emulated on (now rare) 32 bit platforms. It is
> necessary for virt-df because we want ints which can comfortably hold
> the size (in bytes / sectors / blocks / etc) of a block device. You
> don't really need a 64 bit int for this, but you do need something
> which is bigger than 32 bits.
>
> --
> Richard Jones
> Red Hat
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
[-- Attachment #2: Type: text/html, Size: 2967 bytes --]
next prev parent reply other threads:[~2008-06-24 17:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 13:03 Jeremy Yallop
2008-06-24 14:32 ` [Caml-list] " Nicolas Pouillard
2008-06-24 14:30 ` Jeremy Yallop
2008-06-24 15:16 ` Richard Jones
2008-06-24 15:43 ` Hezekiah M. Carty
2008-06-24 15:54 ` Nicolas Pouillard
2008-06-24 16:04 ` Hezekiah M. Carty
2008-06-24 16:59 ` Yaron Minsky [this message]
2008-06-25 8:41 ` Richard Jones
2008-06-25 9:17 ` Christophe TROESTLER
2008-06-24 15:37 ` Nicolas Pouillard
2008-06-24 15:43 ` Andrej Bauer
2008-06-25 11:53 ` Jeremy Yallop
2008-06-25 12:16 ` Nicolas Pouillard
2008-06-24 16:07 ` Pietro Abate
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=891bd3390806240959y1c8f75b2l83dc9c0317676d33@mail.gmail.com \
--to=yminsky@gmail.com \
--cc=caml-list@inria.fr \
--cc=dan_mski@hotmail.com \
--cc=jeremy.yallop@ed.ac.uk \
--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).