all repos — min @ 78d6ffaa26265213e741248c28216d1559e2d676

A small but practical concatenative programming language.

Implemented quoted-symbol?
h3rald h3rald@h3rald.com
Sat, 01 Jan 2022 14:35:30 +0100
commit

78d6ffaa26265213e741248c28216d1559e2d676

parent

a2a80dd3d4875310deac41051ee6680765ce575c

M min.ymlmin.yml

@@ -2,4 +2,4 @@ author: Fabio Cevasco

description: A small but practical concatenative programming language and shell. id: 56055122 name: min -version: 0.36.0+version: 0.37.0
M minpkg/lib/min_logic.nimminpkg/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.mdnext-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.mdsite/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.jsonsite/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.mintests/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