[210_12] feat(srfi-19): 初始化 time 和 date 结构,实现部分函数#396
Merged
jackmath5261-bit merged 15 commits intomainfrom Feb 9, 2026
Merged
[210_12] feat(srfi-19): 初始化 time 和 date 结构,实现部分函数#396jackmath5261-bit merged 15 commits intomainfrom
jackmath5261-bit merged 15 commits intomainfrom
Conversation
d2ba472 to
b0c90a4
Compare
Contributor
There was a problem hiding this comment.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[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 绑定实现。