Here’s a question for Scheme (or, I think, Lisp) programmers.
I’m learning to program the “text user interface” in Fluent software (which calculates fluid flow problems), and it is based on Scheme, a dialect of Lisp. Scheme is new to me, nor do I know Lisp, and I’m using Web references from schemers.org, a book by Dybvig, and other tidbits to pick my way along, but have hit a hitch. AFAIK this is a basic Scheme programming issue I don’t understand, maybe the same in Lisp too.
Fluent provides a Scheme procedure called ti-menu-load-text that passes text strings to a text menuing system (which I gather is just a Scheme loop evaluating input anyway). So for instance
(ti-menu-load-string “/display/close-window 1”)
will close the first Graphics Display Window. I note also that it seems to leave a #t (boolean “true” value) behind. That is, what I see at the prompt when I do this is:
> (ti-menu-load-string “/display/close-window 1”)
/display/close-window 1#t
>
All that is fine. The problem is that defining a procedure to do this and then running the procedure (this is all done by reading in a little text file of the code) doesn’t work right. What it does is close the graphics window, and then give me an error message, to wit:
> (define shell
(ti-menu-load-string “/display/close-window 1”)
)/display/close-window 1shell
> (shell)
Error: eval: invalid function
Error Object: #t
Moreover, subsequent lines in the text file don’t get processed either. This is just a guess, but I wonder if what is going on is that the ti-load… procedure returns a boolean, and if you just run the procedure by itself the boolean gets displayed, but if you put it inside another procedure (what I named "shell), the eval procedure tries to operate on the boolean and chokes. So I guess I’d need to not return that boolean, or to nest the ti-load… procedure inside some other thing that will consume the boolean, or some such. Does this sound right? Or do I misunderstand entirely?