remove arg.n
Posted: Sat Jun 17, 2017 11:03 pm
This time not a feature request, but a request to remove a feature.
When using
it always sends a table that contains the sent args, plus the n counter.
However, as i was thinking about it, this n actually creates more problems than it solves.
Unless I am missing something here, there is no need for n as it can simply be done with
Instead, it more often makes code more complicated.
For example as i was about to use
it didnt work, since mysubfunction was assuming all items were tables, but since n isnt, it failed at that point. So i had to make extra effort and use:
And this makes the code much messier when task was somewhat simple otherwise.
Not to mention if I was sending a table of numbers that i want to go through each, favorably with "foreach" then to find out to skip n, i would need to compare the key if it is "n" or not. It also makes me worry if you are planning to add even more features to this spot, in which case code i make now, might be necessary to redo in future since they might not be able to handle the new arg.x.
Hence I am suggesting of removing arg.n from future hollywood versions unless it has some purpose that I am missing about it.
When using
Code: Select all
function func(...)
However, as i was thinking about it, this n actually creates more problems than it solves.
Unless I am missing something here, there is no need for n as it can simply be done with
Code: Select all
TableItems(arg)
For example as i was about to use
Code: Select all
foreach(arg, mysubfunction(key, value))
Code: Select all
if gettype(key) = #TABLE
endif
Not to mention if I was sending a table of numbers that i want to go through each, favorably with "foreach" then to find out to skip n, i would need to compare the key if it is "n" or not. It also makes me worry if you are planning to add even more features to this spot, in which case code i make now, might be necessary to redo in future since they might not be able to handle the new arg.x.
Hence I am suggesting of removing arg.n from future hollywood versions unless it has some purpose that I am missing about it.