Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have coerceToPathname use Gray stream PATHNAME generic #651

Merged
merged 2 commits into from
Dec 27, 2023

Conversation

yitzchak
Copy link
Contributor

It appears #650 is not quite sufficient for PATHNAME. The spec states that PATHNAME-TYPE, PATHNAME-HOST, etc, should work after close. This means that coerceToPathname will need to call the generic PATHNAME. To accomplish this I've added getPathname to the Stream class.

I've made this a draft because I haven't finished writing tests yet and I haven't verified that TRUENAME works in all cases.

@easye easye marked this pull request as ready for review December 21, 2023 12:57
@@ -2143,12 +2143,10 @@ public static Pathname coerceToPathname(LispObject arg)
return (Pathname) arg;
if (arg instanceof AbstractString)
return (Pathname)Pathname.create(((AbstractString)arg).toString());
if (arg instanceof FileStream)
Copy link
Collaborator

@easye easye Dec 21, 2023

Choose a reason for hiding this comment

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

From visually inspecting things, I'm surprised that such elision for all the types works. From what I recall, there's a set of fairly specialized code paths in the URL-PATHNAME and JAR-PATHNAME constructors getPathname() calls that wouldn't be invoked with this patch as far as I understand.

The tests didn't complete 'cuz gitlab.common-lisp.net was wedged for the ANSI-TEST suite. I've fixed that, re-running tests now. I should look into how we handle various URL-PATHNAME/JAR-PATHNAME tests which I think haven't worked since "googlecode.com" went away that I should fix and/or update.

We'll see…

Copy link
Contributor Author

@yitzchak yitzchak Dec 21, 2023

Choose a reason for hiding this comment

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

gitlab.common-lisp.net seems to break a lot. Because Clasp's build system does lots of git cloning and has dependencies on gitlab.common-lisp.net, we've set up a mirror of some of the repos. ansi-test is here https://github.com/clasp-developers/ansi-test if you want to use it. It refreshes every day. There is also mirror of asdf and a few others.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added @Override for the various getPathname implementations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added tests to nontrivial-gray-streams for the other pathname components. They all pass for this PR.

https://github.com/yitzchak/nontrivial-gray-streams/blob/3275bb649636a962d13cd05498679bd231d538d4/code/test/macros.lisp#L57-L103

Copy link
Collaborator

Choose a reason for hiding this comment

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

Testing looks good wrt. ABCL's PATHNAME specializations (JAR-PATHNAME, URL-PATHNAME).

Mebbe I will add NONTRIVIAL-GRAY-STREAMS to the CI's testing when I get a chance.

@easye easye merged commit bba779e into armedbear:master Dec 27, 2023
8 checks passed
@yitzchak yitzchak deleted the gray-path-2 branch December 27, 2023 13:26
@yitzchak
Copy link
Contributor Author

Thanks @easye!

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