Hello. Newbie here. I'm trying to build graph with:

  * nodes of a different types
  * those types can have different fields, sometimes with same name
  * some nodes (types) should have arbitrary number of links to other nodes, of 
any type



I'm having hard time to get how it should be done, especially the last one. Is 
there some kind of sequence of arbitrary type references, seq[ref], seq[any]? 
Or should I just make it with object variant method and put up with 
impossibility of objects variants to have same field name?

Example of such a setup 
    
    
    type
        Node = ref object of RootObj
            id: string
        
        Container = ref object of Node
            scope: seq[any] ?      # or at least seq[Node|Container|View] ?
        
        View = ref object of Node
            name: string
            initNode: ref any      # ?
            scope: seq[any]        # same
    

Reply via email to