News for hackers. Stuff that matters.
Re:I don't like Python. Does that make me a bad person? by anon_d on Monday June 28, 2010 @01:47AM (#1467197)
Your code sample isn't quite right.

[read stdin] returns a string (not a list of strings), which is parsed as a list when you try to loop over it. The parsing breaks the string into a list of words, so the second loop is redundant. The parsing could fail if the input file isn't valid list syntax (unmatching {}'s). [split _] makes it safe.

    foreach word [split [read stdin]] {
        if [string match *ing $word] { puts $word }}
I love Tcl too! Tcl is a scripting language for C, Python is less-powerful version of Lisp.
Re:I don't like Python. Does that make me a bad person? by phsoftnet on Monday June 28, 2010 @04:52PM (#1469430)
Yes you're right hehe. less powerful version of Lisp? that's weird but oh well ..