tobogganSe connecter

louise

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

17 lignes · 486 octetsBrut · Historique
1// A program without a .stdin file reads empty input (ADR 0086): every
2// read finds the end at once.
3
4import std/io
5
6pub fn main :: -> () / <io>
7{
8 match io.read_line ()
9 { Ok(None) -> io.println "line: end", _ -> io.println "line: more?" }
10 match io.read_bytes 16
11 { Ok(None) -> io.println "bytes: end", _ -> io.println "bytes: more?" }
12 match io.read_line ()
13 { Ok(None) -> io.println "still the end", _ -> io.println "more?" }
14}
15//> line: end
16//> bytes: end
17//> still the end