Hi Maxim, Danilo, Rick,
> It seems that 'apply' and 'let' do not call the same 'bind' procedure.
Yes, you are all correct!
The "upper context" in 'eval' and 'bind' refers to _lambda_ bindings
(function calls), and not to local variable bindings like 'let', 'use',
While normally there is no inherent difference between those bindings,
they are handled in a slightly special way in evironment offset counts
for 'eval' and 'run', but also in debug backtraces ('trail', 'bt').
The reason for that is pragmatism. It would be tedious to count all
nested 'let' calls in a function until you find your way out of it, and
it would be impossible to determine the right value when you are in
nested function calls more than one level deep. Also, the variable
bindings in the current function are obvious anyway, and it doesn't make
much sense to bind the same variable multiple times within the same
lambda context and then to refer to the outer one.
I fixed the references of 'eval' and 'run', by calling it
BTW, the 'cnt' argument to 'up' has yet another meaning. It counts the
nth _symbol_, and does not refer to binding evironments.