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

No members online now.

Forum statistics

Threads
474,150
Messages
2,570,853
Members
47,394
Latest member
Olekdev

Latest Threads

Top