Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: boathouse2112 on August 01, 2012, 08:13:20 pm

Title: Axe closing parentheses
Post by: boathouse2112 on August 01, 2012, 08:13:20 pm
In TI BASIC you can shorten the code a bit by omitting ending parentheses and quotation marks. Is this also possible in Axe or will it get messed up?
Title: Re: Axe closing parentheses
Post by: Scipi on August 01, 2012, 08:14:54 pm
I believe Axe requires you to close the parentheses. Since it's compiled and not interpreted, I think it ensures proper compilation and execution, else you'll get an error when you go to compile.
Title: Re: Axe closing parentheses
Post by: Deep Toaster on August 01, 2012, 10:09:25 pm
Leaving off ending parentheses makes no difference in the size of the compiled program (the one that users will actually play), and it can create many bugs if the programmer isn't entirely sure of what he's doing.

For example, look at this code:
Quote from: Axe
{L1+5→A
You probably think it's doing the same thing as this:
Quote from: Axe
{L1+5}→A
But what it's really doing is this:
Quote from: Axe
{L1+5→A}
That's the sort of thing you'll have to deal with if you get in the habit of leaving off parentheses in Axe. So just leave them on—one keystroke will save you a ton of trouble later ;)
Title: Re: Axe closing parentheses
Post by: DJ Omnimaga on August 02, 2012, 01:48:13 am
I remember certain Axe commands would tolerate non-closed parenthesises from time to time, but in some cases, your code would not work. Always close them, because as Deep said, unlike in TI-BASIC, the executable file size won't change if you don't close them.
Title: Re: Axe closing parentheses
Post by: Sorunome on August 02, 2012, 03:48:26 am
Leaving off ending parentheses makes no difference in the size of the compiled program (the one that users will actually play), and it can create many bugs if the programmer isn't entirely sure of what he's doing.

For example, look at this code:
Quote from: Axe
{L1+5→A
You probably think it's doing the same thing as this:
Quote from: Axe
{L1+5}→A
But what it's really doing is this:
Quote from: Axe
{L1+5→A}
That's the sort of thing you'll have to deal with if you get in the habit of leaving off parentheses in Axe. So just leave them on—one keystroke will save you a ton of trouble later ;)
Oh, that is maybe why I had some axe bugs.........