对于我的项目,我需要构建一个树结构.我正在寻找一种在树叶上种植它的方法.我通过使用listy结构简化了失败的尝试:
my $root = a => (b => (c=> Nil)); my $here := $root; while $here.value ~~ Pair { $here := $here.value; } $here = d => Nil;
这不起作用,因为我当然不能改变Nil.
无法分配给不可变值
我怎样才能做到这一点?
谢谢,
Theo van den Heuvel