In the previous installment of Beginning Factor, we discussed some of the attributes of stack-based languages and the syntax for defining words in Factor. This time around, I’d like to introduce stack shufflers, quotations & combinators, and touch on some more basic data types and their properties. Up until now, we’ve essentially been using Factor as an overqualified RPN calculator. I just wanted
「特定のディレクトリにあるjpgファイルのリスト」を得る用事(用事?)があって、factorで書いてみたらけっこう苦労しました。 USING: io.directories io.pathnames kernel sequences io ; IN: filelist <PRIVATE : filter-quot ( str -- quot ) [ file-extension ] swap [ equal? ] curry compose ; inline PRIVATE> : filelist ( path ext -- seq ) dupd [ directory-files ] dip filter-quot filter [ dupd "/" swap 3append ] map nip ; 最初は、filer-quotのinline指定なしで書いてみました。そうすると、file
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く