Due to If (TRUE), MsgBox() shows an error, If (TRUE) {MsgBox(1), MsgBox(2)} would be fine. Or am I missing something?...
BTW, Good job
v2-thoughts Discussion
Re: v2-thoughts Discussion
Once again, this topic is not for general discussion of v2 or help requests. There are whole forums for that.
I have split this post into its own topic (which could just as appropriately have been posted in Ask for Help).
I have split this post into its own topic (which could just as appropriately have been posted in Ask for Help).
Re: v2-thoughts Discussion
AHK v1.30 will still maintained or dead when v2 will released ?
Too many changes breaks my programs
Personnally I don't care of changes on Object v2... Object work fine in v1.1.31, AHK v1.1.* work fine
The most important is to implement Gui object in v1 and change syntax to remove % on method such as MsgBox % ...
Too many changes breaks my programs
Personnally I don't care of changes on Object v2... Object work fine in v1.1.31, AHK v1.1.* work fine
The most important is to implement Gui object in v1 and change syntax to remove % on method such as MsgBox % ...
Re: v2-thoughts Discussion
I am by no means an AHK expert, but for v2 I would like to have $variable names, i.e. names which start with a $. Simply allow it as a normal character (like in Javascript) or as a mandatory prefix (like in PHP).
That way one can program syntax highlighting better (UDL files for Notepad++).
Also I would like to see ; at the end of the line. AHK has already ; as comments but v1 does not allow x := y; because it demands a space before the ;
That way one can program syntax highlighting better (UDL files for Notepad++).
Also I would like to see ; at the end of the line. AHK has already ; as comments but v1 does not allow x := y; because it demands a space before the ;
Re: v2-thoughts Discussion
I just wanted to say that I'm quite happy with the development of AHK v2 so far. I find these specific changes to be quite helpful:
Just wanted to say thanks to the "big devs" and keep up the good work! I feel closer to "real programming" than I've ever been, and hopefully some day will make the leap to C++ (assuming my brain doesn't explode in the process).
- The Type() function, and the more specific data types in AHK v2 make it easier to handle specific types of data, because they can be detected as their type more easily.
- The new GUI object is amazing! With the ability to operate directly on the HWND of a TreeView or ListView, or to be able to easily get the text AND index of list-type controls, my code is better structured and more readable. It's also nice to not need to rely on DLL calls and additional libraries in order to accomplish these things.
- The new syntax for the changed commands is quite helpful in being able to put more elements of code "inline".
- There have also been a few instances where the handling of COM objects has been noticeably faster as well. I adapted @SKAN's Filexpro() for AHK2 and managed to get better performance out of it.
Just wanted to say thanks to the "big devs" and keep up the good work! I feel closer to "real programming" than I've ever been, and hopefully some day will make the leap to C++ (assuming my brain doesn't explode in the process).
« AHK Portable Installer » | « CallTipsForAll » | « TheArkive AHK v1 Scripts » | « TheArkive AHK v2 Scrpts » | « TheArkive on GitHub »
Re: v2-thoughts Discussion
I updated v2-thoughts.
Last edited by lexikos on 13 Jul 2022, 20:47, edited 1 time in total.
Reason: Updated URL
Reason: Updated URL
Re: v2-thoughts Discussion
Constants sounds nice.
btw. shouldn't it now rather be https://www.autohotkey.com/v2/v2-thoughts.htm (and yes. there is a redirect atm)
btw. shouldn't it now rather be https://www.autohotkey.com/v2/v2-thoughts.htm (and yes. there is a redirect atm)
[AHK] v2.0.18 | [WIN] 11 Pro (23H2) | [GitHub] Profile
Re: v2-thoughts Discussion
I copy-pasted from the top post. I could have left it without a link...
Re: v2-thoughts Discussion
I have used dynamic variable creation for repeated string concatenations, which performs (or at least did at the time) much better than using array/map. Ofc, that wouldn't be a reason to enable dynamic variables rather than optimising arr[x] .= ....Although I'm not sure I've ever seen a case where dynamically creating variables was the best solution to a problem
Re: v2-thoughts Discussion
If the script could be refactored to use a non-dynamic variable, that would be more efficient. I suppose that might not be possible.
I intend to experiment with alternative string representations once it becomes easier (i.e. after doing a lot of house-cleaning in the code base). I do not wish to make language choices based on how the current implementation performs.
I didn't mention it in v2-thoughts, but I've started refactoring script2.cpp, which has become far too large and disorganized. I'm having to jump through hoops to preserve the line history as seen by git blame, due to multiple issues with how git works. Raymond Chen's blog was instrumental in getting git to do what I want.
My next step will probably be to start experimenting with using metadata to create function objects that call native functions, initially limiting it to types used by the built-in functions. I will use this to allow the built-in function signatures to be converted to more natural C++ syntax, where all parameter conversion and type validation is handled centrally. For the short term, this will fix issues with inconsistent parameter type validation. For instance, while writing test cases I found that MonitorGet(&left, &right, &top, &bottom) wasn't initializing one of the variables. The reason was that I missed the N parameter, which should be Integer but is being passed a VarRef.
For the longer term:
I intend to experiment with alternative string representations once it becomes easier (i.e. after doing a lot of house-cleaning in the code base). I do not wish to make language choices based on how the current implementation performs.
I didn't mention it in v2-thoughts, but I've started refactoring script2.cpp, which has become far too large and disorganized. I'm having to jump through hoops to preserve the line history as seen by git blame, due to multiple issues with how git works. Raymond Chen's blog was instrumental in getting git to do what I want.
My next step will probably be to start experimenting with using metadata to create function objects that call native functions, initially limiting it to types used by the built-in functions. I will use this to allow the built-in function signatures to be converted to more natural C++ syntax, where all parameter conversion and type validation is handled centrally. For the short term, this will fix issues with inconsistent parameter type validation. For instance, while writing test cases I found that MonitorGet(&left, &right, &top, &bottom) wasn't initializing one of the variables. The reason was that I missed the N parameter, which should be Integer but is being passed a VarRef.
For the longer term:
- It will facilitate automatic coercion of objects through methods such as ToString(). This isn't done yet because of the cost of implementation with the way parameters are handled at the moment.
- Eventually the code can be expanded to handle more types and calling conventions, making it a replacement for DllCall. This would give the language higher-level support for external libraries, allowing syntax and performance closer to built-in functions.
- Optimizations to how the function objects are generated would apply to both built-in functions and external functions.
- Perhaps some of the code could be reused to give script functions parameter type validation.
Re: v2-thoughts Discussion
Did you mention improving the parser at some point?
I wonder if function statements can be special cased to handle the postfix ? and * better.
It just feels to me that parsing has gotten very ambiguous with prefix / infix / postfix operators and continuation sections - perhaps something a little stronger is needed to keep things clear.
I wonder if function statements can be special cased to handle the postfix ? and * better.
Code: Select all
MsgBox ["deref_me"]*
; EOF marker works.
Code: Select all
MsgBox ["deref_me"]*
if (1 + 1 == 2) ; fails as * begins a continuation section.
MsgBox
Re: v2-thoughts Discussion
If you have an idea or question that does not directly relate to this (v2-thoughts) topic, and still think it warrants discussion after reading this post, start a new topic.
If you want clarification about something that I have written in v2-thoughts, this topic is the appropriate place to post.
A function call statement cannot (legally) be variadic or literally end with var?.
If you want clarification about something that I have written in v2-thoughts, this topic is the appropriate place to post.
This would not be an improvement, nor would it be backward-compatible.iseahound wrote:I wonder if function statements can be special cased to handle the postfix ? and * better.
There would be more ambiguity, not less, if I implemented your suggestion.iseahound wrote:It just feels to me that parsing has gotten very ambiguous with prefix / infix / postfix operators and continuation sections
A function call statement cannot (legally) be variadic or literally end with var?.
Function call statements cannot be variadic; that is, the parameter list must be enclosed in parentheses (or brackets for a property).
The question mark must be followed by one of the following symbols (ignoring whitespace): )]},:.
I have no idea what you mean.iseahound wrote:perhaps something a little stronger is needed to keep things clear.
Return to “AutoHotkey Development”
Who is online
Users browsing this forum: No registered users and 20 guests