Address #282 - improve readability of path.janet#286
Address #282 - improve readability of path.janet#286bakpakin merged 1 commit intojanet-lang:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors spork/path.janet to improve readability by replacing macro-generated path functions with explicit posix/* and win32/* implementations, simplifying PEG usage, and adding docstrings to satisfy documentation checks.
Changes:
- Removed macro-based code generation and replaced it with explicit
posix/*andwin32/*function definitions. - Simplified/standardized PEG patterns (e.g., consistent use of PEG specials like
+and/). - Added docstrings and reworked platform-specialization bindings (
sep,join,normalize, etc.).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f71a9f4 to
e09dbc8
Compare
e09dbc8 to
f5298e1
Compare
|
I've made the following additional changes:
The result has been working here so far. |
|
As a side note, I realized an even more obvious way to appease linting: (comptime (def posix? (not (index-of (os/which) [:windows :mingw]))))It's also is more directly about intention |
|
I tried: (comptime (def- posix? (not (index-of (os/which) [:windows :mingw]))))and replaced instances of [1] Under strict mode. |
|
Right I guess that would make sense. The current version with delay is fine, just a bit ugly imo. There are several ways to do conditional compilation, and it would be nice if the most obvious ways worked with linting. |
This PR is an attempt to address #282.
Apart from the original proposal, additional changes include:
normalizeassert-docs+is used everywhere instead of a mix of+andchoice)