Overview
| Artifact ID: | 2f38fdda1b77e84940995fba2e07111831c3e61f |
|---|---|
| Ticket: | 2929546fffffffffffffffffffffffffffffffff
"dict with" binds to varibles outside its scope |
| User & Date: | mpdanielson on 2010-01-13 03:17:34 |
Changes
- icomment:
I hit this issue when a dictionary being passed as a parameter had an additional key added, and the new key happened to be the same string as a local variable in a procedure that used "dict with" on the dictionary. Neither the person who wrote the proc nor the person who added the key understood this side effect (I really cannot consider it a feature), so the resulting corrupted variable bug was mysterious. Even using "apply", it's still dangerous to use "dict with" on a dictionary parameter unless your naming convention for keys and local variables ensure the two won't conflict. Using "dict update [dict get ...] ..." avoids the problem, so perhaps an example of that would highlight the issue.
- login: "mpdanielson"
- mimetype: "text/plain"
- username: "mpdanielson"