swagfag wrote: ↑17 Oct 2021, 17:12
fix the syntax errors and the ambiguities will be resolved. if not, it is only
then that u may start investigating why some things are like this and not like that
But it is interestiing for me anyway.
There are syntax errors. Ok. Autohotkey should complain. Ok. But it doesn't complain. Ok. What value should Autohotkey assign to var a if it doesn't complain? It should be a blank, I think!
But why do I get a=11 in some cases of in fact the same syntax error? Why isn't it a blank?
And lets think about adding this trick to the interpretator.
A lot of years ago constructions as
i++ didn't exist in programing. They would be syntax errors. Why did people invent such constructions? They are convinient and logically safe.
What should I use now in AHK v1? Something like this:
Code: Select all
LongLongVeryLongVar := (5>0) ? LongLongVeryLongVar + 1 : LongLongVeryLongVar - 1
; or this:
if (5>0)
LongLongVeryLongVar++
else
LongLongVeryLongVar--
That obviously isn't convinient. I think, Autohotkey should permit
LongLongVeryLongVar := (5>0) ? ++ : --, b/c it is convinient and logically clear and safe.