* Paulo Madeira [2011-11-22 13:46] writes:
Could frame-package's default implementation be (eval-in-frame 'cl:*package* frame-number)?
Hmm... yes, but I'm not sure in what cases that would be better than what we do know. Currently we return nil by default. That way we can at least tell that the backend has no strong opinion on the matter and we simply use the current value of *package* as fallback.
The purpose of frame-package was primarily that we can read the names of local variables without package prefix. That package is actually more a (static) property of the frame's function than a (dynamic) property of the stack frame itself. Basically we are interested in the package that was current when the function was compiled.
In many implementations (eval-in-frame '*package* <N>) is literally the same as (eval '*package*). In Lisps that actually bother to reconstruct the dynamic environment of the time of the call it's also not necessarily the same package as it was when the function was read/compiled.
(eval-in-frame '*package* <N>) seems to be as good/bad as the current default but I haven't actually tried it.
Helmut