| View previous topic :: View next topic |
| Author |
Message |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Wed Feb 28, 2007 2:07 pm Post subject: ++x Bug (or parsing error) following non var ("xx" |
|
|
see http://www.autohotkey.com/forum/post-107659.html for full diggs...
in summary:
| Code: | msgbox 32,,% #(z) " " ++z " " z++ " " z++ " " z
exitapp
#(byref x) {
if x
return
x = 0
} |
note: z++ works, but ++z does not...
(following quoted literal, or number constant, etc.)
++z does work following another var.
all of above WITHOUT "." _________________ Joyce Jamce |
|
| Back to top |
|
 |
Grumpy Guest
|
Posted: Wed Feb 28, 2007 4:15 pm Post subject: |
|
|
| As ahklerner shown in the linked topic, this is already covered in the manual, ie. that "default concatenation" should be avoided because there are buggy cases. I don't see why you opened this topic, then. |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1205 Location: USA
|
Posted: Wed Feb 28, 2007 8:59 pm Post subject: |
|
|
| I would assume that Joy2DWorld opened yet another topic because Chris did not answer... |
|
| Back to top |
|
 |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 422 Location: Galil, Israel
|
Posted: Wed Feb 28, 2007 11:25 pm Post subject: |
|
|
also, is not clear that Chris is aware of this particular issue.
While a single +x creates a possible ambiguity,
may be possible that the double plus (or minus) (eg. ++x) is sufficiently non-ambiguous to be properly parsed..
especially where x++ does work fine...
and *especially* where ++x does NOT require a period after a variable.
would seem this is fixable,
but... very least...
if is known 'required .' as prefix ... maybe easy addition to doc.
ie. intent is no complaint, but,
hope to help by bringing this specific issue to attention for either (1) fixing it if possible/reasonably easy to achieve, or (2) possible small addition to doc. to 'warn' others of the specific issue and make life smoother and happier for them in the future...
@Grumpy: fair enough ?
@Grumpy: likely am in the minority, but believe that the more accepting the language is of all types of syntax, the more robust and enjoyable it is. If something can have meaning, vs. just being an 'error', my personal vote is to give meaning... Ie. would keep the bothersome periodless concats... (but then again... do realize that is the minority view). _________________ Joyce Jamce |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Thu Mar 01, 2007 3:29 am Post subject: |
|
|
Although support could be added for this, the code to do so seems more complex than it's worth -- especially since I'm leaning toward getting rid of implicit concatenation in v2 (for reasons discussed at length in another topic).
So I've changed the docs to read: "You can also omit the period to achieve the same result (except where ambiguous such as x -y, or when the item on the right side has a leading ++ or --)."
Thanks. |
|
| Back to top |
|
 |
|