Is this a dream or a nightmare? (Was Re: XML)

David T. Grove pete at petes-place.com
Sun Oct 8 01:16:31 EDT 2000


>> die unless @d = map {"$basedir/$_"} grep {!-d && -w} readdir(dir);
>> 
>
>What in the heck does all _that_ mean?

Actually, fully extended, it means "give me a platform independent
list of writable (non-directory) files in that directory in a form
that will allow me to name the files so that I can see them from
elsewhere in my code regardless of where they are on disk, or halt
immediately because if this doesn't work you might screw something
up".

>
>> ...which is perfectly logical and readable to me as a single
>> "thought"... "get me all the filenames in that directory or halt
>> immediately because you'll screw something up".
>
>OK, _now_ I see!  9If only Perl were as readable as a natural language.
><wink>)

If I knew of one that could express this with as little typing, I'd
switch immediately. LOL.

>if-i-were-designing-a-programming-language-with-the-express-purpose
>   -of-eliminating-lines,-i'd-pick-on-the-braces-before-the
>   -semicolons-(or-maybe-just-eliminate-both-<wink>)-ly y'rs,

(What is this. Some kinf of "japh" sig? It appears to be limited to
this newsgroup, so I assume it's python-based in some way. Still have
to figure out the "-ly y'rs".)

OH I GET IT!!! The -ly y'rs is the whole clue, ain't it? Just a
"Sincerely Yours" with python indentation. Hmmm. I'll have to try
that. Nobody laugh as I screw up my first few with something silly.

Rather more polite than a japh, I'd say.

Well, just because you can't see your beginning spaces or tabs that
define your blocks doesn't mean that they're not extra characters in
your file. They just happen to be invisible to the naked eye unless
you have CodeMagic set to see invisible characters. The semi-colon
just becomes a habit, though. You'll never know how many sentences
I've written in emails and normal (non code) documents where I've
accidentally hit the semi-colon rather than the period. In code, I
don't actually see it. My eye passes it just as much as yours passes
your spaces or tabs.

If-it-weren't-for-monotype-text,-you'd-never-catch-your-end-of-block
    -errors,-though-ly y'rs.

;-))

Did I do that right? Give a guy a break it's my first python japhsig.




More information about the Python-list mailing list