Version française
Home     About     Download     Resources     Contact us    
Browse thread
Toploop.setvalue
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Roland Zumkeller <roland.zumkeller@g...>
Subject: Toploop.setvalue
Hi,

Can Toploop.setvalue be used to bind a value to an identifier, as does "let"?

# Toploop.setvalue "b" (Obj.repr 43);;
- : unit = ()
# b;;
Unbound value b

I only got the other direction to work:

# let a = 42;;
val a : int = 42
# (Obj.obj (Toploop.getvalue "a") : int);;
- : int = 42

Best,

Roland