Cipherd@lemmy.ml to Programmer Humor@programming.dev · 2 months agofunctionslemmy.mlimagemessage-square117fedilinkarrow-up1602arrow-down19file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1593arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 2 months agomessage-square117fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up0·2 months 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.