根据 Issue #457,完成以下任务:
- 移除 s7.c 中 delete-file 的实现(已经通过 tbox 重新实现了)
- file-exists? 在 s7.c 中的相关函数已经移除,可能需要清理一下 s7.c
- 剩余函数的迁移
- tests/goldfish/scheme/file-test.scm 的测试用例补充和文档补充
- src/s7.c
- src/s7_scheme_file.c (新建)
- src/s7_scheme_file.h (新建)
- xmake.lua
- goldfish/scheme/file.scm
- tests/goldfish/scheme/file-test.scm
- devel/200_26.md
xmake b goldfish
bin/goldfish -m r7rs tests/goldfish/scheme/file-test.scm
- 创建分支: gatsby/200_26/migrate_scheme_file
- 分析 s7.c 中的 file 相关代码
- 发现 delete-file 实现在 s7.c 第 35373 行
- file-exists? 的实现可能已被移除,但 file_probe 函数仍存在
- 创建
src/s7_scheme_file.h- 导出 g_delete_file, g_access, g_file_mtime, g_unlink - 创建
src/s7_scheme_file.c- 实现上述函数(使用 s7 公共 API) - 修改
src/s7.c:- 添加
#include "s7_scheme_file.h" - 移除
file_probe函数(未使用) - 移除
g_delete_file函数 - 移除
g_file_mtime函数 - 移除
g_unlink函数 - 移除
g_access函数
- 添加
- 修改
xmake.lua- 添加src/s7_scheme_file.c编译
- ✅ 编译成功:
xmake b goldfish - ✅ 测试通过:
bin/goldfish -m r7rs tests/goldfish/scheme/file-test.scm(28 correct, 0 failed)
- 补充 file-test.scm 的测试用例和文档
- Git 提交并推送到 GitHub