heist 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +17 -0
- data/Manifest.txt +23 -19
- data/README.txt +84 -52
- data/lib/builtin/library.scm +208 -10
- data/lib/builtin/primitives.rb +154 -92
- data/lib/builtin/syntax.scm +22 -5
- data/lib/heist.rb +49 -17
- data/lib/parser/nodes.rb +47 -24
- data/lib/parser/ruby.rb +29 -0
- data/lib/parser/scheme.rb +455 -143
- data/lib/parser/scheme.tt +23 -5
- data/lib/repl.rb +19 -16
- data/lib/runtime/binding.rb +24 -2
- data/lib/runtime/callable/continuation.rb +23 -2
- data/lib/runtime/callable/function.rb +122 -21
- data/lib/runtime/callable/macro.rb +169 -123
- data/lib/runtime/callable/macro/expansion.rb +137 -2
- data/lib/runtime/callable/macro/matches.rb +125 -41
- data/lib/runtime/callable/macro/tree.rb +141 -0
- data/lib/runtime/callable/syntax.rb +44 -0
- data/lib/runtime/data/cons.rb +234 -0
- data/lib/runtime/data/expression.rb +15 -6
- data/lib/runtime/data/identifier.rb +19 -2
- data/lib/runtime/frame.rb +102 -35
- data/lib/runtime/runtime.rb +44 -19
- data/lib/runtime/scope.rb +145 -30
- data/lib/runtime/stack.rb +103 -1
- data/lib/runtime/stackless.rb +48 -6
- data/test/arithmetic.scm +11 -2
- data/test/continuations.scm +16 -2
- data/test/equivalence.scm +34 -0
- data/test/functional.scm +4 -0
- data/test/lists.scm +78 -0
- data/test/macro-helpers.scm +1 -0
- data/test/macros.scm +111 -24
- data/test/numbers.scm +30 -8
- data/test/test_heist.rb +67 -12
- metadata +25 -21
- data/lib/builtin/syntax.rb +0 -166
- data/lib/runtime/callable/macro/splice.rb +0 -56
- data/lib/runtime/data/list.rb +0 -36
data/lib/runtime/data/list.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
module Heist
|
2
|
-
class Runtime
|
3
|
-
|
4
|
-
class List < Array
|
5
|
-
include Expression
|
6
|
-
|
7
|
-
def self.from(array)
|
8
|
-
list = new
|
9
|
-
array.each { |item| list << item }
|
10
|
-
list
|
11
|
-
end
|
12
|
-
|
13
|
-
def <<(element)
|
14
|
-
element.exists_at!(self, self.size) if Expression === element
|
15
|
-
super
|
16
|
-
end
|
17
|
-
|
18
|
-
def []=(index, value)
|
19
|
-
super
|
20
|
-
value.exists_at!(self, index) if Expression === value
|
21
|
-
end
|
22
|
-
|
23
|
-
def rest
|
24
|
-
self[1..-1]
|
25
|
-
end
|
26
|
-
|
27
|
-
def to_s
|
28
|
-
'(' + collect { |cell| cell.to_s } * ' ' + ')'
|
29
|
-
end
|
30
|
-
|
31
|
-
alias :inspect :to_s
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|