aboutsummaryrefslogtreecommitdiff
path: root/examples/generated.csx
blob: f6eac729b2542abe8346b3d02868113ab758c0af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[set no [fn [x] [same x []]]]
[set outint [fn [n] [if [< n 0]
  [do [out 45] [outint [neg n]]]
  [if [< n 10]
    [out [+ 48 n]]
    [do
      [outint [div n 10]]
      [out [+ 48 [mod n 10]]]
    ]
  ]
]]]
[set map [fn [f l] [if l [pair [f [head l]] [map f [tail l]]]]]]
[set id [fn args args]]
[set outstr [fn [str] [if str [do [out [head str]] [outstr [tail str]]]]]]
[set newline [fn [] [out 10]]]
[set instr [fn []
  [set c [in]]
  [if [no [same c 10]] [pair c [instr]]]
]]

[outstr "-= loaded =-"]
[newline]
[outstr "Hello, I am Casey Shawn Exton.  What is your name?"]
[newline]
[outstr "> "]
[set name [instr]]
[outstr "Nice to meet you, "]
[outstr name]
[outstr "."]
[newline]
[outstr "I have to go.  Goodbye!"]
[newline]