Testing if an interpreter supports additional windows

How do you test whether an interpreter will support additional windows (specifically, a text buffer window created by Flexible Windows)?

Try to open a window, see if you get back a window ID or 0.

Hmmm, that may cover some cases I was thinking of. But I was hoping there was also a way to avoid crashing an interpreter that is apt to crash upon attempting to open a window. By checking if the interpreter is up to date in its specifications, maybe?

If an interpreter crashes on trying to open a window, that’s a straight-up bug. A window-open request (assuming the arguments are legal) will either succeed and return an ID, or fail cleanly and return 0.

As far as I know only Spatterlight has crashed.

What kind of window were you trying to create?

If you’re using Flexible Windows it could be many other glk calls that cause the crash. I’m not sure if there’s any easier way to pinpoint the problem code, but inserting debug logging statements should work.

Thanks to some transcripts from a tester with Spatterlight, it looks like behavior is inconsistent.

In one transcript, the window successfully opens, but crashes on attempting to close it. In another, it crashes on attempting to open it. In the transcript where it crashes on attempting to open, the marker text in the carry out rule is never printed. So I’m guessing it’s this understand line:

[code]Understand “sidebar” as turning on the commands sidebar when the sidebar is g-unpresent and the sidebar is allowing toggling.

Carry out turning on the commands sidebar (this is the turn on the commands sidebar rule):
say “(1)”;
(etc.)[/code]

because the (1) is not printed.

In one run, typing RULES (before trying to open the window) crashes Spatterlight. In another, ACTIONS (before trying to open the window) crashes Spatterlight. ACTIONS worked successfully once (in the same transcript where the window successfully opened).

So maybe the “if sidebar is g-unpresent” condition is throwing it off sometimes? But then I don’t know what to make of RULES and ACTIONS.

(“Allowing toggling” is a property of the sidebar set with

The sidebar can be either allowing toggling or disallowing toggling. The sidebar is allowing toggling.

I don’t know why that would present a problem.)