[Fixed] ACC does not support predecrement

Bugs that have been investigated and resolved somehow.

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.
User avatar
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

Post by Hirogen2 »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Who cares?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

ACC is not as robust as C, and wasn't designed to be. The prefixed decrament is easily gotten around, anyway.
User avatar
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:

Post by Hirogen2 »

That's essential! :)
Changed Topic: Pre-Decrement and Pre-Increment do not work when applied to array members.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

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:

Code: Select all

--foo[3];
But since that is completely equivalent to the following, I don't see this as much of a problem:

Code: Select all

foo[3]--;
The following works just fine:

Code: Select all

int a = --foo[3];
Note that this also applies to preincrement, and only to arrays.
User avatar
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:

Post by Hirogen2 »

I like pre* more than post :)
User avatar
Mannequin
Posts: 441
Joined: Tue Jul 15, 2003 8:21 pm
Location: On The Lonely Island somewhere.

Post by Mannequin »

Hirogen2 wrote:I like pre* more than post :)
Is that because of K&R? :wink:
User avatar
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:

Post by Hirogen2 »

I dislike K&R (what of K&R anyway?) I cannot tell... some personal favor without a reason. Looks better!?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

"make foo one less" looks even better. Shall we change the official command to that?
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

HotWax wrote:"make foo one less" looks even better. Shall we change the official command to that?
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);").
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Destroyer wrote:
HotWax wrote:"make foo one less" looks even better. Shall we change the official command to that?
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);").
Raise the whatty by the howdy? Tags? Units? That's confusing!!!

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."
User avatar
Zell
Posts: 791
Joined: Thu Jul 24, 2003 7:47 am
Location: IN A GODDAMN BOX[In Erie.]

Post by Zell »

HotWax wrote:
Destroyer wrote:
HotWax wrote:"make foo one less" looks even better. Shall we change the official command to that?
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);").
Raise the whatty by the howdy? Tags? Units? That's confusing!!!

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."
XD
User avatar
Mannequin
Posts: 441
Joined: Tue Jul 15, 2003 8:21 pm
Location: On The Lonely Island somewhere.

Post by Mannequin »

Hirogen2 wrote:I dislike K&R (what of K&R anyway?) I cannot tell... some personal favor without a reason. Looks better!?
What's there to dislike with K&R? :shock:

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. :)
User avatar
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:

Post by Hirogen2 »

Mannequin wrote:What's there to dislike with K&R? :shock:
Aside that their indent style does not match mine (to a specific degree) :P and that the book is not free like other C tutorials, if I think about it, nothing, it is like... anything else, no + no -.
And yeah, IIRC they used post-increment! :lol:
User avatar
Ty Halderman
... in rememberance ...
Posts: 282
Joined: Thu Jul 17, 2003 9:53 pm
Location: New Orleans LA
Contact:

Post by Ty Halderman »

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 :roll:

Code: Select all

++i;
j=foo(i+arg2);
j--;
Post Reply

Return to “Closed Bugs [GZDoom]”