rubymotionlisp 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubylisp/function.rb +5 -5
- 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: 490db605233e6a3d1bae6cf46d8e1409b40a574f
|
4
|
+
data.tar.gz: e824c1b27bc82ef51da8e3eeb5361afba60b22e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb3ccd4f6c3303ced67a6b5d952560019938644e0234db70ccfaf5d959f4ba2a4e75eb6608a1e8b2e647d5c34968232b69fff7c1f50b8159b75b2611b3d65ee7
|
7
|
+
data.tar.gz: cb6574334fac4294650d0d9ceaed4e878e7e42d103570005018e8727719f2fbe51d9bf00aa7c3fd4b73e1899685bbe315c6556213058f69ed40dcbc3df331e40
|
data/lib/rubylisp/function.rb
CHANGED
@@ -2,18 +2,18 @@ module Lisp
|
|
2
2
|
|
3
3
|
class Function < Atom
|
4
4
|
|
5
|
-
attr_reader :doc, :
|
5
|
+
attr_reader :doc, :arity
|
6
6
|
|
7
7
|
def compute_required_argument_count(args)
|
8
8
|
a = args
|
9
|
-
@
|
9
|
+
@arity = 0
|
10
10
|
@var_args = false
|
11
11
|
while a
|
12
12
|
if a.symbol?
|
13
13
|
@var_args = true
|
14
14
|
return
|
15
15
|
else
|
16
|
-
@
|
16
|
+
@arity += 1
|
17
17
|
end
|
18
18
|
a = a.cdr
|
19
19
|
end
|
@@ -35,9 +35,9 @@ module Lisp
|
|
35
35
|
|
36
36
|
def internal_apply_to(parameters, env, should_eval)
|
37
37
|
if @var_args
|
38
|
-
raise "#{@name} expected at least #{@
|
38
|
+
raise "#{@name} expected at least #{@arity} parameters, received #{parameters.length}." if parameters.length < @arity
|
39
39
|
else
|
40
|
-
raise "#{@name} expected #{@
|
40
|
+
raise "#{@name} expected #{@arity} parameters, received #{parameters.length}." unless parameters.length == @arity
|
41
41
|
end
|
42
42
|
|
43
43
|
local_env = EnvironmentFrame.extending(@env, env.frame)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubymotionlisp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Astels
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06
|
11
|
+
date: 2014-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An embeddable Lisp as an extension language for RubyMotion
|
14
14
|
email: dastels@icloud.com
|