|
17 | 17 | "clojure": "(fn [] \"world\")", |
18 | 18 | "lisp": "(lambda () \"world\")", |
19 | 19 | "pwsh": "\"world\"", |
20 | | - "go": "func() string { return \"world\" }" |
| 20 | + "go": "func() string { return \"world\" }", |
| 21 | + "erlang": "fun() -> \"world\" end." |
21 | 22 | } |
22 | 23 | }, |
23 | 24 | "template": "Hello, {{lambda}}!", |
|
39 | 40 | "clojure": "(fn [] \"{{planet}}\")", |
40 | 41 | "lisp": "(lambda () \"{{planet}}\")", |
41 | 42 | "pwsh": "\"{{planet}}\"", |
42 | | - "go": "func() string { return \"{{planet}}\" }" |
| 43 | + "go": "func() string { return \"{{planet}}\" }", |
| 44 | + "erlang": "fun() -> \"{{planet}}\" end." |
43 | 45 | } |
44 | 46 | }, |
45 | 47 | "template": "Hello, {{lambda}}!", |
|
61 | 63 | "clojure": "(fn [] \"|planet| => {{planet}}\")", |
62 | 64 | "lisp": "(lambda () \"|planet| => {{planet}}\")", |
63 | 65 | "pwsh": "\"|planet| => {{planet}}\"", |
64 | | - "go": "func() string { return \"|planet| => {{planet}}\" }" |
| 66 | + "go": "func() string { return \"|planet| => {{planet}}\" }", |
| 67 | + "erlang": "fun() -> \"|planet| => {{planet}}\" end." |
65 | 68 | } |
66 | 69 | }, |
67 | 70 | "template": "{{= | | =}}\nHello, (|&lambda|)!", |
|
82 | 85 | "clojure": "(def g (atom 0)) (fn [] (swap! g inc))", |
83 | 86 | "lisp": "(let ((g 0)) (lambda () (incf g)))", |
84 | 87 | "pwsh": "if (($null -eq $script:calls) -or ($script:calls -ge 3)){$script:calls=0}; ++$script:calls; $script:calls", |
85 | | - "go": "func() func() int { g := 0; return func() int { g++; return g } }()" |
| 88 | + "go": "func() func() int { g := 0; return func() int { g++; return g } }()", |
| 89 | + "erlang": "fun() -> G=case get(g) of undefined -> 1; _G -> _G end, put(g, G+1), G end." |
86 | 90 | } |
87 | 91 | }, |
88 | 92 | "template": "{{lambda}} == {{{lambda}}} == {{lambda}}", |
|
103 | 107 | "clojure": "(fn [] \">\")", |
104 | 108 | "lisp": "(lambda () \">\")", |
105 | 109 | "pwsh": "\">\"", |
106 | | - "go": "func() string { return \">\" }" |
| 110 | + "go": "func() string { return \">\" }", |
| 111 | + "erlang": "fun() -> \">\" end." |
107 | 112 | } |
108 | 113 | }, |
109 | 114 | "template": "<{{lambda}}{{{lambda}}}", |
|
125 | 130 | "clojure": "(fn [text] (if (= text \"{{x}}\") \"yes\" \"no\"))", |
126 | 131 | "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))", |
127 | 132 | "pwsh": "if ($args[0] -eq \"{{x}}\") {\"yes\"} else {\"no\"}", |
128 | | - "go": "func(text string) string { if text == \"{{x}}\" { return \"yes\" } else { return \"no\" } }" |
| 133 | + "go": "func(text string) string { if text == \"{{x}}\" { return \"yes\" } else { return \"no\" } }", |
| 134 | + "erlang": "fun(\"{{x}}\") -> \"yes\"; (_) -> \"no\" end." |
129 | 135 | } |
130 | 136 | }, |
131 | 137 | "template": "<{{#lambda}}{{x}}{{/lambda}}>", |
|
147 | 153 | "clojure": "(fn [text] (str text \"{{planet}}\" text))", |
148 | 154 | "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))", |
149 | 155 | "pwsh": "\"$($args[0]){{planet}}$($args[0])\"", |
150 | | - "go": "func(text string) string { return text + \"{{planet}}\" + text }" |
| 156 | + "go": "func(text string) string { return text + \"{{planet}}\" + text }", |
| 157 | + "erlang": "fun(Text) -> Text ++ \"{{planet}}\" ++ Text end." |
151 | 158 | } |
152 | 159 | }, |
153 | 160 | "template": "<{{#lambda}}-{{/lambda}}>", |
|
169 | 176 | "clojure": "(fn [text] (str text \"{{planet}} => |planet|\" text))", |
170 | 177 | "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))", |
171 | 178 | "pwsh": "\"$($args[0]){{planet}} => |planet|$($args[0])\"", |
172 | | - "go": "func(text string) string { return text + \"{{planet}} => |planet|\" + text }" |
| 179 | + "go": "func(text string) string { return text + \"{{planet}} => |planet|\" + text }", |
| 180 | + "erlang": "fun(Text) -> Text ++ \"{{planet}} => |planet|\" ++ Text end." |
173 | 181 | } |
174 | 182 | }, |
175 | 183 | "template": "{{= | | =}}<|#lambda|-|/lambda|>", |
|
190 | 198 | "clojure": "(fn [text] (str \"__\" text \"__\"))", |
191 | 199 | "lisp": "(lambda (text) (format nil \"__~a__\" text))", |
192 | 200 | "pwsh": "\"__$($args[0])__\"", |
193 | | - "go": "func(text string) string { return \"__\" + text + \"__\" }" |
| 201 | + "go": "func(text string) string { return \"__\" + text + \"__\" }", |
| 202 | + "erlang": "fun(Text) -> \"__\" ++ Text ++ \"__\" end." |
194 | 203 | } |
195 | 204 | }, |
196 | 205 | "template": "{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}", |
|
212 | 221 | "clojure": "(fn [text] false)", |
213 | 222 | "lisp": "(lambda (text) (declare (ignore text)) nil)", |
214 | 223 | "pwsh": "$false", |
215 | | - "go": "func(text string) bool { return false }" |
| 224 | + "go": "func(text string) bool { return false }", |
| 225 | + "erlang": "fun(_) -> false end." |
216 | 226 | } |
217 | 227 | }, |
218 | 228 | "template": "<{{^lambda}}{{static}}{{/lambda}}>", |
|
0 commit comments