larsbrinkhoff / forth-mode

Wants to be the SLIME of Forth
GNU General Public License v3.0
61 stars 17 forks source link

wrong type argument stringp nill error with forth-load-file under mingw32 (msys2) and lbforth #69

Closed vigilancetech-com closed 7 years ago

vigilancetech-com commented 7 years ago
  1. from within (spac)emacs I load up a file in the lbforth home directory (e.g. INSTALL).

  2. I then load up lib/bench.fth.

  3. I execute run-forth (M-x run-forth, or SPC SPC run-forth)

  4. tell it I want to use lbforth ("forth" executable)

  5. I verify its running by typing "words"

  6. I switch back to bench.fth with C-x o

  7. I do C-c C-l to "load" the current buffer into forth.

  8. I get this stack trace in the debugger:

Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match("[?[0-9;]*[a-z]" nil 0) forth-scrub(nil t) forth-load-file("c:/msys64/home/kevin/0work/lbForth/lib/bench.fth") funcall-interactively(forth-load-file "c:/msys64/home/kevin/0work/lbForth/lib/bench.fth") call-interactively(forth-load-file nil nil) command-execute(forth-load-file)

And this message from windows:

image

System Info :computer:

vigilancetech-com commented 7 years ago

I'm thinking this might be more to do with benchmark rather than forth-mode. I tried loading other files and it worked. Its just benchmark was the first. So this probably needs to be reported in lbforth rather than here.

larsbrinkhoff commented 7 years ago

Thanks!

I'll look into bench.fth. I haven't used it in a while so maybe it has rotted.

larsbrinkhoff commented 7 years ago

Note that bench.fth uses lib/elapsed.fth to measure time. That library file only words in Linux/x86.

larsbrinkhoff commented 7 years ago

Part of the problem may be that you started lbForth from the lib/bench.fth buffer. That made lbForth run from the lib directory.

bench.fth first includes lib/elapsed.fth, which words if lbForth has been installed. It can find its library files.

Then it tries to include files in the contrib directory. Those files can only be found if the current directory is the top-level lbForth source code repository.