Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
dnautics
5y ago
0 comments
Save
Share
Exactly. You can
also
use non-comptime functions in comptime, if it avoids certain types of stateful behaviour.
0 comments
2 comments · 1 top-level
top
newest
oldest
dinglejungle
5y ago
· 1 in thread
An example of this in the Zig math tests, where it tests calling the same function at both comptime and runtime:
https://github.com/ziglang/zig/blob/33c4ad7f3a79aad5d7ea481a...
patrec
5y ago
In common-lisp you could do something equivalent, but you'd have to wrap the definitions you want to be able at both compile and and run time in eval-when.
j
/
k
navigate · click thread line to collapse