- AutoHotkey has certain syntax features, and I was wondering if they exist in other common languages.
- (For the record, I really like some of these features e.g. !!, ~=, obj.key, flexible if statements, class/map crossover.)
- (I may add to this list in future. Do mention any other examples.)
- var1 := var2 [':=' for assignment, not '=']
- var1 <> var2 [equivalent to var1 != var2] [Excel sheets use this]
- var1 := !!var2 [the ability to do multiple logical nots, one alternative is a 'bool' (to bool) function]
- ~= [RegExMatch, see link lower down]
- = (as comparison operator) [Excel sheets use this]
- ; (as comment symbol)
- ` (as escape character) [a great idea since '\' interferes with paths and RegEx]
- obj.key := var (for linear/associative arrays) [in many languages you can only do 'obj[key] := var']
- When you create an object based on a custom class, you can assign any key to it like an associative array/map/dictionary. [This can be prevented by using a __Set meta-function.]
- Very flexible if statements. [Do any other languages have such flexible if statements?]
- A Mod function.
Other more common features, that AutoHotkey has, that not all major languages have:
- assign to a variable within an expression (Python lacks this)
- functions allow ByRef parameters
- functions allow default parameter values
- trailing semicolons not used
- ternary operator
Some common/uncommon features that AutoHotkey doesn't have:
- % (for modular arithmetic) [use Mod]
- ^ (for power) [use **] [Excel sheets use ^ for power] [AutoHotkey uses ^ for bitwise-exclusive-or]
- Pow [use **]
Links:
[birth of ~=]
Wishes for ~= (RegExMatch) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 4143#p4143
- AutoHotkey has certain syntax features, and I was wondering if they exist in other common languages.
- (For the record, I really like some of these features e.g. !!, ~=, obj.key, flexible if statements, class/map crossover.)
- (I may add to this list in future. Do mention any other examples.)
- var1 := var2 [':=' for assignment, not '=']
- var1 <> var2 [equivalent to var1 != var2] [Excel sheets use this]
- var1 := !!var2 [the ability to do multiple logical nots, one alternative is a 'bool' (to bool) function]
- ~= [RegExMatch, see link lower down]
- = (as comparison operator) [Excel sheets use this]
- ; (as comment symbol)
- ` (as escape character) [a great idea since '\' interferes with paths and RegEx]
- obj.key := var (for linear/associative arrays) [in many languages you can only do 'obj[key] := var']
- When you create an object based on a custom class, you can assign any key to it like an associative array/map/dictionary. [This can be prevented by using a __Set meta-function.]
- Very flexible if statements. [Do any other languages have such flexible if statements?]
- A Mod function.
Other more common features, that AutoHotkey has, that not all major languages have:
- assign to a variable within an expression (Python lacks this)
- functions allow ByRef parameters
- functions allow default parameter values
- trailing semicolons not used
- ternary operator
Some common/uncommon features that AutoHotkey doesn't have:
- % (for modular arithmetic) [use Mod]
- ^ (for power) [use **] [Excel sheets use ^ for power] [AutoHotkey uses ^ for bitwise-exclusive-or]
- Pow [use **]
Links:
[birth of ~=]
Wishes for ~= (RegExMatch) - AutoHotkey Community
[url]https://autohotkey.com/boards/viewtopic.php?f=13&t=496&p=4143#p4143[/url]