Paste: Locals, curry, fry

Author: Joubert Nel
Mode: factor
Date: Sun, 29 Nov 2015 16:27:26
Plain Text |
! using locals
: select-by-artist ( seq artist -- seq' )
    [let :> artist
        [ artist>> artist = ] filter ] ;

! using the compositional combinator "with" to return a curry
: select-by-artist2 ( seq artist -- seq' )
    swap [ artist>> = ] with filter ;

! using fried quotations
: select-by-artist3 ( seq artist -- seq' )
    '[ artist>> _ = ] filter ;

New Annotation

Summary:
Author:
Mode:
Body: