Modify

#3752 closed Feature Request (Rejected)

Making mod() an infix operator

Reported by: Robinson1 <Djamana@…> Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: infix mod BitAND BitOR BitXOR BitXOR BitShift BitRotate Cc:

Description

That ticket is about the AutoIT Language parser.

In short:

Concerning:

Mod as well as
BitAND, BitOR, BitXOR, BitXOR,
BitShift, BitRotate

What if:

$result = 3 mod 2

works as well as

$result = Mod(3,2)

currently does.

In more detail

the idea of this ticket is to propose to also have for function/operators BitAND, BitOR, BitXOR, BitXOR, BitShift, BitRotate and Mod also an infix version?

... like it is in most other common programming languages it is.
For example JavaScript:

Result = Value & Mask

And vs BitAnd()

Concerning this the situation in AutoIT is at the moment a little
'unique'.
While the logical And is indeed infix:

$bIsEnable = $bIsGUI_chkEnabled and $bIsGUI_chkChecked

for the Bitwise pendant BitAnd it is not:

$Result = BitAND ( $Value , $Mask )

(Instead it's a prefix operator - like most the other functions)

So I wonder why it is like this.
Question 1:

What is the idea about this language design decision?

Okay Autoit is a matured Language but yeah
it's never to late for a change.

Question 2:
Wasn't there any tries to unify that before?

So what about also making the 'Bit' operations infix as well.
... while of course keeping the 'old' prefix version
-for backwards compatibility - .
It won't break anything, but in my eyes is a big improvement regarding style and intuitivity of Autoit.

Linked Forum Topic

https://autoitscript.com/forum/topic/202303-autoit-language-why-bitand-is-not-an-infix-statemen

Attachments (0)

Change History (2)

comment:1 by TicketCleanup, on Apr 8, 2020 at 11:00:01 AM

Version: 3.3.14.0

Automatic ticket cleanup.

comment:2 by Melba23, on May 3, 2020 at 10:56:12 AM

Resolution: Rejected
Status: newclosed

There are other much more pressing things to occupy what little Dev time is available. The current operators work perfectly well - different languages have different syntax and coders must adapt.

M23

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.