既存のコンビネータを使用してこのコードをリファクタリングし、正規表現が部分的に適用される引数になり、結果の引用が と同じスタック効果を持つようにするにはどうすればよいls (x -- )
ですか?
USING: io.directories locals sequences accessors math
prettyprint kernel io.files.info io.directories.hierarchy
combinators.short-circuit regexp
;
IN: flac
:: job ( step path -- )
path
[ [ step call ] each ]
with-directory-entries
; inline
:: lsc ( x c -- ) x c call [ x . ] when ; inline
:: ls ( x -- )
x
[ {
[ directory? ]
[ name>> directory-tree-files
[ ".*[.]flac" <regexp> matches? ]
filter length 0 =
]
}
1&&
]
lsc
;