In the interaction environment, open-coded primitives do not reflect redefinition
The following is a simple test:
(import (scheme base)
(scheme eval)
(scheme repl)
(chibi test))
(eval '(define (f x) (+ x 2))
(interaction-environment))
(eval '(define + *)
(interaction-environment))
(test-begin)
(test 20 (eval '(f 10)
(interaction-environment)))
(test-end)
(test-exit)
It's a little weird to talk about references at a point when the references no longer exist :)
This will be a command-line option basically to disable open coding in the repl, and I may default it to enabled.
Hmmm... on second thought I'm not actually sure how much sense it makes to support this.
Imported bindings are immutable. Redefinition is mutation. In Chibi, "redefining" an imported binding therefore instead shadows the binding - by design it should not affect anything using the original imported binding. Procedures which have already been compiled referring to the original binding should not see any change unless they are recompiled, and storing source and tracking what needs recompilation is far too complex for Chibi.
Redefinition of non-imported bindings should still work though, and currently don't with primitives:
(define add +)
(define (f x) (add x 2))
(define add *)
(f 10)
=> 12 ; should be 20
This sort of redefinition works for non-primitives, and I could make it work for primitives but it seems too unlikely to occur to be worth the effort.