From: Ashish Agarwal <agarwal1975@gmail.com>
To: Roland Zumkeller <roland.zumkeller@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] ignoring toplevel phrases?
Date: Fri, 26 Jun 2009 13:44:21 -0400 [thread overview]
Message-ID: <d8be5ae20906261044n578aeabeg1f09b22d8d87268a@mail.gmail.com> (raw)
In-Reply-To: <d02dcb040906252122w522022bbu69cdb5f5ade6ccf4@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1286 bytes --]
Just curious, why do you want this?
On Fri, Jun 26, 2009 at 12:22 AM, Roland Zumkeller <
roland.zumkeller@gmail.com> wrote:
> Hi,
>
> Is it possible to modify the toplevel's behavior such that it silently
> ignores any re-definitions of already bound identifiers (without
> recompiling)? I would like to achieve the following:
>
> # let x = 0;;
> val x : int = 0
> # let x = 1;;
> # x;;
> - : int = 0
>
> The following code is supposed to replace all toplevel phrases by
> "();;" during parsing (just as an experiment, it renders the toplevel
> useless of course).
>
> let original = !Toploop.parse_toplevel_phrase;;
>
> Toploop.parse_toplevel_phrase :=
> fun _ -> original (Lexing.from_string ("();;"));;
>
> After executing this, a non-terminating sequence is shown:
> - : unit = ()
> - : unit = ()
> - : unit = ()
> ...
>
> I'm probably not using the right hook. Any insight would be appreciated.
>
> Best,
>
> Roland
>
> --
> http://roland.zumkeller.googlepages.com/
>
> _______________________________________________
> 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: 2057 bytes --]
next prev parent reply other threads:[~2009-06-26 17:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-26 4:22 Roland Zumkeller
2009-06-26 17:44 ` Ashish Agarwal [this message]
2009-07-01 3:16 ` [Caml-list] " Roland Zumkeller
2009-06-27 8:32 ` Richard Jones
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=d8be5ae20906261044n578aeabeg1f09b22d8d87268a@mail.gmail.com \
--to=agarwal1975@gmail.com \
--cc=caml-list@yquem.inria.fr \
--cc=roland.zumkeller@gmail.com \
/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