Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Pierre Weis <Pierre.Weis@i...>
Subject: Re: Redefinition doesn't work
Jaeyoun Chung (mailto:jay@kldp.org) 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 "filename.ml";;

For instance, you can use a loadall.ml 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, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/