nydp 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lisp/core-100-utils.nydp +13 -0
- data/lib/lisp/tests/accum-examples.nydp +7 -0
- data/lib/lisp/tests/plus-plus-examples.nydp +15 -0
- data/lib/lisp/tests/seqf-examples.nydp +5 -0
- data/lib/nydp.rb +4 -3
- data/lib/nydp/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b34a690426dc8586b784561503f93638b4ca32bb
|
4
|
+
data.tar.gz: 4b994623f4c7d685119046f025c1a17adccc7a13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c32cbeb7b3013042d8712958e3cafe4062f7b75850e20c9162e273bdea45d1b38e9dc61fbcabb597dacdf512b535db8e227c323c8c23726677c56d58e4d626e0
|
7
|
+
data.tar.gz: d687ddbe01b2e0aaddeecbe7849a5d4aeb6cc3c7c253d11f57555e2386670ed8252ec5338b34ee0ab8e5b59932ec9c9c424283b4985614bf79f3485a726d9ba2
|
@@ -57,3 +57,16 @@
|
|
57
57
|
(mac auto-hash names
|
58
58
|
; (auto-hash a b c) same as { a a b b c c }
|
59
59
|
`(brace-list ,@(flatten:map λn(list n n) names)))
|
60
|
+
|
61
|
+
(mac accum (accfn-name . body)
|
62
|
+
(w/uniq acc
|
63
|
+
`(let ,acc nil
|
64
|
+
(let ,accfn-name λa(push a ,acc)
|
65
|
+
,@body
|
66
|
+
(rev ,acc)))))
|
67
|
+
|
68
|
+
(mac ++ (place inc)
|
69
|
+
`(= ,place (+ ,place ,(or inc 1))))
|
70
|
+
|
71
|
+
(def seqf (start incr)
|
72
|
+
(fn () (returning start (++ start incr))))
|
data/lib/nydp.rb
CHANGED
@@ -33,9 +33,10 @@ module Nydp
|
|
33
33
|
vm.thread
|
34
34
|
end
|
35
35
|
|
36
|
-
def self.
|
37
|
-
|
38
|
-
end
|
36
|
+
def self.reader txt ; Nydp::StringReader.new txt ; end
|
37
|
+
def self.eval_src ns, src_txt ; eval_with Nydp::Runner, ns, src_txt ; end
|
38
|
+
def self.eval_src! ns, src_txt ; eval_with Nydp::ExplodeRunner, ns, src_txt ; end
|
39
|
+
def self.eval_with runner, ns, src_txt ; runner.new(VM.new, ns, reader(src_txt)).run ; end
|
39
40
|
|
40
41
|
def self.repl
|
41
42
|
puts "welcome to nydp"
|
data/lib/nydp/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nydp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Conan Dalton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/lisp/core-080-pretty-print.nydp
|
99
99
|
- lib/lisp/core-090-hook.nydp
|
100
100
|
- lib/lisp/core-100-utils.nydp
|
101
|
+
- lib/lisp/tests/accum-examples.nydp
|
101
102
|
- lib/lisp/tests/add-hook-examples.nydp
|
102
103
|
- lib/lisp/tests/auto-hash-examples.nydp
|
103
104
|
- lib/lisp/tests/best-examples.nydp
|
@@ -127,6 +128,7 @@ files:
|
|
127
128
|
- lib/lisp/tests/list-tests.nydp
|
128
129
|
- lib/lisp/tests/mapsum-examples.nydp
|
129
130
|
- lib/lisp/tests/parser-tests.nydp
|
131
|
+
- lib/lisp/tests/plus-plus-examples.nydp
|
130
132
|
- lib/lisp/tests/pre-compile-examples.nydp
|
131
133
|
- lib/lisp/tests/pretty-print-tests.nydp
|
132
134
|
- lib/lisp/tests/quasiquote-examples.nydp
|
@@ -134,6 +136,7 @@ files:
|
|
134
136
|
- lib/lisp/tests/relative-months-examples.nydp
|
135
137
|
- lib/lisp/tests/returning-examples.nydp
|
136
138
|
- lib/lisp/tests/rfnwith-tests.nydp
|
139
|
+
- lib/lisp/tests/seqf-examples.nydp
|
137
140
|
- lib/lisp/tests/sort-examples.nydp
|
138
141
|
- lib/lisp/tests/string-tests.nydp
|
139
142
|
- lib/lisp/tests/syntax-tests.nydp
|