plasma 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.
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'rake/gempackagetask'
7
7
 
8
8
  gemspec = Gem::Specification.new do |s|
9
9
  s.name = "plasma"
10
- s.version = "0.1.0"
10
+ s.version = "0.1.1"
11
11
  s.author = "Ryan Spangler"
12
12
  s.email = "patch_work8848@yahoo.com"
13
13
  s.homepage = "http://kaleidomedallion.com/plasma/"
data/bin/plasma CHANGED
@@ -10,7 +10,11 @@ interpreter = Plasma::Interpreter::PlasmaInterpreter.new
10
10
  if ARGV.empty?
11
11
  interpreter.repl
12
12
  else
13
- puts interpreter.merge(ARGV[0])
13
+ value = ARGV.inject(nil) do |value, arg|
14
+ interpreter.merge(arg)
15
+ end
16
+
17
+ puts value
14
18
  end
15
19
 
16
20
 
@@ -8,7 +8,10 @@ module Plasma
8
8
  @comment = /##*[^#]+##*/
9
9
 
10
10
  @dir = File.dirname(__FILE__)
11
- @load_path = [File.join(PLASMA_ROOT, 'include'), PLASMA_PACKAGE_ROOT, @dir]
11
+ @load_path = [PLASMA_PACKAGE_ROOT,
12
+ File.join(PLASMA_ROOT, 'include'),
13
+ @dir,
14
+ `pwd`.strip]
12
15
 
13
16
  @env = Env.new
14
17
  @env.bind!(:mu, self)
@@ -54,7 +57,7 @@ module Plasma
54
57
  found = false
55
58
  value = nil
56
59
 
57
- @load_path.each do |p|
60
+ @load_path.reverse_each do |p|
58
61
  package = File.join(p, file)
59
62
  if File.exist? package
60
63
  source = File.open(package, 'r')
@@ -62,6 +65,7 @@ module Plasma
62
65
 
63
66
  value = self.interpret(code)
64
67
  found = true
68
+ break
65
69
  end
66
70
  end
67
71
 
@@ -0,0 +1,8 @@
1
+ [(defun (fac n)
2
+ (if (<= n 1)
3
+ then 1
4
+ else (* n (fac (- n 1)))))]
5
+
6
+ [(fac 50)]
7
+
8
+
@@ -0,0 +1,6 @@
1
+ def fac(n)
2
+ return 1 if n <= 1
3
+ n * fac(n-1)
4
+ end
5
+
6
+ puts fac(50)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plasma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Spangler
@@ -36,6 +36,8 @@ files:
36
36
  - test/import_test.plasma
37
37
  - test/parse_test.rb
38
38
  - test/plasmic.plasma
39
+ - test/recur.plasma
40
+ - test/recur.rb
39
41
  - test/template_test.plasma
40
42
  - test/template_test.rb
41
43
  - lib/extras