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

In the interest of comparing, using your simplification, here's a Smalltalk version...

    englishList: aList 
        ^ aList size > 2 
            ifFalse: [ aList join: ' and ' ]
            ifTrue: [ (aList allButLast join: ',') , ' and ' , aList last ]


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

Search: