chickadee » live-define » define

(define name (lambda arguments body ...))syntax
(define (name arguments) body ...)syntax

A macro that replaces the standard Scheme define with one that, when it detects that a procedure is bound to name, mutates that procedure in place instead of binding the name to a new procedure.

This is useful in situations where you pass the procedure name as an argument to another and want to change it’s behavior while the program is running. For example by using your text editor’s facility to send code to a running instance of csi.

Please note that this is only intented to be used within the interpreter and will probably break in various ways if used in compiled code