lean2/src/library/arith
Leonardo de Moura f97c260b0b refactor(kernel/environment): add ro_environment
The environment object is a "smart-pointer".
Before this commit, the use of "const &" for environment objects was broken.
For example, suppose we have a function f that should not modify the input environment.
Before this commit, its signature would be
       void f(environment const & env)
This is broken, f's implementation can easilty convert it to a read-write pointer by using
the copy constructor.
       environment rw_env(env);
Now, f can use rw_env to update env.

To fix this issue, we now have ro_environment. It is a shared *const* pointer.
We can convert an environment into a ro_environment, but not the other way around.

ro_environment can also be seen as a form of documentation.
For example, now it is clear that type_inferer is not updating the environment, since its constructor takes a ro_environment.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-12 16:48:34 -08:00
..
arith.cpp refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
arith.h refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
CMakeLists.txt Rename arith library files 2013-09-13 08:55:09 -07:00
int.cpp refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
int.h refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
nat.cpp refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
nat.h refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
num_type.h Rename numtype.h to num_type.h 2013-09-13 09:07:44 -07:00
real.cpp refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
real.h refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
register_module.h refactor(frontends/lua): rename leanlua_state to script_state, and move it to util 2013-11-27 14:57:36 -08:00
special_fn.cpp refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00
special_fn.h refactor(kernel/environment): add ro_environment 2013-12-12 16:48:34 -08:00