Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681384yNope, this would require r containing the indexes before r has been allocated the indexes to do a lookup against 😅
Quantum arrays anyone? -
iiii92194yIt's probably a bad idea because it masks multi step initialization which will take more time and resources than normal one.
-
C0D4681384yI still don't understand the use case,
Does "1" and "2" not come from variables?
Are you literally trying to make a stupidity long 1 liner like:
x = [(4 * 5), (747.666 * 12), (self[0] + self[1])]
Wouldn't all these values still be stored in a variable of some kind somewhere resulting in:
a = 4 * 5
b = 747.666 * 12
x = [a, b, ( a + b ) ]
Simplified for argument sake!
are you really anti-variable?
so... self-referential arrays.
do you know any languages that have them? thoughts?
what I mean is (in pseudo-c# syntax) :
string[] r = new string[]{ "1", "2", self[0] + " and " + self[1] };
which would result in an array with items:
1
2
1 and 2
question