|
15 | 15 | "php": "return \"world\";", |
16 | 16 | "python": "lambda: \"world\"", |
17 | 17 | "clojure": "(fn [] \"world\")", |
18 | | - "lisp": "(lambda () \"world\")" |
| 18 | + "lisp": "(lambda () \"world\")", |
| 19 | + "pwsh": "\"world\"" |
19 | 20 | } |
20 | 21 | }, |
21 | 22 | "template": "Hello, {{lambda}}!", |
|
35 | 36 | "php": "return \"{{planet}}\";", |
36 | 37 | "python": "lambda: \"{{planet}}\"", |
37 | 38 | "clojure": "(fn [] \"{{planet}}\")", |
38 | | - "lisp": "(lambda () \"{{planet}}\")" |
| 39 | + "lisp": "(lambda () \"{{planet}}\")", |
| 40 | + "pwsh": "\"{{planet}}\"" |
39 | 41 | } |
40 | 42 | }, |
41 | 43 | "template": "Hello, {{lambda}}!", |
|
55 | 57 | "php": "return \"|planet| => {{planet}}\";", |
56 | 58 | "python": "lambda: \"|planet| => {{planet}}\"", |
57 | 59 | "clojure": "(fn [] \"|planet| => {{planet}}\")", |
58 | | - "lisp": "(lambda () \"|planet| => {{planet}}\")" |
| 60 | + "lisp": "(lambda () \"|planet| => {{planet}}\")", |
| 61 | + "pwsh": "\"|planet| => {{planet}}\"" |
59 | 62 | } |
60 | 63 | }, |
61 | 64 | "template": "{{= | | =}}\nHello, (|&lambda|)!", |
|
74 | 77 | "php": "global $calls; return ++$calls;", |
75 | 78 | "python": "lambda: globals().update(calls=globals().get(\"calls\",0)+1) or calls", |
76 | 79 | "clojure": "(def g (atom 0)) (fn [] (swap! g inc))", |
77 | | - "lisp": "(let ((g 0)) (lambda () (incf g)))" |
| 80 | + "lisp": "(let ((g 0)) (lambda () (incf g)))", |
| 81 | + "pwsh": "if (($null -eq $script:calls) -or ($script:calls -ge 3)){$script:calls=0}; ++$script:calls; $script:calls" |
78 | 82 | } |
79 | 83 | }, |
80 | 84 | "template": "{{lambda}} == {{{lambda}}} == {{lambda}}", |
|
93 | 97 | "php": "return \">\";", |
94 | 98 | "python": "lambda: \">\"", |
95 | 99 | "clojure": "(fn [] \">\")", |
96 | | - "lisp": "(lambda () \">\")" |
| 100 | + "lisp": "(lambda () \">\")", |
| 101 | + "pwsh": "\">\"" |
97 | 102 | } |
98 | 103 | }, |
99 | 104 | "template": "<{{lambda}}{{{lambda}}}", |
|
113 | 118 | "php": "return ($text == \"{{x}}\") ? \"yes\" : \"no\";", |
114 | 119 | "python": "lambda text: text == \"{{x}}\" and \"yes\" or \"no\"", |
115 | 120 | "clojure": "(fn [text] (if (= text \"{{x}}\") \"yes\" \"no\"))", |
116 | | - "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))" |
| 121 | + "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))", |
| 122 | + "pwsh": "if ($args[0] -eq \"{{x}}\") {\"yes\"} else {\"no\"}" |
117 | 123 | } |
118 | 124 | }, |
119 | 125 | "template": "<{{#lambda}}{{x}}{{/lambda}}>", |
|
133 | 139 | "php": "return $text . \"{{planet}}\" . $text;", |
134 | 140 | "python": "lambda text: \"%s{{planet}}%s\" % (text, text)", |
135 | 141 | "clojure": "(fn [text] (str text \"{{planet}}\" text))", |
136 | | - "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))" |
| 142 | + "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))", |
| 143 | + "pwsh": "\"$($args[0]){{planet}}$($args[0])\"" |
137 | 144 | } |
138 | 145 | }, |
139 | 146 | "template": "<{{#lambda}}-{{/lambda}}>", |
|
153 | 160 | "php": "return $text . \"{{planet}} => |planet|\" . $text;", |
154 | 161 | "python": "lambda text: \"%s{{planet}} => |planet|%s\" % (text, text)", |
155 | 162 | "clojure": "(fn [text] (str text \"{{planet}} => |planet|\" text))", |
156 | | - "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))" |
| 163 | + "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))", |
| 164 | + "pwsh": "\"$($args[0]){{planet}} => |planet|$($args[0])\"" |
157 | 165 | } |
158 | 166 | }, |
159 | 167 | "template": "{{= | | =}}<|#lambda|-|/lambda|>", |
|
172 | 180 | "php": "return \"__\" . $text . \"__\";", |
173 | 181 | "python": "lambda text: \"__%s__\" % (text)", |
174 | 182 | "clojure": "(fn [text] (str \"__\" text \"__\"))", |
175 | | - "lisp": "(lambda (text) (format nil \"__~a__\" text))" |
| 183 | + "lisp": "(lambda (text) (format nil \"__~a__\" text))", |
| 184 | + "pwsh": "\"__$($args[0])__\"" |
176 | 185 | } |
177 | 186 | }, |
178 | 187 | "template": "{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}", |
|
192 | 201 | "php": "return false;", |
193 | 202 | "python": "lambda text: 0", |
194 | 203 | "clojure": "(fn [text] false)", |
195 | | - "lisp": "(lambda (text) (declare (ignore text)) nil)" |
| 204 | + "lisp": "(lambda (text) (declare (ignore text)) nil)", |
| 205 | + "pwsh": "$false" |
196 | 206 | } |
197 | 207 | }, |
198 | 208 | "template": "<{{^lambda}}{{static}}{{/lambda}}>", |
|
0 commit comments