ID:2665758
 
Not a bug
BYOND Version:514.1545
Operating System:Linux
Web Browser:Firefox 86.0
Applies to:Dream Maker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:

Using `new /list(arglist(somelist))` to create a new list will always create an empty list regardless of what you pass as somelist


Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
var/list/input_list = list(1, 2, 3)
var/list/output_list = new /list(arglist(somelist))


Expected Results:

I expected for the output list to be equivalent (in the traditional sense of containing the same values in the same order) to the input list (1, 2, 3)

Actual Results:

The output list is an empty list.

Does the problem occur:
Every time? Or how often?
In other games?
In other user accounts?
On other computers?

As far as I've tested this occurs every time.

When does the problem NOT occur?

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:

Lummox JR resolved issue (Not a bug)
new/list() and list() are actually two different calls.

new/list() only takes a single argument, which is the length of the list. list() creates a list from the items you specify.

var/L = new/list(3)
src << json_encode(L) // [null,null,null]

L = list(3)
src << json_encode(L) // [3]

L = list(1, 2, 3)
src << json_encode(L) // [1,2,3]