Permalink
Browse files

Generate the names of modules used by reia_eval from the current pid,…

… rather than a timestamp
  • Loading branch information...
1 parent 96dc069 commit fd03fdad57dc541aed6938127d871cedb1707a08 Tony Arcieri committed Feb 21, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/core/reia_eval.erl
View
@@ -52,12 +52,10 @@ exprs(Exprs, Bindings) ->
{value, Value, NewBindings}.
-% Generate a timestamp to be used in a Reia module name
-% FIXME: atoms are never garbage collected, so a pool of these should be kept
-% and new ones created only when the pool is empty.
+% Generate a unique module name. Base it off the current PID
stamp() ->
- Timestamp = [integer_to_list(N) || N <- tuple_to_list(now())],
- string:join(Timestamp, "_").
+ SplitPid = re:split(pid_to_list(self()), "\\."),
+ string:join([binary_to_list(Num) || Num <- SplitPid], "_").
temporary_module(Name, Args, Exprs) ->
#module{line=1, name=Name, exprs=[

0 comments on commit fd03fda

Please sign in to comment.