Page MenuHomeFeedback Tracker

[Feature Request] New syntax for `resize`
Feedback, NormalPublic

Description

[[ URL | name ]]A new syntax that allows you to specify the default array elements would be nice:

array resize [count, default]

default should be a shallow copy (i.e. if it's an array/hashmap, only the array/hashmap itself should be copied, not the values).

Example 1:

_arr = [];
_arr resize [4, []]; //should give [[], [], [], []];

Example 2:

_arr = [];
_element = [[1,2]];
_arr resize [2, _element];
_arr#0 pushBack 4; //should give: [ [[1,2],4], [[1,2]] ]
_arr#1#0 pushBack 3; //should give: [ [[1,2,3],4], [[1,2,3]] ]

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

Leopard20 updated the task description. (Show Details)Jun 12 2022, 8:48 PM
Leopard20 changed Severity from None to Feature.
Leopard20 changed Category from General to Scripting.
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)
Leopard20 updated the task description. (Show Details)
This comment was removed by BIS_fnc_KK.

Well, lucky you, there was a method in the engine. Added in 149528

BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Jun 14 2022, 11:03 AM
BIS_fnc_KK changed the task status from New to Feedback.
BIS_fnc_KK updated the task description. (Show Details)
BIS_fnc_KK added a subscriber: BIS_fnc_KK.