in reply to while ()

I intended to use while (1), honest! <grin>

It is quite interesting to see that sometimes mistyping can lead to unexpected discoveries in the language syntax...

Surprisingly, I couldn't find anything about this syntax in Perl or C on the Net... But from (working, heh) code, it seems that an empty condition is evaluated as true...

Here's what I found that might be related. It's from description of perl5db, the Perl debugger:

... %postponed Saves breakpoints for code that hasn't been compiled yet. Keys are sub +routine names, values are: * compile - break when this sub is compiled * break +0 if <condition> - break (conditionally) at the start of +this routine. The condition will be '1' if no condition was specified +. ...

--------------------------------
An idea is not responsible for the people who believe in it...

Replies are listed 'Best First'.
A graceful error
by tlm (Prior) on Jun 08, 2005 at 06:34 UTC

    It is quite interesting to see that sometimes mistyping can lead to unexpected discoveries in the language syntax...

    Mind

    Richard Wilbur

    Mind in its purest play is like some bat
    That beats about in caverns all alone,
    Contriving by a kind of senseless wit
    Not to conclude against a wall of stone.

    It has no need to falter or explore;
    Darkly it knows what obstacles are there,
    And so may wave and flitter, dip and soar
    In perfect courses through the blackest air.

    And has this simile a like perfection?
    The mind is like a bat. Precisely. Save
    That in the very happiest intellection
    A graceful error may correct the cave.