Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

Commit

Permalink
Generate the names of modules used by reia_eval from the current pid,…
Browse files Browse the repository at this point in the history
… rather than a timestamp
  • Loading branch information
Tony Arcieri committed Feb 21, 2011
1 parent 96dc069 commit fd03fda
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/reia_eval.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down

0 comments on commit fd03fda

Please sign in to comment.