summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-04-26 23:21:22 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2019-04-26 23:21:22 +0200
commitd4ea952032b099a4674c27e964ab6ec421c690f4 (patch)
tree95ff353e25c971e1c88ed12236aa54b2d541c71f /src/ataxic.erl
parent707e875456b7d8dcc37aaa8f92b16e984b534045 (diff)
Dubious way to have lazy orddict updates.
I want to keep the benefits of orddict:fetch vs orddict:find, but still be able to re-use the existing code when adding a new element.
Diffstat (limited to 'src/ataxic.erl')
-rw-r--r--src/ataxic.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ataxic.erl b/src/ataxic.erl
index 195d77f..4d829f3 100644
--- a/src/ataxic.erl
+++ b/src/ataxic.erl
@@ -126,7 +126,7 @@
-export([apply_to/2, matches/2]).
--export([optimize/1]).
+-export([optimize/1, is_constant/1]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -378,3 +378,7 @@ matches (OP, Entry) ->
true -> true;
_ -> false
end.
+
+-spec is_constant (basic()) -> boolean().
+is_constant (#const{}) -> true;
+is_constant(_) -> false.