-
Notifications
You must be signed in to change notification settings - Fork 28
[210_12] feat(srfi-19): 初始化 time 和 date 结构,实现部分函数 #396
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
Conversation
d2ba472 to
b0c90a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements SRFI-19 time and date support for Goldfish Scheme by adding C++17 chrono-based glue functions and comprehensive Scheme implementations of time and date structures with formatting capabilities.
Changes:
- Added C++ glue functions for time operations using std::chrono (get-time-of-day, monotonic-nanosecond, clock resolutions)
- Implemented SRFI-19 time and date record types with accessors and basic operations
- Implemented date-to-string formatting with extensive format specifier support
- Added comprehensive test suite covering time/date creation, accessors, and formatting
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/goldfish.hpp | Adds C++ glue functions using std::chrono for time operations and clock resolution queries |
| goldfish/scheme/time.scm | Refactors current-second and current-jiffy to use new glue functions, exports clock resolution constants |
| goldfish/srfi/srfi-19.scm | Implements SRFI-19 time/date types, current-time, time-resolution, date->string with format specifiers, and leap second handling |
| tests/goldfish/liii/time-test.scm | Comprehensive test suite for time/date constants, constructors, accessors, formatting, and error conditions |
| devel/210_12.md | Development documentation describing the implementation approach and testing instructions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
[210_12]
(srfi srfi-19)任务相关的代码文件
src/goldfish.hpptests/goldfish/liii/time-test.scmgoldfish/scheme/time.scmgoldfish/srfi/srfi-19.scm如何测试
2026/1/30 初始化 time 和 date 结构
What
g_gettimeofday,g_monotonic-nanosecond,g_steady-clock-resolution,g_system-clock-resolutioncurrent-time,date->string等Why
扩充时间与日期的支持。
How
通过 C++17 的 chrono 绑定实现。