Author Topic: Short sircuit evaluation  (Read 5097 times)

Marcus

  • Guest
Short sircuit evaluation
« on: December 16, 2011, 12:05:37 PM »
A famous (at least to me) game programmer started using naalaa (the language is meant for new beginners, so it came as a surprice to me). He emediately complained about the lack of short sircuit evaluation in logic expressions. I fixed it (only 6 lines of c code, luckily) and updated naalaa. But now I'm wondering, are there any disadvantages with this? I know some (old) languages use "and"/"or" for non short sircuit evaluation and "and then"/"or else" for short sircuit evaluation.

For me personally it doesn't really matter. I always write code as if short circuit evaluation didn't exist.

Offline John

  • Forum Support / SB Dev
  • Posts: 3510
    • ScriptBasic Open Source Project
Re: Short sircuit evaluation
« Reply #1 on: December 16, 2011, 06:13:34 PM »
Quote
I always write code as if short circuit evaluation didn't exist.

True top/down using GOTO/GOSUB along the way?