Skip to content

Commit

Permalink
sheriff_string_genrator: add a multiple variable name generator
Browse files Browse the repository at this point in the history
  • Loading branch information
M committed Sep 3, 2011
1 parent 09ae6e0 commit 949fa30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/sheriff_string_generator.erl
Expand Up @@ -32,3 +32,11 @@ name_var()->
ets:insert(my_table, {'sheriff_$_var', 0}),
'Sheriff_$_suspect'. %%the name of the main parameter to check

%% It returns variable name to use in the code generated.
%% These name are supposed not to match with user's name, and with
%% other variable's name generated.
-spec name_var(integer())->atom().
name_var(Incr)->
Number=ets:update_counter(my_table, 'sheriff_$_var', Incr),
%TO TEST ADD: ??? test=is_integer(Number),
list_to_atom(lists:concat(['Sheriff_$_suspect_',Number])).

0 comments on commit 949fa30

Please sign in to comment.