summaryrefslogtreecommitdiff
path: root/specs/~lambdas.json
diff options
context:
space:
mode:
Diffstat (limited to 'specs/~lambdas.json')
-rw-r--r--specs/~lambdas.json30
1 files changed, 20 insertions, 10 deletions
diff --git a/specs/~lambdas.json b/specs/~lambdas.json
index 7b6d59c..92c902a 100644
--- a/specs/~lambdas.json
+++ b/specs/~lambdas.json
@@ -15,7 +15,8 @@
"php": "return \"world\";",
"python": "lambda: \"world\"",
"clojure": "(fn [] \"world\")",
- "lisp": "(lambda () \"world\")"
+ "lisp": "(lambda () \"world\")",
+ "pwsh": "\"world\""
}
},
"template": "Hello, {{lambda}}!",
@@ -35,7 +36,8 @@
"php": "return \"{{planet}}\";",
"python": "lambda: \"{{planet}}\"",
"clojure": "(fn [] \"{{planet}}\")",
- "lisp": "(lambda () \"{{planet}}\")"
+ "lisp": "(lambda () \"{{planet}}\")",
+ "pwsh": "\"{{planet}}\""
}
},
"template": "Hello, {{lambda}}!",
@@ -55,7 +57,8 @@
"php": "return \"|planet| => {{planet}}\";",
"python": "lambda: \"|planet| => {{planet}}\"",
"clojure": "(fn [] \"|planet| => {{planet}}\")",
- "lisp": "(lambda () \"|planet| => {{planet}}\")"
+ "lisp": "(lambda () \"|planet| => {{planet}}\")",
+ "pwsh": "\"|planet| => {{planet}}\""
}
},
"template": "{{= | | =}}\nHello, (|&lambda|)!",
@@ -74,7 +77,8 @@
"php": "global $calls; return ++$calls;",
"python": "lambda: globals().update(calls=globals().get(\"calls\",0)+1) or calls",
"clojure": "(def g (atom 0)) (fn [] (swap! g inc))",
- "lisp": "(let ((g 0)) (lambda () (incf g)))"
+ "lisp": "(let ((g 0)) (lambda () (incf g)))",
+ "pwsh": "if (($null -eq $script:calls) -or ($script:calls -ge 3)){$script:calls=0}; ++$script:calls; $script:calls"
}
},
"template": "{{lambda}} == {{{lambda}}} == {{lambda}}",
@@ -93,7 +97,8 @@
"php": "return \">\";",
"python": "lambda: \">\"",
"clojure": "(fn [] \">\")",
- "lisp": "(lambda () \">\")"
+ "lisp": "(lambda () \">\")",
+ "pwsh": "\">\""
}
},
"template": "<{{lambda}}{{{lambda}}}",
@@ -113,7 +118,8 @@
"php": "return ($text == \"{{x}}\") ? \"yes\" : \"no\";",
"python": "lambda text: text == \"{{x}}\" and \"yes\" or \"no\"",
"clojure": "(fn [text] (if (= text \"{{x}}\") \"yes\" \"no\"))",
- "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))"
+ "lisp": "(lambda (text) (if (string= text \"{{x}}\") \"yes\" \"no\"))",
+ "pwsh": "if ($args[0] -eq \"{{x}}\") {\"yes\"} else {\"no\"}"
}
},
"template": "<{{#lambda}}{{x}}{{/lambda}}>",
@@ -133,7 +139,8 @@
"php": "return $text . \"{{planet}}\" . $text;",
"python": "lambda text: \"%s{{planet}}%s\" % (text, text)",
"clojure": "(fn [text] (str text \"{{planet}}\" text))",
- "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))"
+ "lisp": "(lambda (text) (format nil \"~a{{planet}}~a\" text text))",
+ "pwsh": "\"$($args[0]){{planet}}$($args[0])\""
}
},
"template": "<{{#lambda}}-{{/lambda}}>",
@@ -153,7 +160,8 @@
"php": "return $text . \"{{planet}} => |planet|\" . $text;",
"python": "lambda text: \"%s{{planet}} => |planet|%s\" % (text, text)",
"clojure": "(fn [text] (str text \"{{planet}} => |planet|\" text))",
- "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))"
+ "lisp": "(lambda (text) (format nil \"~a{{planet}} => |planet|~a\" text text))",
+ "pwsh": "\"$($args[0]){{planet}} => |planet|$($args[0])\""
}
},
"template": "{{= | | =}}<|#lambda|-|/lambda|>",
@@ -172,7 +180,8 @@
"php": "return \"__\" . $text . \"__\";",
"python": "lambda text: \"__%s__\" % (text)",
"clojure": "(fn [text] (str \"__\" text \"__\"))",
- "lisp": "(lambda (text) (format nil \"__~a__\" text))"
+ "lisp": "(lambda (text) (format nil \"__~a__\" text))",
+ "pwsh": "\"__$($args[0])__\""
}
},
"template": "{{#lambda}}FILE{{/lambda}} != {{#lambda}}LINE{{/lambda}}",
@@ -192,7 +201,8 @@
"php": "return false;",
"python": "lambda text: 0",
"clojure": "(fn [text] false)",
- "lisp": "(lambda (text) (declare (ignore text)) nil)"
+ "lisp": "(lambda (text) (declare (ignore text)) nil)",
+ "pwsh": "$false"
}
},
"template": "<{{^lambda}}{{static}}{{/lambda}}>",