Type check and coerce arguments to user functions and return values from std Rust functions (#6958)
* Shuffle around function call code Signed-off-by: Nick Cameron <nrc@ncameron.org> * Refactor function calls to share more code Signed-off-by: Nick Cameron <nrc@ncameron.org> * Hack to leave the result of revolve as a singleton rather than array Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -133,7 +133,7 @@ export fn reduce(
|
||||
initial: any,
|
||||
/// Run once per item in the input `array`. This function takes an item from the array, and the previous output from `f` (or `initial` on the very first run). The final time `f` is run, its output is returned as the final output from `reduce`.
|
||||
f: fn(any, accum: any): any,
|
||||
): [any] {}
|
||||
): any {}
|
||||
|
||||
/// Append an element to the end of an array.
|
||||
///
|
||||
|
||||
@ -448,7 +448,7 @@ export fn legLen(
|
||||
hypotenuse: number(Length),
|
||||
/// The length of one of the triangle's legs (i.e. non-hypotenuse side).
|
||||
leg: number(Length),
|
||||
): number(deg) {}
|
||||
): number(Length) {}
|
||||
|
||||
/// Compute the angle of the given leg for x.
|
||||
///
|
||||
|
||||
@ -277,4 +277,4 @@ export fn revolve(
|
||||
tagStart?: tag,
|
||||
/// A named tag for the face at the end of the revolve.
|
||||
tagEnd?: tag,
|
||||
): Solid {}
|
||||
): [Solid; 1+] {}
|
||||
|
||||
Reference in New Issue
Block a user