tobogganSe connecter

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.

19 lignes · 402 octetsBrut · Historique
1// Process arguments (std/os, issue #179): argv holds at least the
2// program's name, and it is not empty.
3
4import std/io
5import std/list
6import std/os
7import std/string
8
9pub fn main :: -> () / <io>
10{
11 let argv = os.args ()
12 io.println (show (list.length argv >= 1))
13 match argv
14 { [name, ..] -> io.println (show (string.length name > 0))
15 , [] -> io.println "unreachable"
16 }
17}
18//> True
19//> True