...
1;; multiValueWasmFunctions defines Wasm functions that illustrate multiple
2;; results using the "multiple-results" feature.
3(module $multi-value/imported_host
4 ;; Imports the `get_age` function from `multi-value/host` defined in the host.
5 (func $get_age (import "multi-value/host" "get_age") (result (;age;) i64 (;errno;) i32))
6
7 ;; Now, define a function that returns only the first result.
8 (func (export "call_get_age") (result i64)
9 call $get_age ;; stack = [37, errno] result of get_age
10 drop ;; stack = [37]
11 )
12)
View as plain text