We support type puns...
|
pun "MetersU32" { |
|
lang "rust" { |
|
@repr "transparent" |
|
struct "MetersU32" { |
|
_ "u32" |
|
} |
|
} |
|
|
|
lang "c" "cpp" { |
|
alias "MetersU32" "u32" |
|
} |
|
} |
Why not function puns?
fun "sick_call" {
lang "rust" {
fn "sick_call" {
inputs { _ "[u64; 2]"; }
}
}
lang "c" "cpp" {
fn "sick_call" {
inputs { _ "u64"; _ "u64"; }
}
}
}
I'm not sure exactly when we'd want this, but I wanted to write it down.
As with puns, there needs to be restrictions that allow us to keep the ValueTree in sync across puns. In the case of ValueTree we require there to be an equal number of Values (primitives + enum tags) produced (so [u32; 2] can pun (u32, u32), but u64 can't). So the above example might be an invalid fun.
A more realistic fun might be "varargs vs not".
We support type puns...
abi-cafe/include/tests/procgen/pun/MetersU32.procgen.kdl
Lines 4 to 15 in 6a7db03
Why not function puns?
I'm not sure exactly when we'd want this, but I wanted to write it down.
As with puns, there needs to be restrictions that allow us to keep the ValueTree in sync across puns. In the case of ValueTree we require there to be an equal number of Values (primitives + enum tags) produced (so
[u32; 2]can pun(u32, u32), butu64can't). So the above example might be an invalidfun.A more realistic
funmight be "varargs vs not".