In almost every example, the variable names are just variable names and have no special meaning to the interpreter (but some have meaning to the reader). You can use virtually whatever name you want (except operators like and/or and built-in variable names), even if it's the name of a function or command. Array := Array() demonstrates this. I don't really understand the "keyword vs not" confusion you seem to be concerned about, but I suppose that the problem would be averted by teaching the basics of the language first.T-Rock wrote:Adding prefix "My" to examples #126
https://github.com/Lexikos/AutoHotkey_L-Docs/pull/126
It's like I said before,
Have you considered that if every example uses the same name, users mightn't see that they can use whatever name they want?I wrote:I think the underlying problem is that there is no structured overview of the language, nor anything to teach the basic programming concepts required to tie everything together.
"FuncRef" doesn't appear to follow the convention - no "My" prefix. Furthermore, the variable merely contains a reference to an object of type "Func", yet for other object types you do not use the "Ref" suffix. Later in the page you've replaced "func" (a method name) with "Function" - I can't imagine why. I can understand why you've replaced "func" (the parameter) with "aFunc", but in that case the parameter was being defined in the example, so it should already be especially clear that it's not a keyword in that context.
Why shorten "Parameters" to "Params", but expand "RetVal" to "ReturnValue"?
"Parameters" should be replaced with - not contain - a list of parameters. (It is assumed that the reader is already familiar with function calls and knows how to write a parameter list.) I don't know of anywhere else in the documentation that uses "params" other than as the name of a variable/parameter containing an array of parameter values, which is not what is needed in this case. By contrast, "RetVal" is just an arbitrary variable name; the assignment is there to succinctly show that the expression yields the function's return value.
I don't see the purpose of replacing "length" with "StringLength". As far as I can recall, none of the method/property names for any of the built-in objects include the object type in the method/property name. I think that would be contrary to common OOP conventions.