slovo/examples/projects/std-import-random/src/main.slo
2026-05-22 08:38:43 +02:00

23 lines
486 B
Plaintext

(module main)
(import std.random (random_i32 random_i32_non_negative))
(fn imported_random_i32_non_negative () -> bool
(>= (random_i32) 0))
(fn imported_random_facade_ok () -> bool
(if (imported_random_i32_non_negative)
(random_i32_non_negative)
false))
(fn main () -> i32
(if (imported_random_facade_ok)
42
1))
(test "explicit std random i32 non-negative facade"
(imported_random_i32_non_negative))
(test "explicit std random facade all"
(= (main) 42))