Skip to content

Conversation

@rmkaplan
Copy link
Contributor

@rmkaplan rmkaplan commented Dec 6, 2023

If the image object is on a hyphenated file and it can find a nonhyphenated sister, it loads that. If that doesn't provide the getfn, it tries the original file.

It tries to find a compiled version, goes to source if a compiled doesn't exist.

When it fails, it also tries to be more informative about the problem, to indicate whether the getfn is unknown, or there was an error in its execution.

This latter is not completely right: if an image object (sketch) contains another image object (say an LFG object), it will find the sketch getfn (when the Sketch-renaming PR is merged). But it won't find the getfn for the embedded LFG object because LFG is not in the WHEREIS database. It's really the lower getfn that is unknown, but I don't see how to propagate that fact to the upper sketch-object. So the label says that it's the sketch function is unknown.

It ought to say either that there was an error in executing the sketch function or, better, that the LFG function was unknown. I don't know how to propagate the signal to the top-level call.

If the image object is on a hyphenated file and it can find a nonhyphenated sister, it loads that.  If that doesn't provide the getfn, it tries the original file.
@masinter
Copy link
Member

masinter commented Dec 9, 2023

I am uncomfortable having it automatically load because we haven't extended WHEREIS with notecards, and notecards has its own imageobject definitions. So HCFILES will work differently if you HCFILES notecards. I'd like to set up a breakpoint if it can't find the GETFN.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Dec 9, 2023 via email

@masinter
Copy link
Member

masinter commented Dec 9, 2023 via email

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Dec 9, 2023 via email

Copy link
Member

@masinter masinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unknown GETFN should only auto-load if explicitly set up to do so (a global AUTOLOADONCALLFLG?

I also don't like extending the two-level directory structure into code all over the place. It's an ugly hack to solve an organiational problem for the short-term but let's not make other parts of the system depend on it.

'BODY GETFNFILE)
NIL
(APPEND *COMPILED-EXTENSIONS* (CONS NIL]))
(if T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's going on here is that one of the 'imrovements' we made was when there is an unknown GETFN, you call WHEREIS T to see if you can load it. We're kind of backing into an 'autoload' feature which Interlisp didn't have.... but learn from history. It's a DWIM feature where things can go awry badly and unnoticed if you LOAD the wrong file.

Yes, there are cases where autoload on function call is fine, but it shoudln't be the default. Explicitly setting up an autoload list of known GETFNs would be better, and a BREAK or askuser on unknown GETFN and ERROR if not found would be better.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Dec 9, 2023

It can be conditioned on a flag, but then, what should the default be?

WRT the two-level directory structure: it's either a bug or a feature. Do you have a proposal for a better way of organizing and relating the subfiles that make up a larger application?

The current "hack" puts some order on the top-level directories (what goes with what), and also provides a mapping from a subfile to the main file.

@masinter
Copy link
Member

masinter commented Dec 9, 2023

I started down a path to share the GETFN code with HPRINT (with the idea of finishing the Common Lisp integration so that once again HRPINT can print anything in a way that it can be read in.

#1436 (review)

In particular, HPRINT should be able to print a bitmap and a font -- then EQUALALL could default to "print to string and string-compare".

I backed off but now we really need font-compare to deal with all the CHM-Parc font files and start to make progress on the "better fonts for high-res displays" we postponed.

@rmkaplan
Copy link
Contributor Author

rmkaplan commented Dec 9, 2023 via email

Copy link
Member

@masinter masinter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a more general AUTOLOAD approach, but ... this is the Interlisp way.

@rmkaplan rmkaplan merged commit 72456ce into master Dec 10, 2023
@masinter masinter deleted the rmk96--Another-WINDOWOBJ-revision branch March 8, 2024 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants