comalisp 0.1.0 → 0.1.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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/comalisp.rb +2 -2
  3. data/spec/comalisp_spec.rb +17 -0
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -43,11 +43,11 @@ class ComaLisp
43
43
  end
44
44
 
45
45
  def call(fn,*args)
46
- self.instance_exec(*args,&fn)
46
+ self.apply(fn,args)
47
47
  end
48
48
 
49
49
  def apply(fn,args)
50
- self.instance_exec(*args,&fn)
50
+ self.send(fn,*args)
51
51
  end
52
52
 
53
53
  def let(*vars,&body)
@@ -89,6 +89,23 @@ describe "Comalisp" do
89
89
  end
90
90
  end
91
91
 
92
+ context "function application" do
93
+ it "calls a function with args" do
94
+ (ComaLisp {
95
+ (defun [:foo,:a,:b] {
96
+ (list a, b)})
97
+ (call :foo, 1, 2)}).should == [1,2]
98
+ end
99
+
100
+ it "applies a function with args" do
101
+ (ComaLisp {
102
+ (defun [:foo,:a,:b] {
103
+ (list a, b)})
104
+ (apply :foo, [1,2])}).should == [1,2]
105
+ end
106
+
107
+ end
108
+
92
109
  context "method prefixing:" do
93
110
  it "calls the method on the first argument" do
94
111
  (ComaLisp {
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: comalisp
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Howard Yeh
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- hash: 2928009232713905202
95
+ hash: 3631753440978956596
96
96
  segments:
97
97
  - 0
98
98
  version: "0"