[Fixed] ACC does not support predecrement
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Hirogen2
- Posts: 2033
- Joined: Sat Jul 19, 2003 6:15 am
- Operating System Version (Optional): Tumbleweed x64
- Graphics Processor: Intel with Vulkan/Metal Support
- Location: Central Germany
- Contact:
ACC doesnot support predecrement
Hi,
just noted that ACC does not handle pre-decrement, à la --some_array. Whether this holds true for single variables like --x too, I did not check.
just noted that ACC does not handle pre-decrement, à la --some_array. Whether this holds true for single variables like --x too, I did not check.
It does not support predecrement of arrays if you try to use it as a stand-alone operator. (That is, you don't use the result of the operation in any way.) All that means is that you cannot do something like this:
But since that is completely equivalent to the following, I don't see this as much of a problem:
The following works just fine:
Note that this also applies to preincrement, and only to arrays.
Code: Select all
--foo[3];
Code: Select all
foo[3]--;
Code: Select all
int a = --foo[3];
And while you do that, make a scripting language that uses plain english sentences("Raise the floor tagged 45 100 units at 10 eighth-units per tic.") rather than complicated commands("floor_raisebyvalue(45, 10, 100);").HotWax wrote:"make foo one less" looks even better. Shall we change the official command to that?
Raise the whatty by the howdy? Tags? Units? That's confusing!!!Destroyer wrote:And while you do that, make a scripting language that uses plain english sentences("Raise the floor tagged 45 100 units at 10 eighth-units per tic.") rather than complicated commands("floor_raisebyvalue(45, 10, 100);").HotWax wrote:"make foo one less" looks even better. Shall we change the official command to that?
How about:
"Raise the floor over yonder by about half the height of my 6-year old daughter at the speed of my grandma in her old rocker."
XDHotWax wrote:Raise the whatty by the howdy? Tags? Units? That's confusing!!!Destroyer wrote:And while you do that, make a scripting language that uses plain english sentences("Raise the floor tagged 45 100 units at 10 eighth-units per tic.") rather than complicated commands("floor_raisebyvalue(45, 10, 100);").HotWax wrote:"make foo one less" looks even better. Shall we change the official command to that?
How about:
"Raise the floor over yonder by about half the height of my 6-year old daughter at the speed of my grandma in her old rocker."
What's there to dislike with K&R?Hirogen2 wrote:I dislike K&R (what of K&R anyway?) I cannot tell... some personal favor without a reason. Looks better!?

I prefer the post-increment (decrement - whatever) operator better. I find I use it more, but not only that, I think it looks better than the pre-increment operator.

- Ty Halderman
- ... in rememberance ...
- Posts: 282
- Joined: Thu Jul 17, 2003 9:53 pm
- Location: New Orleans LA
- Contact:
Personal preference is to use pre or post at the beginning or end respectively of a block of code, anywhere that it really doesn't matter. Of course where there are side effects or more specific actions like in a for() statement, do what makes sense--this is just where it's otherwise completely immaterial which is used. (no, I didn't post-decrement "sense" or pre-decrement "this" in the sentence above

Code: Select all
++i;
j=foo(i+arg2);
j--;