majkinetor wrote:
static _ := %A_ThisFunc%() ;this doesn't work.
The function isn't running when the static initializer is evaluated. Static initializers are simply prepended to the auto-execute section (after variable references are resolved).
Quote:
Perhaps this could be added as extra keyword, for instance "autorun".
Auto-execution isn't the main reason for static initializers, but since it works, I'd rather not add any new syntax.
RUBn wrote:
Any plans in the future to lower the footprint?
No.
Quote:
It takes about double of memory for the standard script compared to Autohotkey.
I don't know what you call a "standard" script. For
AHKControl, I see about 100KB higher Working Set size and roughly the same Private Working Set. I couldn't test my other "resident" scripts since they rely on AutoHotkey_L features. For a mostly empty script #including CLR.ahk and COM.ahk, the increase is 1MB / 600KB on the Unicode build and 300KB / 300KB on the ANSI build. Strings in the Unicode build necessarily take up twice as much memory; that's the cost of Unicode support. Also, it's my understanding that the Working Set is shared with other processes.
Note that whichever build you use, memory usage is slightly lower if you decompress AutoHotkey.exe (
upx.exe -d AutoHotkey.exe), except for the x64 build, which can't be (easily) decompressed.
Quote:
It's not the most important thing, but I was wondering if this is the result of it being fresh and that it might get a footprint improvement update or not..
AutoHotkey_L is still mostly AutoHotkey, so there isn't much room for improvement. If I see any opportunities, I'll take them (within reason).
Mystiq wrote:
Am i wrong to assume that it would be more "newbie" friendly (like me) for the first method to work equal to the second?
Maybe, but it's not feasible. Would it be more "newbie" friendly for neither one to do anything automatic? My reasoning was that
x[y,z] looks like multi-dimensional array syntax, so should act like it. See
Arrays of Arrays.
Code:
;pseudo-code
obj.test.var := "abc"
; resolves to two separate actions:
temp := _objget(obj, "test")
_objset(temp, "var", "abc")
obj["test", "var"] := "abc"
; resolves to one action:
_objset(obj, "test", "var", "abc")
obj.test["var"] := "abc"
; is the same as the one above