Wow. I don't know now.

Slightly modifying your example, here is closer to what I want: 
    
    
    type
      NodeConcept* = concept n
        $n is string
      GraphConcept*[NodeConcept] = concept g
        type NodeType = NodeConcept #type(g.node())
        g.nodes() is seq[NodeType]
      Node* = object
        n*: int
      Graph* = object
        mynodes*: seq[Node]
    proc nodes*(g: Graph): seq[Node] =
      g.mynodes
    #proc node*(g: Graph): Node =
    #  Node()
    proc shortest_path*(g: GraphConcept): seq[g.NodeType] =
      g.nodes
    
    let nodes2 = @[Node(n:1), Node(n: 2)]
    let g = Graph(mynodes: nodes2)
    echo shortest_path(g)
    
    
    Run

And that works too!

So I'm confused, but happy.

Reply via email to