aboutsummaryrefslogtreecommitdiff
path: root/examples/generated.csx
blob: 4c405c4bdab1ec53cc68efbf8d2280344a4e75e2 (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
33
34
35
36
37
38
39
40
[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 [no 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 [same c 10]
    []
    [pair c [instr]]
  ]
]]

[outstr "-= loaded =-"]
[newline]
[outstr "Hello, I am Conrad S. Xylander.  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]