Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is how you would write it in factor:

    "~/yourfile.txt" utf8 file-contents 
    "\\w+" findall [ first second ] map [ 
        { 
            { "house" [ "house stuff" print ] } 
            { "car" [ "car" print ] } 
            [ "default stuff: %u\n" printf ] 
        } case 
    ] each
Tacit programming basically is the same thing as stream programming.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: