[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
self for Jocaml location
I have a weird question :
Is it possible to program a notion of self like you have with Thread.self ()
in Ocaml ?
The first question is what is self. The answer is the current most internal
location of my thread. So what I am looking for is : self : unit -> location
Why do I need it ? In fact the problem is linking a "service" (a
function or a data structure identified by a "name") to the current
location so that i can unambiguously refer to it without naming
where I am. This mechanism has an ambiant flavour.
I am ready to go very deep in the internals of jocaml to get this behaviour :
is Jprims.self_location the function to look at ?
Then there are two solutions :
- put the service directly in the location structure :
Is there a way to extract and call a process definition from the
location_stub obtained ?
- put the service in a global table with a location id as a key
It is less efficient. A second problem is moving locations. I must
move the elements using it as a key but also the sublocations.
Thanks for any help !
Pierre
--
Pierre Cregut - pierre.cregut@rd.francetelecom.fr - +33 2 96 05 16 28
FTR&D - DTL/MSV - 2 avenue Pierre Marzin - 22307 Lannion Cedex - France