-
Notifications
You must be signed in to change notification settings - Fork 23
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
[RFC] Split the times module into submodules #55
Comments
Thats a good idea, but i would prefer a split along the lines:
parsing/formatting has to be specific to the submodules so it should be part of the respective submodule. |
@skilchen What would
I disagree. Since all the types should use the same minilanguage it should be in it's own submodule. |
|
Can't we have: import times # imports everything
import times/datetime # only datetime
import times/calendar # only calendar |
@mratsim If that's possible then would prefer it to, although I think Araq wants new modules to go into the std namespace. What would the folder structure look like? I tried the following but it doesn't work:
Trying to import |
I think this should work... |
I don't mind the std namespace it's just the underscore that are bugging me. This is a perfect case to show the endorsed way of using submodules so let's use them. |
I would like to be able to use Date separately from Time. std / date - date only |
Just FYI I don't have any opinion (yet?). Will probably complain if the split results in more implementation complexity though. |
Any update on this? |
@konsumlamm I'm afraid no. But feel free to experiment. |
I'm against this change. Python has a similar architecture (with |
FYI, |
And what is this price? Unused code gets optimized away and scope pollutions can be dealt with via |
The times module has grown a lot, and it's reaching a point where it would benefit from being split into submodules. Submodules have several advantages:
I propose the following submodules:
std / times_core
- core types (Time
&Duration
mostly) and related procsstd / times_calender
- the calendar types (DateTime
&TimeInterval
mostly) and related procsstd / times_format
- the procs for formatting and parsingDateTime
std / times_monotonic
- monotonic time (liketimers.nim
in the compiler, not implemented yet).It might be easier to merge
times_core
andtimes_calender
into one, but I think it would be nice to keep them separated if possible. Feel free to bikeshed what submodules should exists and what they should be called.Of course, the
times
module would still exists, but it would only import and export all the submodules (like theasync
module).The text was updated successfully, but these errors were encountered: