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

The vector type is always given as an example, but I find the ability to give a type to printf more mind bending.

Just in case that went over your head and to reiterate, that means that:

    printf "Hello %s" 4
would generate a type error, so would:

    printf "Hello %s" "wor" "ld!"
and:

    printf "Hello %s! %s" "world"
but:

    printf "%s %s!" "Hello" "world"
wouldn't.


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

Search: