Opened 12 years ago
Closed 12 years ago
#2656 closed Feature Request (Rejected)
array automatic redim for $array[] = ...
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
dear developers. Whether technically difficult to make constructions like $some_array [] = 3, automatically adds a new element to the array $some_array?
Attachments (0)
Change History (10)
comment:1 by , 12 years ago
| Version: | 3.3.8.1 |
|---|
comment:2 by , 12 years ago
Your suggestion of this syntactic sugar is greatly inferior to what ReDim currently allows. Hence ReDim would still be needed for N-dimensional arrays. Moretheless it would possibly collide with another future feature using part of this syntax.
comment:6 by , 12 years ago
This feature requires an internal replacement for _ArrayAdd.
But PHP shows... It's possible.
I like the idea.
follow-up: 8 comment:7 by , 12 years ago
That is only syntactic sugar for _ArrayAdd($arr, 3), is that really necessary?
follow-up: 9 comment:8 by , 12 years ago
Replying to anonymous:
That is only syntactic sugar for
_ArrayAdd($arr, 3), is that really necessary?
I think that it's time to get AutoIT native functions for working with arrays, and not rely on additional libraries such as _array ..
comment:9 by , 12 years ago
Replying to anonymous:
I think that it's time to get AutoIT native functions for working with arrays, and not rely on additional libraries such as _array ..
Hm... why not $arr.push($value), returning $value? That doesn't require a new operator.

Automatic ticket cleanup.