Cipherd@lemmy.ml to Programmer Humor@programming.dev · 6 days agofunctionslemmy.mlimagemessage-square106linkfedilinkarrow-up11arrow-down10file-textcross-posted to: programmerhumor@lemmy.ml
arrow-up11arrow-down1imagefunctionslemmy.mlCipherd@lemmy.ml to Programmer Humor@programming.dev · 6 days agomessage-square106linkfedilinkfile-textcross-posted to: programmerhumor@lemmy.ml
minus-squareCaveman@lemmy.worldlinkfedilinkarrow-up0·5 days 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.