递归在类中的写法

struct ioo 
(
	toto =#(),
	fn getbonename nodep =
	(
		kong =#()
		if nodep.children.count > 0 then 
		(
			for i in  nodep.children do 
			(
			append toto i.name
			append kong i 
			)
		)
		if kong.count>0 then 
		(
			for i in kong do 
			(
				getbonename i
			)
		)
	),
	-- 下面进行调用 返回
	fn getbone  nodep  =
	(
		toto =#()
		getbonename nodep 
		return toto 
	)
)

op = ioo()

op.getbone  $

 



posted on 2012-07-09 11:51  盖天00  阅读(291)  评论(0编辑  收藏  举报

导航