nydp 0.1.9 → 0.1.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a04241f46cc86cfb401435e98feac3315b758bb
4
- data.tar.gz: a2885ed15e20a545b3c73ada1cfe815f74fa163e
3
+ metadata.gz: 46921f478f559c5d78edc626c2620ba05406f071
4
+ data.tar.gz: 582c35f13517cdb8e897e6696c1873284304ec88
5
5
  SHA512:
6
- metadata.gz: 0cb48a423ba6e63f894eb6731cde8c1006e142288f0c25b14be25a3b7877d5736fa4d94142d5fd9f53002c2ca76ab4e19a72b89b06b411afd06d565b5315a016
7
- data.tar.gz: 3c0e631c2c920c73f00feaf98237e4548907c441097cabd037db3849cf4570b6d2969c15ead3c5408d3cdd0be6759d8bb4b656319196fa0ac841b1d0636b4e51
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 [boot.nydp](lib/lisp/boot.nydp).
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 `boot.nydp` implementation of `pre-compile` performs macro-expansion.
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))
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Nydp
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.9.1"
3
3
  end
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 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler