yogidrink
yogidrink
MModular
Created by ct on 9/13/2023 in #questions
What kind of list should I use to add struct instances
So that means there currently is no real way to create a tree structure with nodes which have children referenced? This currently doesnt work
from utils.vector import DynamicVector

@register_passable("trivial")
struct Node:
var children: DynamicVector[Self]

fn __init__(inout self) -> Self:
let c = DynamicVector[Self]()
return Node {children: c}

Node()
from utils.vector import DynamicVector

@register_passable("trivial")
struct Node:
var children: DynamicVector[Self]

fn __init__(inout self) -> Self:
let c = DynamicVector[Self]()
return Node {children: c}

Node()
4 replies
MModular
Created by yogidrink on 10/7/2023 in #questions
set() type
it seems like there is not even a set method
3 replies