comptime type params
This commit is contained in:
@@ -640,10 +640,17 @@
|
||||
- v1 intentionally supports integer values only; no comptime branch pruning or
|
||||
user-function execution
|
||||
|
||||
27.5 comptime type parameters (deferred)
|
||||
- planned shape: `max func($T type, a, b T) T`
|
||||
27.5 comptime type parameters (implemented; v1)
|
||||
- `$T type` marks an explicit comptime type parameter in a normal `func` signature:
|
||||
`max func($T type, a, b T) T`
|
||||
- callers pass the type explicitly as an ordinary comptime argument (`max(i32, a, b)`);
|
||||
the type argument specializes the function and is omitted from the runtime ABI
|
||||
- inside the specialization, `T` is visible in parameter, result, local, array, pointer,
|
||||
slice, and fallible type syntax
|
||||
- v1 intentionally keeps `type` contextual to comptime parameter declarations; no
|
||||
inferred type parameters, first-class type values, or comptime execution
|
||||
|
||||
27.6 comptime-evaluable constants/functions (deferred)
|
||||
27.6 comptime-evaluable constants/functions
|
||||
- planned shape: `$x :: 32` and `$sum func(a, b int) int { ... }`
|
||||
|
||||
28. brolang build system (requires comptime execution)
|
||||
|
||||
Reference in New Issue
Block a user