You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.
Probably something I am doing wrong here but see the last two cases
locall=List.create(5,"foo")
print(l)
-- Result OK
[1] ="foo",
[2] ="foo",
[3] ="foo",
[4] ="foo",
[5] ="foo"print(List.set(l, 1, "foz"))
-- OK
[1] ="foz",
[2] ="foo",
[3] ="foo",
[4] ="foo",
[5] ="foo"print(List.set(l, -1, "bar"))
-- OK
[1] ="foo",
[2] ="foo",
[3] ="foo",
[4] ="bar",
[5] ="foo"-- Should error? Or add value at index 6?print(List.set(l, 6, "baz"))
[1] ="foo",
[2] ="foo",
[3] ="foo",
[4] ="foo",
[5] ="foo"-- Should set last value to "baz", but errorsprint(List.set(l, 0, "baz"))
--[[ 12:24:03.853 ReplicatedStorage.Common.Llama.List.set:17: index 0 out of bounds of list of length 5 - Server - set:17 12:24:03.854 Stack Begin - Studio 12:24:03.854 Script 'ReplicatedStorage.Common.Llama.List.set', Line 17 - function set - Studio - set:17 12:24:03.854 Script 'ServerScriptService.Server', Line 49 - Studio - Server:49 12:24:03.854 Stack End - Studio]]
The last one is definitely a bug. The second to last one should error. It's an easy fix but I don't know if it was a good idea to support negative indices in the first place...
That said, I'll fix (or remove) this feature in the next major release of Llama 👍
Probably something I am doing wrong here but see the last two cases
Full code
The text was updated successfully, but these errors were encountered: