因此,以下示例中的代码也将得到优化: _=[io:put_chars(E)||E<-List],ok. 5.3深度和平面列表 lists:flatten/1构建一个全新的列表。
parse格式是可以传递到内部表示flatten/1和format/1,而forms格式可以传递给compile:forms/2。在erl和hrl格式返回iolists。
_.compact([0,1,false,2,'',3]);=>[1,2,3] compact _.flatten(array,[shallow]) 展平嵌套数组(嵌套可以达到任何深度)。
#Filelib/thwait.rb,line87defjoin_nowait(*threads)threads.flatten!
Collection#flatten() 压扁嵌套的Iterables。 flatten(depth?:number):Iterable<any,any>flatten(shallow?
Iterable#flatten() 压扁嵌套的Iterables。 flatten(depth?:number):Iterable<any,any>flatten(shallow?
OrderedSet#flatten() 压扁嵌套的Iterables。 flatten(depth?:number):Iterable<any,any>flatten(shallow?
Set#flatten() 扁平嵌套的Iterables。 flatten(depth?:number):Iterable<any,any>flatten(shallow?
Stack#flatten() 扁平嵌套的Iterables。 flatten(depth?:number):Iterable<any,any>flatten(shallow?

扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2026 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059
粤公网安备44030502008569号
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号
