all repos — min @ 709d64c116fe69c0d219fa969d73c75b63fc42ee

A small but practical concatenative programming language.

Fixing tests; updated docs.
h3rald h3rald@h3rald.com
Sun, 09 Jul 2017 12:27:48 +0200
commit

709d64c116fe69c0d219fa969d73c75b63fc42ee

parent

cc91707eaf09e9fad949c8be8224e1fbb99ab46c

M .travis.yml.travis.yml

@@ -1,9 +1,9 @@

# Copied from https://github.com/nim-lang/Nim/wiki/TravisCI language: c env: - # Build and test against the master and devel branches of Nim + # Build and test against the master branch of Nim - BRANCH=master - - BRANCH=devel + #- BRANCH=devel compiler: #- gcc - clang
M min.nimblemin.nimble

@@ -1,6 +1,6 @@

[Package] name = "min" -version = "0.8.0" +version = "0.8.1" author = "Fabio Cevasco" description = "A tiny concatenative programming language and shell." license = "MIT"
M site/contents/_includes/_reference-lang.mdsite/contents/_includes/_reference-lang.md

@@ -81,14 +81,17 @@

{#op||define||{{any}} {{sl}}||{{null}}|| Defines a new symbol {{sl}}, containing the specified value (auto-quoted if not already a quotation).#} +{#op||defined?||{{sl}}||{{b}}|| +Returns {{t}} if {{sl}} is defined, {{f}} otherwise.#} + {#op||delete||{{sl}}||{{null}}|| Deletes the specified symbol {{sl}}.#} {#op||eval||{{s}}||{{a0p}}|| Parses and interprets {{s}}. #} -{#op||exit||{{null}}||{{null}}|| -Exits the program or shell. #} +{#op||exit||{{i}}||{{null}}|| +Exits the program or shell with {{i}} as return code. #} {#op||expect||{{q1}}||{{q2}}|| > Validates the first _n_ elements of the stack against the type descriptions specified in {{q1}} (_n_ is {{q1}}'s length) and if all the elements are valid returns them wrapped in {{q2}}.
M site/contents/_includes/_reference-num.mdsite/contents/_includes/_reference-num.md

@@ -14,7 +14,7 @@ {#op||/||{{n1}} {{n2}}||{{n3}}||

Divides {{n1}} by {{n2}}. #} {#op||even?||{{i}}||{{b}}|| -Returns **true** if {{i}} is even, **false** otherwise. #} +Returns {{t}} if {{i}} is even, {{f}} otherwise. #} {#op||div||{{i1}} {{i2}}||{{i3}}|| Divides {{i1}} by {{i2}} (integer division). #}

@@ -23,7 +23,7 @@ {#op||mod||{{i1}} {{i2}}||{{i3}}||

Returns the integer module of {{i1}} divided by {{i2}}. #} {#op||odd?||{{i}}||{{b}}|| -Returns **true** if {{i}} is odd, **false** otherwise. #} +Returns {{t}} if {{i}} is odd, {{f}} otherwise. #} {#op||pred||{{i1}}||{{i2}}|| Returns the predecessor of {{i1}}.#}
M site/contents/_includes/_reference-sys.mdsite/contents/_includes/_reference-sys.md

@@ -38,19 +38,19 @@ {#op||cpu||{{null}}||{{s}}||

Returns the host CPU. It can be one of the following strings i386, alpha, powerpc, powerpc64, powerpc64el, sparc, amd64, mips, mipsel, arm, arm64. #} {#op||env?||{{sl}}||{{b}}|| -Returns **true** if environment variable {{sl}} exists, **false** otherwise. #} +Returns {{t}} if environment variable {{sl}} exists, {{f}} otherwise. #} {#op||dir?||{{sl}}||{{b}}|| -Returns **true** if the specified path {{sl}} exists and is a directory. #} +Returns {{t}} if the specified path {{sl}} exists and is a directory. #} {#op||dirname||{{sl}}||{{s}}|| Returns the path of the directory containing path {{sl}}.#} {#op||exists?||{{sl}}||{{b}}|| -Returns **true** if the specified file or directory {{sl}} exists. #} +Returns {{t}} if the specified file or directory {{sl}} exists. #} {#op||file?||{{sl}}||{{b}}|| -Returns **true** if the specified path {{sl}} exists and is a file. #} +Returns {{t}} if the specified path {{sl}} exists and is a file. #} {#op||filename||{{sl}}||{{s}}|| Returns the file name of path {{sl}}.#}

@@ -95,7 +95,7 @@ {#op||symlink||{{sl1}} {{sl2}}||{{null}}||

Creates symlink {{sl2}} for file or directory {{sl1}}. #} {#op||symlink?||{{sl}}||{{b}}|| -Returns **true** if the specified path {{sl}} exists and is a symbolic link. #} +Returns {{t}} if the specified path {{sl}} exists and is a symbolic link. #} {#op||system||{{sl}}||{{null}}|| Executes the external command {{sl}} in the current directory. #}
M site/settings.jsonsite/settings.json

@@ -5,6 +5,6 @@ "templates": "templates",

"temp": "temp", "output": "output", "title": "min language", - "version": "0.8.0", + "version": "0.8.1", "rules": "rules.min" }
M tests/all.mintests/all.min

@@ -1,5 +1,11 @@

; Load test files 0 :failures +symbols size :total-symbols +sigils size :total-sigils +"=" 70 repeat puts! +"Total Symbols: $1" (total-symbols) => % puts! +"Total Sigils: $1" (total-sigils) => % puts! +"=" 70 repeat puts! 'lang load 'stack load 'seq load

@@ -11,4 +17,6 @@ 'sys load

'time load 'fs load 'crypto load +"=" 70 repeat puts! +"Total Failures: $1" (failures) => % puts! failures exit
M tests/lang.mintests/lang.min

@@ -1,13 +1,6 @@

'test load 'test import -newline -symbols size :total-symbols -sigils size :total-sigils -"Total Symbols: $1" (total-symbols) => % puts! -"Total Sigils: $1" (total-sigils) => % puts! -newline - "lang" describe (2 'a define

@@ -145,7 +138,7 @@ ((3 >) (true))

) case ) assert - (time module-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp") ==) assert + (time module-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) assert (sys module-sigils ("!" "$" "&") ==) assert
M tests/time.mintests/time.min

@@ -11,11 +11,11 @@ (1464951736 datetime "2016-06-03T11:02:16Z" ==) assert

(1464951736 "yy-MM-dd" tformat "16-06-03" ==) assert - (1464951736 timeinfo to-timestamp puts 1464951736 ==) assert + (1464951736 timeinfo to-timestamp 1464951736 ==) assert (1464951736 timeinfo 'second dget 16 ==) assert - (1464951736 timeinfo 'timezone dget -3600 ==) assert + (1464951736 timeinfo 'timezone dget integer?) assert report clear-stack