Temporary Variables
AHK's scope of Local variables are the closest to temporary.
Persistent Variables
Static variables are just local variables that stay in between calls of a function/method. Globals stay as long as the script stays open.
storable
I don't know what this means.
Composite Variables
I don't really know what this means. From various sources, Objects (maps, dictionaries, associative array), Arrays (stacks, lists), are the closest that I can think of.
Variable update
What?
x := 5
x := x + 2
Full update? Selective update?
What do you mean? It's a variable, it holds a value, and it updates when you set it to a new value or use ByRef in a function.
matrices
Arrays within arrays.
matrix := [[12, 44], [10, 2], [14, 14]]
Static? Dynamic? Flexible?
Variables have 3 scopes. Global, Static, and Local.
Global is able to be read anywhere so long as the function isn't Forced-Local or Forced-Static.
Static (as mentioned above) is a Local variable that stays in between calls to the function/method.
Local variables are your typical variable that stays inside the block (of the function, not any block) and then is deleted when the function closes.
By default, variables in the AutoExec section are Global, and everything else is Local
Copy Semantics and Reference Semantics
What?
commands
Commands are just functions that are legacy code. AHK_L v2 changes these commands into functions.
Jump
GoTo/GoSub are your best bets for jumping.
Assignment
Variables follow a simple design:
Code: Select all
global AppName := "Example-01.ahk"
loop, 3
{
my_func()
}
my_func()
{
static count := 0
; Display the counter with a title of a global variable.
MsgBox, 0, % AppName, % "You've ran this function: " . count++ . " times!"
}
Simple attribution? Multiple Assignment? Concurrent Assignment?
I don't know what this means, but you cannot assign multiple variables using one action like in other languages.
You can however assign multiple variables per line:
Code: Select all
x := 5, y := 12
MsgBox, % Format("x: {1}`ny: {2}`", x, y)
Procedure call?
Sequential command?
collateral command?
What does this mean?
conditional command?
Besides an if statement, I have no idea what this means.
iterative command?
Uh...
x += 1 ?
Command Expression (expressions with side effects)?
FileAppend, Hello, my_file.txt
Side effect of a new file being created?
I have no idea what you mean.
Command block and Expression block?
Commands do not have blocks, only control flow statments do.
Expression blocks can be done like so:
https://www.autohotkey.com/docs/Scripts.htm#continuation
abstractions
Function abstraction? Procedure abstraction?
Parameterization of abstractions
I don't think AHK has abstractions, don't quote me.
Parameter passing by copy? (value, result, value/result?)
Code: Select all
name := "George"
my_func("Hello", name)
my_func(message, name)
{
MsgBox, % message . " " . name
}
Parameter passing by reference?
Code: Select all
count := 1
MsgBox, % count
my_func(count)
MsgBox, % count
my_func(ByRef count)
{
count := 10
}
Program Units
Do you mean Unit tests? We don't have a built-in test. But we do have a unit test library here:
https://github.com/Uberi/Yunit
packages?
No package manager here. I mean, you can just copy/move the library into the folder you want and include it from there.
Types of data summaries?
If you want? Again, no built-in stuff.
Objects and Classes?
Code: Select all
; Classes do not have to be defined before use, I just prefer it this way.
class User
{
; Constructor.
__new(name, age)
{
this.name := name
this.age := age
; Not required, just a habit.
return this
}
}
my_user := new User("George", 12)
some_obj := {"name": "George", "age": 12}
simple_obj := Object("name", "George", "age", 12)
Generic Units?
What does this mean?
sequencers
Uh?
Unconditional Deviations?
break ?
continue ?
leaks?
Not possible unless AHK's source code has a problem.
Exceptions?
Code: Select all
throw Exception("Something went wrong")
throw "Something went wrong"