ampex 0.2.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/ampex.rb +1 -57
  2. metadata +7 -3
@@ -24,62 +24,6 @@ class Metavariable < BlankSlate
24
24
  end
25
25
  end
26
26
  end
27
-
28
- def metavariable_precedence
29
- @parent unless @block
30
- end
31
- end
32
-
33
- class CallByName < BlankSlate
34
- def initialize(obj, parent=nil, name=nil, args=nil, block=nil)
35
- @obj = obj
36
- @parent = parent
37
- @name = name
38
- @args = args
39
- @block = block
40
- end
41
-
42
- def method_missing(name, *args, &block)
43
- CallByName.new(nil, self, name, args, block)
44
- end
45
-
46
- def unwind_callbyname(*args)
47
- provided.map{|x| Metavariable === x ? called[x.metavariable_precedence] : x}
48
- if @parent
49
- @parent.unwind_callbyname(*args).send(@name, *CallByName.merge_args(@args, args), &@block)
50
- else
51
- @obj
52
- end
53
- end
54
-
55
- def to_proc
56
- if @parent
57
- lambda { |*args| unwind_callbyname(*args) }
58
- else
59
- lambda { |*args| @obj }
60
- end
61
- end
62
-
63
- def self.merge_args(provided, called)
64
- end
65
- end
66
-
67
-
68
- class Regexp
69
- def [](obj)
70
- CallByName.new(obj)
71
- end
72
- end
73
-
74
- module Kernel
75
- def X
76
- Metavariable.new(0)
77
- end
78
27
  end
79
28
 
80
- K = Metavariable.new(0)
81
- V = Metavariable.new(1)
82
- W = Regexp.new""
83
- X =
84
- Y = Metavariable.new(1)
85
- Z = Metavariable.new(2)
29
+ X = Metavariable.new
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ampex
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
7
+ - 1
6
8
  - 0
7
- - 2
8
9
  - 0
9
- version: 0.2.0
10
+ version: 1.0.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Conrad Irwin
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-11-17 00:00:00 +00:00
18
+ date: 2010-11-18 00:00:00 +00:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 3
28
30
  segments:
29
31
  - 0
30
32
  version: "0"
@@ -56,6 +58,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
58
  requirements:
57
59
  - - ">="
58
60
  - !ruby/object:Gem::Version
61
+ hash: 3
59
62
  segments:
60
63
  - 0
61
64
  version: "0"
@@ -64,6 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
67
  requirements:
65
68
  - - ">="
66
69
  - !ruby/object:Gem::Version
70
+ hash: 3
67
71
  segments:
68
72
  - 0
69
73
  version: "0"