Skip to content

Move contrib/chemistry.mac into core STACK Maxima function. #1765

Open
sangwinc wants to merge 1 commit into
devfrom
iss1764
Open

Move contrib/chemistry.mac into core STACK Maxima function. #1765
sangwinc wants to merge 1 commit into
devfrom
iss1764

Conversation

@sangwinc
Copy link
Copy Markdown
Member

Move contrib/chemistry.mac into core STACK Maxima function. Fixes #1764

@sangwinc sangwinc requested a review from aharjula May 30, 2026 07:57
@sangwinc
Copy link
Copy Markdown
Member Author

Comments on this would be welcome @aharjula, thanks.

/* Combined and processed maximasrc/ content. */
load("maximasrccompiled.mac");

stack_chemistry_declare(ex) := load("chemistry.mac");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The thing with this that worries me is that this will trigger a load of a file at execution time. Even though most, if not all other things, are already inside the image, this would not be. It might be better to simply have the whole of "chemistry mac" inside this function.

If I recall correctly, some time ago, half a decade or more, there were cases where people had managed to generate a maxima image, but some logic failed because the image could not load external scripts related to some setting that loaded stuff in this style. That was probably due to issues with the Maxima execution environment, but I think we wrote open those loads to avoid that.

I think it was issue #411 where we removed various loads, in particular those Lisp loads, but I don't recall what the original cause for that was.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would do as follows:

  1. Write chemistry.mac as a definition of a function (stack_chemistry_declare) that defines all those values and things.
  2. And then top-level load that chemistry.mac.

This is to avoid having to go to the file system to load that separately, and instead have that bit already parsed in the image.

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.

2 participants