caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <weis@pauillac.inria.fr>
To: datta@math.berkeley.edu
Subject: Re: Redefinition doesn't work
Date: Fri, 3 Nov 2000 10:13:13 +0100 (MET)	[thread overview]
Message-ID: <200011030921.KAA21301@pauillac.inria.fr> (raw)
In-Reply-To: <20001102144509.A5788@blue1.berkeley.edu> from Ruchira Datta at "Nov 2, 100 02:45:09 pm"

> Stefan Monnier wrote:
> >>>>>> "Pierre" == Pierre Weis <Pierre.Weis@inria.fr> writes:
> >> It is not only a question of type. As I mentioned in my previous
> >> message, if you allow the user to ``rebind'' some basic functions,
> >> such as map or iter, the behaviour of the compiler can be
> >> unpredictable.
> >
> >It never seems to bother Lisp users.
> 
> It must have bothered some Lisp users, otherwise why does Scheme have
> lexical scoping?
> 
> Ruchira Datta
> datta@math.berkeley.edu

Scheme has lexical scoping <EM>locally</EM>. It has dynamic binding
globally, just to address this redefinition problem (as far as I can
imagine a clever justification to this extremely strange behaviour). I
remember my surprise when I was porting to Scheme some fancy
metacompilation stuff written in Caml: unfortunately the Caml code
ended by redefining (globally) the functions load and compile; how
strange errors messages when the internals of the Scheme compiler
tried to use those functions in place of its original versions! I
needed a long time to figure out what was happening, since I did not
use directly any Scheme function named compile: I just tried to
compile my Scheme files as usual, calling some primitive function
named compile-file (or so), that unfortunately happened to use a
global function also named compile.

That's an example of a user that does not want the functions to be
redefined everywhere, since he cannot understand the consequences of
the redefinition since he does not even know where the rebound
function was used!

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/





  reply	other threads:[~2000-11-03  9:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-02 22:45 Ruchira Datta
2000-11-03  9:13 ` Pierre Weis [this message]
2000-11-03 10:09   ` Michael Sperber [Mr. Preprocessor]
2000-11-03 16:56     ` Pierre Weis
2000-11-03 17:36       ` Michel Mauny
2000-11-05 11:15       ` Michael Sperber [Mr. Preprocessor]
2000-11-06 21:30         ` Bruce Hoult
2000-11-03 16:58   ` Pierpaolo BERNARDI
2000-11-06  9:29     ` Stephan Houben
2000-11-03 17:30   ` Stefan Monnier
2000-11-05 11:16     ` Michael Sperber [Mr. Preprocessor]
  -- strict thread matches above, loose matches on Subject: below --
2000-10-31 19:11 Ruchira Datta
2000-11-02 18:05 ` Trevor Jim
     [not found] <200010300739.IAA13016@pauillac.inria.fr>
2000-10-30 23:38 ` Jaeyoun Chung
2000-10-31 11:06   ` Pierre Weis
2000-10-31 11:52     ` Sven LUTHER
2000-10-31 16:47       ` Pierre Weis
2000-10-31 18:55         ` Stefan Monnier
2000-11-02 15:42           ` Pierre Weis
2000-11-03  3:10             ` Stefan Monnier
2000-10-31 14:16     ` Frank Atanassow
2000-10-31 17:07       ` Pierre Weis
2000-10-28  7:32 Mattias Waldau
2000-10-28 16:37 ` Pierre Weis

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=200011030921.KAA21301@pauillac.inria.fr \
    --to=weis@pauillac.inria.fr \
    --cc=datta@math.berkeley.edu \
    /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).