louise
The Louise language: compiler, runtime, std, tooling
Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.
Dernier runRéussi#125 · main · 16 min 13 s
0Étoiles
0Forks
40Issues
| 1 | // `result.expect` on an `Error` panics with the message and the reason. |
| 2 | |
| 3 | import std/io |
| 4 | import std/result |
| 5 | import std/string |
| 6 | |
| 7 | pub fn main :: -> () / <io> |
| 8 | { |
| 9 | io.println (show (result.expect (string.to_int "12") "a literal")) |
| 10 | io.println (show (result.expect (string.to_int "twelve") "a literal")) |
| 11 | } |
| 12 | //> 12 |
| 13 | //! panic: a literal: "not an integer: \"twelve\"" |