Cipherd@lemmy.ml to Programmer Humor@programming.dev · 1 day agofunctionslemmy.mlimagemessage-square98fedilinkarrow-up1559arrow-down17file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up1552arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 1 day agomessage-square98fedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up1·4 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.