lunarmodules / Penlight

A set of pure Lua libraries focusing on input data handling (such as reading configuration files), functional programming (such as map, reduce, placeholder expressions,etc), and OS path management. Much of the functionality is inspired by the Python standard libraries.
https://lunarmodules.github.io/Penlight/
MIT License
1.93k stars 242 forks source link

split path in unix and windows #332

Open Tieske opened 4 years ago

Tieske commented 4 years ago

as suggested by @tst2005 here: https://github.com/Tieske/Penlight/pull/331#issuecomment-667939801

instead of the path functions operating on the current system (either Windows or Unix), create 2 namespaces; path.unix and path.windows that implement their respective versions, and set the system one as the default.

Questions;

alerque commented 4 years ago

As long as the original function name was linked to the platform specific function and Penlight was doing the platform detection I don't see why this would be breaking or require any understanding on the part of the application. The primary place it would make a difference is ease of testing Penlight itself, and that seems like a win.

tst2005 commented 4 years ago

@Tieske if you like one of my idea ... maybe you will be interested by the others ... 2 years ago, I made some experimentation on a forked Penlight humoristically named litepain. I was pretty sure my approach will only usefull for me, but maybe I'm wrong.

My experimentation was :

It will be easier for me if the Penlight's code will be more "pickable". I know it is maybe a hard work... and most of the Penlight users will don't see the différence.

I just spoke about the concept.

Conclusion of my linepain experimentation :

I'm still open for discuss.

Enjoy!

Tieske commented 1 year ago

This issue is relevant I think: https://github.com/lunarmodules/LDoc/issues/387

normalization depends on the use case;