caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierpaolo BERNARDI <bernardp@cli.di.unipi.it>
To: Pierre Weis <Pierre.Weis@inria.fr>
Cc: caml-list@inria.fr
Subject: Re: Redefinition doesn't work
Date: Fri, 3 Nov 2000 17:58:28 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.10.10011031748000.1492-100000@comex13.cli.di.unipi.it> (raw)
In-Reply-To: <200011030921.KAA21301@pauillac.inria.fr>


On Fri, 3 Nov 2000, Pierre Weis wrote:

> > 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 does bother Lisp users, and they solve the problem (partially) in
different ways.

For example, in Common Lisp it is forbidden to redefine system functions.
In Scheme, you can define functions with the same name of a system one,
but this redefinition cannot change the behaviour of other system
functions.

> 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.

This is not a property of Scheme, is a bug in the implementation you
were using!

P.



  parent reply	other threads:[~2000-11-03 17:06 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
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 [this message]
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=Pine.LNX.4.10.10011031748000.1492-100000@comex13.cli.di.unipi.it \
    --to=bernardp@cli.di.unipi.it \
    --cc=Pierre.Weis@inria.fr \
    --cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).