(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43679707

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Zig 的新 LinkedList API(是时候学习 fieldParentPtr 了)(openmymind.net) 24 分,来自 todsacerdoti,52 分钟前 | 隐藏 | 过去 | 收藏 | 2 条评论 roetlich 8 分钟前 [–] 这看起来有点可怕。我该如何安全地编写一个以链表作为参数的函数? 回复 the_mitsuhiko 6 分钟前 | 父级 [–] > 我该如何安全地编写一个以链表作为参数的函数?Zig 没有很多泛型代码。你可以直接传递用户数据,然后遍历列表,或者使用编译时计算。真正的答案是“你不会在 Zig 中那样编写代码”。 回复 加入我们,参加 6 月 16-17 日在旧金山举行的 AI 初创公司学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:


原文
Hacker News new | past | comments | ask | show | jobs | submit login
Zig's new LinkedList API (it's time to learn fieldParentPtr) (openmymind.net)
24 points by todsacerdoti 52 minutes ago | hide | past | favorite | 2 comments










This looks somewhat horrifying. How do I safely write a function that takes a linked list as a parameter?


> How do I safely write a function that takes a linked list as a parameter?

Zig does not have a lot of generic code. You would pass the user directly and then walk the list or you use comptime. The real answer is that "you don't write code like that in Zig".







Join us for AI Startup School this June 16-17 in San Francisco!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



Search:
联系我们 contact @ memedata.com