递归在类中的写法

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  $

 



你可能感兴趣的:(递归)