Re: Replacing percent signs
Posted: 22 May 2017, 18:34
+1 @nnnik
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=37&t=31184
I think you rather meant %{x:x,y:y,w:w,h:h} but how are you going to add spaces when the output should be x10 y10 w10 h10?nnnik wrote:{x:x,y:y,w:w,h:h} seems like the best candidate for that.
(I figured it would be better to continue the discussion here than to reply in the above topic.)fincs wrote: ↑15 Oct 2019, 19:25At some point there was a string variable interpolation syntax, but that was removed. Presumably this was due to the fact that Format is superior and should be used instead. However some popular languages do have variable interpolation as a way to cut down on syntactic noise stemming from repeated concat operators. If variable interpolation in strings is reintroduced then we can get rid of auto-concat, which can be seen as kludgy syntax that results in unexpected/unintuitive results (Function(Param) works, Function (Param) does not).
lexikos wrote: ↑29 Apr 2017, 02:58I have also been reconsidering percent-sign derefs in quoted strings, as they were primarily an attempt at integrating the "legacy" syntax with expressions and bringing more consistency to the language. Though I'm reluctant to deviate from the v1 expression syntax, I think there are more readable alternatives for variable/expression substitution within strings.
lexikos wrote: ↑20 May 2017, 20:46I have long felt that all of the changes I made to command syntax (up to the current build) were inadequate; despite the cost (to compatibility), they would not eliminate the confusion users have with percent signs or make the syntax easier to learn, and the language and documentation are still (or would be) unnecessarily complicated.
My current feeling is that removing percent sign derefs is along the same lines as removing command syntax. Percent-derefs are (debatably) more readable and/or convenient, like command syntax. They are entirely redundant, like command syntax. There are still different meanings of %, so it doesn't eliminate the risk of users mistakenly using percent signs where they aren't needed. Basically, %variable% derefs must go.