Modify

Opened 5 years ago

Closed 5 years ago

#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 Changed 5 years ago by TicketCleanup

  • Version 3.3.14.0 deleted

Automatic ticket cleanup.

comment:2 Changed 5 years ago by Melba23

  • Resolution set to Rejected
  • Status changed from new to closed

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.