Seriously, what the fuck is going in this thread? People who have been using autohotkey for ages and still have no fucking clue about autohotkey's can-count-with-a-single-hand value types.
Let's ignore the absolute retardation that objects should be compared as strings and move over to:
joefiesta wrote: ↑14 Feb 2019, 11:23
Doc, at
https://autohotkey.com/docs/Functions.htm#intro, states
Since a function call is an expression, any variable names in its parameter list should not be enclosed in percent signs.
this is not precise. The "function call" is not an expression. If it were, the following would work:
Code: Select all
in := "strlen"
a := in("asdf")
msgbox % a
exitapp
in := "strlen" This is a string literal. String literals are not functions. So they can't be called. String literals are never functions, anywhere, neither do they magically transform into a function just 'bcuz'.
Alternatively,
%in%("asdf") Uses the value/contents of the variable
in, which is a
string, to find a function with that name and calls it.
If autohotkey had first class functions, you wouldn't do
in := "StrLen" to grab the reference, since that is a
string assignment, that causes the variable to hold a
string; you would do
in := StrLen, where StrLen would hold a function reference/pointer/direction-arrow-to-something-in-memory-that-can-be-called. But since they are not, StrLen is considered a plain variable, unless you manually:
Code: Select all
StrLen := Func("StrLen")
in := StrLen
Miscellaneous:
Code: Select all
in := Func("strlen")
in.call("adsf") ; Simply because autohotkey_l has the limitation of not being able to call function references without .call.
; if .call wasn't enforced, you would do
in("asdf")
joefiesta wrote: ↑14 Feb 2019, 11:23
The doc should read:
The PARAMETERS in a function call are expressions.
https://github.com/Lexikos/AutoHotkey_L/blob/master/source/script.cpp#L2807
ParseAndAddLine(pending_buf, ACT_EXPRESSION)
https://github.com/Lexikos/AutoHotkey_L/blob/alpha/source/script.cpp#L4604
aActionType = ACT_EXPRESSION;
joefiesta wrote: ↑14 Feb 2019, 17:38
you guys don't get the point. My ONLY point is the semantics of the statement "Since a function call is an expression" The function call is NOT an expression. The Parameters are expressions, but not the call itself.
Function calls are considered expressions.
Function definitions are not expressions, unless it's
=>.
Hopefully the thread can resume on being about documentation improvements and not ask for help or tutorials. Roll in for some light reading on "documentation improvements" and get trollbaited into this shit.
autohotkey.com/trollbaitboards
Yeah I know the "snowflake", "hurdurrr don't read it if you don't like it durrsss *spits*", well I'm running out of subforums at this point.