Ok I fixed that. I ran wish from the outer directory where that file is.
Sorry to bother you.
Maybe this will be useful to some people. Some problems and work arounds.
A couple of other things. The arrow keys in the repl don't work, neither on the sbcl version nor on the chez scheme version. Wrapping with rlwrap didn't seem to fix it, at least when I tried that with the scheme version inside of nix.
But what DOES work is running the repl inside of emacs.
That itself took some work. There's a shen mode for emacs in ELPA but as the people here probably know you pretty much need the GNU-devel version. So here's a copy of my .emacs file to give people an idea how to get that. It also shows that I have envrc (supporting direnv to work with nix) installed and I'm suppression some warnings from both shen-mode and envrc.
*****************************************************************************
;; ==========================================
;; 1. PACKAGE ENGINE & ARCHIVE CONFIGURATION
;; ==========================================
(require 'package)
;; Add standard MELPA and the GNU-devel repository containing the fixed code
(add-to-list 'package-archives '("melpa" . "
https://melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu-devel" . "
https://elpa.gnu.org/devel/") t)
(package-initialize)
;; Pin shen-mode exclusively to the development branch to fix the macro bug
(setq package-pinned-packages
'((shen-mode . "gnu-devel")))
;; ==========================================
;; 2. AUTOMATIC PROFILE DATA (SYSTEM PACKAGES)
;; ==========================================
(custom-set-variables
'(package-selected-packages '(envrc shen-mode)))
(custom-set-faces
)
;; ==========================================
;; 3. LANGUAGE MODE HOOKS & BINARY PATH OVERRIDES
;; ==========================================
;; Force Emacs to load .shen extensions with the major mode
(add-to-list 'auto-mode-alist '("\\.shen\\'" . shen-mode))
(with-eval-after-load 'shen-mode
(setq inferior-shen-program "shen-scheme"))
(add-hook 'shen-mode-hook
(lambda ()
(setq inferior-shen-program "shen-scheme")
;; CRITICAL: Bind your local Nix Chez Scheme engine to the interactive hooks
(setq scheme-program-name "shen-scheme")
(setq inferior-lisp-program "shen-scheme")))
;; ==========================================
;; 4. DEPLOYMENT AND ENVIRONMENT DAEMONS
;; ==========================================
;; Start the Envrc tool to automatically map your Nix directory environment
(add-hook 'after-init-hook 'envrc-global-mode)
;; Suppress the annoying async native compilation warning popups
(setq native-comp-async-report-warnings-errors 'silent)
********************************************************************************
The first time you load this in emacs you have to run" M-x package-refresh-contents" and then "M-x package-install" then enter "shen-mode" and if you were like me and needed envrc, you'd have to do that again for envrc.
Another problem is that you need a shen repl running so that's "M-x run-shen"
If you are trying a version of shen that depends on a nix directory with flake and direnv (which is how I run the chez version, with a slightly different .emacs file where the shen executable is just "shen-scheme"). Then you'll need to load a shen file from that directory so that the environment variables are pointing at that version of shen and run that "M-x run-shen" command while that buffer is on top.
Unfortunately while you can run the shen ide code this way, you can't run your own tk tcl files through the same copy of wish and the same repl. So if you run (ide.myIDE) inside of the emacs shen repl you won't be running any other shen tk programs through it.
You can close the ide and restart wish, but you also have to restart the repl. There might be some way to clear it, but I haven't learned it yet.
I've seen some older discussions online that the ways to exit shen are platform specific. So for the scheme version it's (scm.exit) and you have to have (tc -) first.
Some people say that (cl.exit) worked but now the way to exit sbcl is (sb-ext:quit) but shen doesn't understand (cl.sb-ext:quit) there may be some way to do that, but I don't know it yet. So instead I go to the *inferior-shen* buffer, pull down "Signals" and select "BREAK". That gives me a menu where hitting "1" followed by return exits shen. Then you can close the buffer and start run-shen all over again.
Unfortunately to test tk shen programs you seem to have to restart shen and wish every time.
Note, the shen-mode keys to run a file are "c-c c-l"