Implemented quoted-symbol?
h3rald h3rald@h3rald.com
Sat, 01 Jan 2022 14:35:30 +0100
6 files changed,
18 insertions(+),
3 deletions(-)
M
minpkg/lib/min_logic.nim
→
minpkg/lib/min_logic.nim
@@ -212,6 +212,13 @@ if i.pop.kind == minQuotation:
i.push true.newVal else: i.push false.newVal + + def.symbol("quoted-symbol?") do (i: In): + let item = i.pop + if item.kind == minQuotation and item.qVal.len == 1 and item.qVal[0].kind == minSymbol: + i.push true.newVal + else: + i.push false.newVal def.symbol("stringlike?") do (i: In): if i.pop.isStringLike:
M
next-release.md
→
next-release.md
@@ -1,6 +1,7 @@
### Fixes and Improvements * Miscellaneous documentation fixes. -* Now clearing the stack after every HTTP request received by `http-server`. +* Now clearing the stack after every HTTP request received by **http-server**. * Fixed #174 (cons operator was not creating a new quotation). * Fixed #176 (times can now execute a quotation 0 times). +* Added **quoted-symbol?** predicate.
M
site/contents/reference-logic.md
→
site/contents/reference-logic.md
@@ -80,6 +80,9 @@
{#op||quotation?||{{any}}||{{b}}|| Returns {{t}} if {{any}} is a quotation, {{f}} otherwise. #} +{#op||quoted-symbol?||{{any}}||{{b}}|| +Returns {{t}} if {{any}} is a quoted symbol, {{f}} otherwise. #} + {#op||string?||{{any}}||{{b}}|| Returns {{t}} if {{any}} is a string, {{f}} otherwise. #}
M
site/settings.json
→
site/settings.json
@@ -6,5 +6,5 @@ "rules": "rules.min",
"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.36.0" + "version": "0.37.0" }
M
tests/logic.min
→
tests/logic.min
@@ -136,6 +136,10 @@ ("a" stringlike?) *test/assert
(1 stringlike? false ==) *test/assert ('test stringlike?) *test/assert + (("a") quoted-symbol? not) *test/assert + ('test quoted-symbol?) *test/assert + ((aaa bbb) quoted-symbol? not) *test/assert + ({} 'dict:module type? false ==) *test/assert ((1 2 3) 'dict:module type? false ==) *test/assert (4 'dict:module type? false ==) *test/assert