ID:2498542

 Applies to: DM Language
 Status: Open Issue hasn't been assigned a status value.
Like this (THIS IS EXAMPLE):
```var/list/L = list("CAT", "DOG", "GOAT")world << L[-1]//Must output "GOAT" in worldworld << L[-2]//Must output "DOG" in world.world << L[-4]//Must be runtimed or index start from end second time, so we have two branches, it runtiming or it will return "GOAT"
```

Workaround:
```world << L[length(L)]//Must output "GOAT" in worldworld << L[length(L) - 1]//Must output "DOG" in world.
```

or
```L[L.len]
```
 Aug 15 2019, 8:39 pm ```L[abs(-2)] ``` gg
 Aug 15 2019, 8:48 pm Which works for exactly 1 element in the entire list.
 Aug 16 2019, 1:36 am (Edited on Aug 16 2019, 2:03 am) In response to Kozuma3 Kozuma3 wrote: ```L[abs(-2)] ``` gg This code is an example, i needn't your crutches for this. And it will get element with index 2 not -2, what will you do (using abs()) when length of list will be 4 or more? [-2] and [2] won't be equal.
 Aug 16 2019, 9:55 am The correct workaround for L[-n] is L.len - abs(n) + 1.
 Aug 16 2019, 9:58 am In response to MisterPerson MisterPerson wrote: The correct workaround for L[-n] is L.len - abs(n) + 1. Just explain me why it and how it will get element from end
 Aug 16 2019, 11:58 am ```var list/l = list( "Cat","Dog","Goat","Pig")mob/Login() var n = -2 src << l[l.len-abs(n)+1] // l.len = 4 // abs(-2) = 2 // (4 - 2) = 2 + 1 = 3 ```
 Aug 17 2019, 7:07 pm I do think there's value in this feature, especially since a lot of the string manipulation procs take negative indices.
 Aug 23 2019, 3:57 am In response to Kozuma3 Kozuma3 wrote: ```var list/l = list(> "Cat","Dog","Goat","Pig"> )>>>> mob/Login()> var n = -2> src << l[l.len-abs(n)+1]> // l.len = 4> // abs(-2) = 2> // (4 - 2) = 2 + 1 = 3 ``` Why all of you creating not optimized, silly workaround, when i showed you optimized, small workaround?
 Aug 23 2019, 4:01 am In response to MisterPerson MisterPerson wrote: I do think there's value in this feature, especially since a lot of the string manipulation procs take negative indices. Like copytext(text, -1, -6), yeah?