aboutsummaryrefslogtreecommitdiffstats
path: root/examples/effects-concept.milch
blob: 6091945dcb1137f132990c214c9b3e1fb6bdf1e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; Probably not going to implement this,
; just writing down ideas

; FUNCTIONS

(let prompt-input (\[]
    (let p "> ")
    (do get-user-input "prompted" p)))

; SIGNAL HANDLERS

(on user-input (\[msg s]
    (match msg
        "prompted" (batch [
            (do print-line (fmt "You entered: %%" [s]))
            (prompt-input)])
        (do fatal-error (fmt "error: unknown signal %%" [msg])))))

; ENTRYPOINT

(prompt-input)