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

"Paul notes that strings and lists really should just be represented as lists and the compiler should efficiently handle lists of characters as a special case."

Instead of "strings represented as lists", I think it is more useful to say "strings and lists implementing a common interface." For example, in Clojure, it is perfectly fine to treat a string as a sequence.

    > (doseq [ch "abc"]
        (println ch))
    a
    b
    c


Yeah, they're called sequences in CL, and they're even user-extensible (on sbcl at least.)





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

Search: