csys: revert: scope in process dict -> explicit param
This commit is contained in:
parent
fec2a1b42d
commit
850ae6ed7b
2 changed files with 5 additions and 5 deletions
|
|
@ -19,8 +19,8 @@ defmodule Scopes.CSys do
|
||||||
# helper functions
|
# helper functions
|
||||||
|
|
||||||
defp process(msg, scope) do
|
defp process(msg, scope) do
|
||||||
Process.put(:scope, scope)
|
#Process.put(:scope, scope)
|
||||||
proc(scope).(msg)
|
proc(scope).(msg, scope)
|
||||||
end
|
end
|
||||||
|
|
||||||
def state(scope), do: elem(scope, 0)
|
def state(scope), do: elem(scope, 0)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ defmodule Scopes.CSys.Program do
|
||||||
# programs
|
# programs
|
||||||
|
|
||||||
def basic_prog() do
|
def basic_prog() do
|
||||||
%{default: &std_proc/1
|
%{default: &std_proc/2
|
||||||
#initial: &std_proc/1,
|
#initial: &std_proc/1,
|
||||||
#active: &std_proc/1,
|
#active: &std_proc/1,
|
||||||
#retired: &std_proc/1
|
#retired: &std_proc/1
|
||||||
|
|
@ -18,8 +18,8 @@ defmodule Scopes.CSys.Program do
|
||||||
|
|
||||||
# processors
|
# processors
|
||||||
|
|
||||||
def std_proc(msg) do
|
def std_proc(msg, scope) do
|
||||||
scope = Process.get(:scope)
|
#scope = Process.get(:scope)
|
||||||
case msg do
|
case msg do
|
||||||
{:parent} ->
|
{:parent} ->
|
||||||
new = create_parent(scope)
|
new = create_parent(scope)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue