From 7912636be6df26fee771e190c8d0a7d85a19e7bf Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 30 May 2022 17:40:22 -0700 Subject: [PATCH] Read from stdin --- gamarjoba.lean | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gamarjoba.lean b/gamarjoba.lean index 3ff7141..5e97341 100644 --- a/gamarjoba.lean +++ b/gamarjoba.lean @@ -2,5 +2,12 @@ import system.io open io -def main: io unit := - put_str "Gamarjoba, munde!" +def greet (s : string) : io unit := + put_str $ "Hello, " ++ s ++ "!\n" + +def main: io unit := do + put_str "Gamarjoba, munde!\n", + put_str "Onamae wa? ", + name <- get_line, + greet name +