History of "statement if condition" syntax?

R

Roy Smith

Perl is the only language I know of where you can invert the body and
test of a condition, i.e. "exit 1 if $error'" instead of "if ($error) {
exit 1};". What's the history behind that? Are there other languages
which let you write conditionals like that? Did Perl invent that, or
borrow it from some earlier language?

Please note, I'm not interested in debates about whether this is good or
bad, I'm just looking for the history/chronology/etymology of the
construct.
 
T

Tad McClellan

Roy Smith said:
Perl is the only language I know of where you can invert the body and
test of a condition, i.e. "exit 1 if $error'" instead of "if ($error) {
exit 1};". What's the history behind that? Are there other languages
which let you write conditionals like that? Did Perl invent that, or
borrow it from some earlier language?


BASIC-PLUS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,688
Members
48,796
Latest member
Greg L.

Latest Threads

Top