Hi, I know that seq[T] only accepts one type of data. Is there any container 
data type like list in Python ? In which, we can put int, float, string, 
objects etc at the same time. See this code snippet. This is what i want. 
    
    
    type anObject* = ref object
        objList : # Here, i want to declare a list but untyped.
        count : int
    
    proc objInit*() : anObject =
        new(result)
        result.objList = () # Here, i want the list to initialize, but it is 
still empty.
        result.count = 0
    
    var aObj = objInit()
    aObj.add("Hello")  # Add a string
    aObj.add(1589)   # add an int
    aObj.add(someObject)  #add an object
    
    
    Run

How to make this type of list. I tested with "seq[untyped]", "seq[auto]", 
"tuple[]" but all are failed.

Reply via email to