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
Most of the current xpanes functions looks like this example the moment:
local window_name="$1"
shift
local index_offset="$1"
shift
local interval="$1"
shift
local repstr="$1"
shift
local cmd="$1"
While this works fine and from an resource optimization perspective, as multiple shifts is lightweight operations.
The readability takes a hit as all functions becomes very much larger than they need to be.
For most functions we should in theory be able to do following:
local window_name="$1"
local index_offset="$2"
local interval="$3"
local repstr="$4"
local cmd="$5"
and in cases we need to fully reset the positional parameters we can do this instead:
local window_name="$1"
local index_offset="$2"
local interval="$3"
local repstr="$4"
local cmd="$5"
shift 5
@greymd is there any reason to why we utilize multiple shifting? Do you want me to proceed creating a patch to move the functions to the proposed syntax?
The text was updated successfully, but these errors were encountered:
@greymd is there any reason to why we utilize multiple shifting? Do you want me to proceed creating a patch to move the functions to the proposed syntax?
There isn't a particular reason, it was just my preference. Using shift was more convenient for me, as it allowed me to easily delete or swap specific elements without needing to reassign the numbers from $1 to $N. During the development phase of creating xpanes from scratch, I frequently added or deleted arguments and changed their positions.
Do you want me to proceed creating a patch to move the functions to the proposed syntax?
Thank you! Please go ahead :) As xpanes is now mature and in the phase of refinement, any changes that improve readability are welcome.
There isn't a particular reason, it was just my preference. Using shift was more convenient for me, as it allowed me to easily delete or swap specific elements without needing to reassign the numbers from $1 to $N. During the development phase of creating xpanes from scratch, I frequently added or deleted arguments and changed their positions.
I understand it fully, Then if we have no special case to worry about and we can start working on this. As its just clean up its not top priority to fix it.
Thank you! Please go ahead :) As xpanes is now mature and in the phase of refinement, any changes that improve readability are welcome.
great! I hope when I get time I will look into this over the upcoming month's :)
Most of the current xpanes functions looks like this example the moment:
While this works fine and from an resource optimization perspective, as multiple shifts is lightweight operations.
The readability takes a hit as all functions becomes very much larger than they need to be.
For most functions we should in theory be able to do following:
and in cases we need to fully reset the positional parameters we can do this instead:
@greymd is there any reason to why we utilize multiple shifting? Do you want me to proceed creating a patch to move the functions to the proposed syntax?
The text was updated successfully, but these errors were encountered: