← All docs
getdate() — internals
Compiler internals for getdate(): lowering path, type checks, and runtime helpers.
getdate() — internals
Where it lives
- Signature:
src/builtins/system/getdate.rs - Lowering:
src/codegen/lower_inst/builtins/system.rs:183 (lower_getdate) - Function symbol:
lower_getdate()
Lowering notes
- Lowers
getdate([$timestamp])through the shared decomposition runtime helper. - Marshals the optional timestamp (the
-1current-time sentinel when omitted; a boxed Mixed/Unionargument is unboxed) into the integer result register where__rt_getdate- reads it, then boxes the returned associative-array hash pointer into a
Mixedcell — the same - representation
stat/getdateuse, so the checker types the resultMixed.
Runtime helpers
The following runtime helpers are referenced:
__rt_getdate__rt_mixed_from_value
Signature summary
function getdate(int $timestamp = null): array
What the type checker enforces
- Arity: takes 0–1 arguments (1 optional).
Eval interpreter (magician)
- Declaration:
crates/elephc-magician/src/interpreter/builtins/time/getdate.rs(eval_builtin!) - Dispatch hooks:
direct,values