Skip to content

Revise Import. Add ZIP import - Part 1.#1841

Merged
rocky merged 11 commits into
masterfrom
add-Import-zip
Jun 16, 2026
Merged

Revise Import. Add ZIP import - Part 1.#1841
rocky merged 11 commits into
masterfrom
add-Import-zip

Conversation

@rocky

@rocky rocky commented Jun 15, 2026

Copy link
Copy Markdown
Member

Start redoing Import

  • Add eval_FindFile and eval_FileFormat. Use these instead of Expression(...).evaluate.
  • Start handling ZIP imports.
  • Move Formats under SystemFiles which is where WMA put this. Start reducing differences in these files; but the files are renamed to .wl to avoid confusion with Objective C's .m files.

@rocky rocky changed the title Add import zip Revise Import. Add ZIP import. Jun 15, 2026
@rocky rocky marked this pull request as draft June 15, 2026 01:50
rocky added 7 commits June 16, 2026 06:43
Add eval_FindFile and eval_FileFormat. Use these instead of Expression().evaluate
Import[xxx, "Elements"] now gets field names from RegisterImport's
AvailableElements field.
Eventually, though, we'll remove all of these autoloaded files.
And isolate Import[xxx, Elements] tests
rocky added 3 commits June 16, 2026 07:19
AvailableElements is what WMA uses.
This is where it is in WMA.

Also, some administriva. File locations have been adjusted.
@rocky

rocky commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

@mmatera this is starting to get large. Should I finish this off and leave more stuff for another PR. Split this into smaller pieces? Or continue in this PR?

return eval_ZIPImport(path.value)

def eval_elements(self, path: String, evaluation: Evaluation):
"""%(name)s[path_String]["Elements"]"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if this get applied... My guess is that once the head of the expression get evaluated, it produce a different expression, which does not match with this rule.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You are correct. It does nothing. It also appears elsewhere. Magically, though, we can extract elements.

I will investigate later and revise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see what was up that should have been

 """%(name)s[path_String, "Elements"]"""

I've tested that the this pattern matches. Good catch!

But more will come, and more tests for this later.

@rocky rocky marked this pull request as ready for review June 16, 2026 18:30
@rocky rocky changed the title Revise Import. Add ZIP import. Revise Import. Add ZIP import - Part 1. Jun 16, 2026
@rocky rocky merged commit c72f76a into master Jun 16, 2026
18 checks passed
@rocky rocky deleted the add-Import-zip branch June 16, 2026 18:30
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