nydp 0.1.9 → 0.1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/lisp/tests/builtin-tests.nydp +18 -0
- data/lib/nydp/builtin/plus.rb +2 -2
- data/lib/nydp/date.rb +1 -0
- data/lib/nydp/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46921f478f559c5d78edc626c2620ba05406f071
|
4
|
+
data.tar.gz: 582c35f13517cdb8e897e6696c1873284304ec88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1a7ad0dcfedb16886cdb8c932f44486745cfba9cf80ff93fd3e4e1225c762fcb38902b689fcf3a68bce1c230cb1e47d14d95ff6c7d294879793c36a881e2ef
|
7
|
+
data.tar.gz: 91e528cd2bf04dae0ac591ca6ad93fe29c5c9f71f1751aa5692b6392d38161a19b4c869f49ec37e576db34589ccd3d7b5b582e8c73086a21fabe8eb4c185430d
|
data/README.md
CHANGED
@@ -60,9 +60,9 @@ You can maintain multiple `ns` instances without mutual interference. In other w
|
|
60
60
|
|
61
61
|
#### 1. Macro-expansion runs in lisp
|
62
62
|
|
63
|
-
After parsing its input, `'nydp` passes the result as an argument to the `pre-compile` function. This is where things get a little bit circular: initially, `pre-compile` is a builtin function that just returns its argument. `pre-compile` bootstraps itself into existence in [
|
63
|
+
After parsing its input, `'nydp` passes the result as an argument to the `pre-compile` function. This is where things get a little bit circular: initially, `pre-compile` is a builtin function that just returns its argument. `pre-compile` bootstraps itself into existence in [core-010-precompile.nydp](lib/lisp/core-010-precompile.nydp).
|
64
64
|
|
65
|
-
You can override `pre-compile` to transform the expression in any way you wish. By default, the `
|
65
|
+
You can override `pre-compile` to transform the expression in any way you wish. By default, the `core-010-precompile.nydp` implementation of `pre-compile` performs macro-expansion.
|
66
66
|
|
67
67
|
|
68
68
|
```lisp
|
@@ -40,3 +40,21 @@
|
|
40
40
|
("hash-merge" (inspect hash-merge ) "builtin/hash-merge" )
|
41
41
|
("vm-info" (inspect vm-info ) "builtin/vm-info" )
|
42
42
|
))
|
43
|
+
|
44
|
+
(examples-for +
|
45
|
+
("adds integers"
|
46
|
+
(+ 11 22 33)
|
47
|
+
66)
|
48
|
+
|
49
|
+
("adds floats"
|
50
|
+
(+ 14.80 (* 91.31 1.05))
|
51
|
+
110.6755))
|
52
|
+
|
53
|
+
(examples-for -
|
54
|
+
("subtracts integers"
|
55
|
+
(- 66 25)
|
56
|
+
41)
|
57
|
+
|
58
|
+
("subtracts floats"
|
59
|
+
(- 6.25 4.125)
|
60
|
+
2.125))
|
data/lib/nydp/builtin/plus.rb
CHANGED
@@ -3,12 +3,12 @@ class Nydp::Builtin::Plus
|
|
3
3
|
|
4
4
|
def builtin_invoke vm, args
|
5
5
|
vm.push_arg case args.car
|
6
|
-
when Fixnum, Nydp::Date
|
7
|
-
sum(args.cdr, args.car)
|
8
6
|
when Nydp::Pair
|
9
7
|
sum(args, Nydp.NIL)
|
10
8
|
when String, Nydp::StringAtom
|
11
9
|
sum(args, Nydp::StringAtom.new(""))
|
10
|
+
else
|
11
|
+
sum(args.cdr, args.car)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
data/lib/nydp/date.rb
CHANGED
@@ -29,6 +29,7 @@ module Nydp
|
|
29
29
|
def > other ; ruby_date > other.ruby_date ; end
|
30
30
|
def < other ; ruby_date < other.ruby_date ; end
|
31
31
|
def == other ; ruby_date == other.ruby_date ; end
|
32
|
+
def <=> other ; ruby_date <=> other.ruby_date ; end
|
32
33
|
def eql? d ; self == d ; end
|
33
34
|
def hash ; ruby_date.hash ; end
|
34
35
|
|
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.9
|
4
|
+
version: 0.1.9.1
|
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-01-
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|