all repos — min @ 3645ee8ed17ed7089cd2aa4721e5aaf467ceee1f

A small but practical concatenative programming language.

Fixed tests; Added aliases for interpolate and call.
h3rald h3rald@h3rald.com
Fri, 07 Oct 2016 13:56:04 +0200
commit

3645ee8ed17ed7089cd2aa4721e5aaf467ceee1f

parent

e90b5bc1c027e761559426581710f5a96e8d1fcd

7 files changed, 16 insertions(+), 14 deletions(-)

jump to
M lib/min_lang.nimlib/min_lang.nim

@@ -710,7 +710,7 @@

.sigil("=") do (i: In): i.push("module".newSym) - .sigil("%") do (i: In): + .sigil("^") do (i: In): i.push("call".newSym) .sigil("/") do (i: In):
M minim.vimminim.vim

@@ -8,12 +8,12 @@ if exists("b:current_syntax")

finish endif -setl iskeyword+=?,$,+,*,/,%,=,>,<,&,-,',.,:,@,~,! +setl iskeyword+=?,$,+,*,/,%,=,>,<,&,-,',.,:,@,~,^,! -syntax keyword minimDefaultSymbol ! != $ & ' * + - -> . .. / : < <= == => =~ > >= @ ROOT aes and append apply at atime b bind bool bool? bury1 bury2 bury3 c call call! capitalize case cd chmod choose clear-stack column-print concat confirm cons cp cpu crypto ctime datetime ddel debug debug? decode decrypt define delete dget dictionary? dig1 dig2 dig3 dip dir? dirname div dprint dprint! dset dump-stack dup dupd echo encode encrypt env? eq eval even? exit fappend file? filename filter first float float? foreach fperms fread from-json fs fsize fstats ftype fwrite gets get-stack getenv gt gte hardlink hidden? i id ifte import indent inspect int int? interpolate interval io join k keys length linrec load load-symbol logic lowercase ls ls-r lt lte map match md5 mkdir mod module mtime mv newline not noteq now num number? odd? or os password pop popd pred prepend print print! prompt puts puts! putenv q quit quotation? quote raise regex remove-symbol repeat replace rest rm rmdir run save-symbol scope scope? seal search select set-stack sha1 sha224 sha256 sha384 sha512 sigil sigils sip size sleep source split stored-symbols str string string? strip succ swap swapd swons symbols symlink symlink? sys system take tformat time timeinfo times timestamp titleize to-json try unit unquote uppercase values version which while with xor zap contains +syntax keyword minimDefaultSymbol ! != $ & ' * + - % ^ -> . .. / : < <= == => =~ > >= @ ROOT aes and append apply at atime b bind bool bool? bury1 bury2 bury3 c call call! capitalize case cd chmod choose clear-stack column-print concat confirm cons cp cpu crypto ctime datetime ddel debug debug? decode decrypt define delete dget dictionary? dig1 dig2 dig3 dip dir? dirname div dprint dprint! dset dump-stack dup dupd echo encode encrypt env? eq eval even? exit fappend file? filename filter first float float? foreach fperms fread from-json fs fsize fstats ftype fwrite gets get-stack getenv gt gte hardlink hidden? i id ifte import indent inspect int int? interpolate interval io join k keys length linrec load load-symbol logic lowercase ls ls-r lt lte map match md5 mkdir mod module mtime mv newline not noteq now num number? odd? or os password pop popd pred prepend print print! prompt puts puts! putenv q quit quotation? quote raise regex remove-symbol repeat replace rest rm rmdir run save-symbol scope scope? seal search select set-stack sha1 sha224 sha256 sha384 sha512 sigil sigils sip size sleep source split stored-symbols str string string? strip succ swap swapd swons symbols symlink symlink? sys system take tformat time timeinfo times timestamp titleize to-json try unit unquote uppercase values version which while with xor zap contains -syntax match minimDefaultSigil ;\<[:@'~!$%&$=<>*]; contained +syntax match minimDefaultSigil ;\<[:@'~!$%&$=<>^*]; contained syntax match minimQuote ;\<[']; syntax match minimBinding ;@;

@@ -24,7 +24,7 @@ syntax match minimNumber ;[-+]\=\d\+\(\.\d*\)\=;

syntax keyword minimBoolean true false syntax region minimString start=+"+ skip=+\\\\\|\\$"+ end=+"+ -syntax region minimSigilSymbol start=;\<[:@'~!$%&$=<>*]; end=;\>; contains=minimDefaultSigil +syntax region minimSigilSymbol start=;\<[:@'~!$%&$=<>^*]; end=;\>; contains=minimDefaultSigil syntax region minimQuotedSymbol start=;\<[']; end=;\>; contains=minimQuote syntax region minimBoundSymbol start=;@; end=;\>; contains=minimBinding syntax match minimSymbol ;[a-zA-Z_][a-zA-Z0-9/!?_-]*;
M prelude.minprelude.min

@@ -22,6 +22,8 @@ 'puts :echo

'system :! 'run :& 'getenv :$ +'call :^ +'interpolate :% 'pop :zap 'quote :unit 'quote :'
M tests/all.mintests/all.min

@@ -6,4 +6,4 @@ 'str load

'sys load 'time load 'fs load -'crypto load +'crypto load
M tests/lang.mintests/lang.min

@@ -3,8 +3,8 @@ 'test import

"lang" describe - "Total Symbols: " print! symbols size put! - " Total Sigils: " print! sigils size put! + "Total Symbols: " print! symbols size puts! + " Total Sigils: " print! sigils size puts! (debug? false ==) assert

@@ -51,7 +51,7 @@ ; Extend an existing scope

(defmod ('mymath import (-) :myminus) => @mymath - 5 2 mymath %myminus 3 ==) assert + 5 2 mymath ^myminus 3 ==) assert (defmod mymath inspect ("myplus") ==) assert

@@ -62,7 +62,7 @@

("2 2 +" "tests/testload.min" fwrite 'testload load 4 ==) assert "tests/testload.min" rm - (defmod 2 2 mymath %myplus 4 ==) assert + (defmod 2 2 mymath ^myplus 4 ==) assert (1 2 3 4 get-stack (1 2 3 4) ==) assert
M tests/test.mintests/test.min

@@ -6,7 +6,7 @@

;; describe ( :name - "Testing: [" print! name print! "]" put! + "Testing: [" print! name print! "]" puts! padding () ) :describe

@@ -38,12 +38,12 @@ results (

total succ @total (ok !=) (failed succ @failed) () ifte ) map - padding total print! " tests executed - " print! failed print! " failed." put! + padding total print! " tests executed - " print! failed print! " failed." puts! ( ' :result result (ok !=) - (padding "FAILED: " print! result put!) + (padding "FAILED: " print! result puts!) () ifte )
M tests/time.mintests/time.min

@@ -7,7 +7,7 @@ (timestamp 1464951736 >) assert

(now 1464951736 >) assert - (1464951736 datetime "2016-06-03T11:02:16Z" ==) assert + (1464951736 datetime "2016-06-03T13:02:16Z" ==) assert (1464951736 "yy-MM-dd" tformat "16-06-03" ==) assert