Cipherd@lemmy.ml to Programmer Humor@programming.dev · 1 day agofunctionslemmy.mlimagemessage-square92fedilinkarrow-up1536arrow-down17file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1529arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 1 day agomessage-square92fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up1·3 hours agoTurns out you can, by using () instead of {} in the function declaration you can run the function in a subshell where changes to variables are scoped to the subshell and functions are local.
Turns out you can, by using () instead of {} in the function declaration you can run the function in a subshell where changes to variables are scoped to the subshell and functions are local.