Files
  • main.jl
main.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module Ranger
  module Nodes
    function transition end

    # Simple demo node for example ----------
    abstract type AbstractNode end

    mutable struct Node <: AbstractNode
      x::Float64
    end

    crossnode = Node(1.0)
    # -------------------------------------

    function visit()
      transition(crossnode)
    end
  end
end

# Demo engine
module Engine
  using ..Ranger.Nodes:
    visit
    
  function run()
    visit()
  end
end

# ------------------
using .Ranger.Nodes:
  AbstractNode, Node

import .Ranger.Nodes:
  transition

function transition(node::AbstractNode)
  println("abstract node transition")
end

function transition(node::Node)
  println("node transition")
end

# -------------------------
using .Engine:
  run
  
function go()
  run()
end
  
go()