Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: Redefinition doesn't work
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-10-31 (11:06)
From: Pierre Weis <Pierre.Weis@i...>
Subject: Re: Redefinition doesn't work
Jaeyoun Chung ( wrote:

>  this is quite true but the above feature for the toplevel is quite useful
>  during the development phase. if each time we should redefine everything
>  dependent on one function, toplevel isn't quite that useful -- to find out
>  the dependencies or just reload everything dependent on the file
>  containing the function is what should have be done automatically. what
>  about having an option or directive so that user can control the behavior?

We already have one: #use "";;

For instance, you can use a file that contains the list of
#use directives that load the files that made your program.

>  when user redefines some function, isn't it exactly the user's intention
>  to redefine all the bindings already defined not only those following that
>  redefinition?

No, I guess it is not the intention of the user, since he does not
know the set of bindings that uses the function he is redefining.

If you want to test, you can use the Ocaml feature that effectively
redefines functions the way you suggest they should be, namely the
#trace directive. For instance:

# #trace List.iter;;
List.iter is now traced.
# 1;;

Pierre Weis

INRIA, Projet Cristal,,