galaaz 0.4.2 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +25 -0
- data/Rakefile +8 -0
- data/bin/gknit +9 -5
- data/bin/gstudio +4 -2
- data/bin/gstudio.rb +32 -2
- data/blogs/dev/dev.html +219 -34
- data/blogs/dev/dev.md +26 -26
- data/blogs/dev/dev_files/figure-html/bubble-1.png +0 -0
- data/blogs/dev/dev_files/figure-html/diverging_bar.png +0 -0
- data/blogs/dplyr/dplyr.rb +63 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +38 -26
- data/blogs/galaaz_ggplot/galaaz_ggplot.aux +16 -17
- data/blogs/galaaz_ggplot/galaaz_ggplot.pdf +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.tex +65 -31
- data/blogs/oh_my/not_so.rb +2342 -0
- data/blogs/oh_my/oh_my.Rmd +493 -0
- data/blogs/oh_my/oh_my.html +680 -0
- data/blogs/oh_my/oh_my.md +597 -0
- data/blogs/oh_my/old.Rmd +2100 -0
- data/blogs/ruby_plot/figures/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/figures/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/figures/final_box_plot.png +0 -0
- data/blogs/ruby_plot/figures/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/figures/violin_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot.Rmd +147 -122
- data/blogs/ruby_plot/ruby_plot.Rmd_external_figs +662 -0
- data/blogs/ruby_plot/ruby_plot.html +49 -54
- data/blogs/ruby_plot/ruby_plot.md +147 -122
- data/blogs/ruby_plot/ruby_plot.pdf +0 -0
- data/blogs/ruby_plot/ruby_plot.tex +776 -157
- data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.svg +57 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.svg +106 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.svg +110 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.svg +174 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.svg +236 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.svg +296 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.svg +236 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.svg +218 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.svg +128 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.svg +150 -0
- data/examples/islr/ch2.spec.rb +21 -18
- data/examples/islr/ch3_boston.rb +14 -5
- data/examples/islr/ch3_multiple_regression.rb +2 -3
- data/examples/islr/ch6.spec.rb +1 -1
- data/examples/islr/x_y_rnorm.jpg +0 -0
- data/lib/R_interface/r.rb +14 -10
- data/lib/R_interface/r_libs.R +9 -0
- data/lib/R_interface/r_methods.rb +77 -6
- data/lib/R_interface/{expression.rb → r_module_s.rb} +13 -14
- data/lib/R_interface/rbinary_operators.rb +58 -71
- data/lib/R_interface/rdata_frame.rb +2 -1
- data/lib/R_interface/rdevices.R +4 -0
- data/lib/R_interface/rdevices.rb +1 -1
- data/lib/R_interface/renvironment.rb +34 -1
- data/lib/R_interface/rexpression.rb +108 -2
- data/lib/R_interface/rindexed_object.rb +3 -1
- data/lib/R_interface/rlanguage.rb +18 -2
- data/lib/R_interface/rmatrix.rb +14 -0
- data/lib/R_interface/rmd_indexed_object.rb +5 -1
- data/lib/R_interface/robject.rb +61 -23
- data/lib/R_interface/rsupport.rb +111 -53
- data/lib/R_interface/rsymbol.rb +6 -5
- data/lib/R_interface/ruby_extensions.rb +130 -4
- data/lib/R_interface/runary_operators.rb +35 -3
- data/lib/R_interface/rvector.rb +1 -0
- data/lib/galaaz.rb +0 -2
- data/lib/gknit/knitr_engine.rb +58 -4
- data/lib/gknit/ruby_engine.rb +5 -6
- data/lib/util/exec_ruby.rb +55 -9
- data/specs/all.rb +13 -3
- data/specs/figures/dose_len.png +0 -0
- data/specs/r_dataframe.spec.rb +49 -26
- data/specs/r_environment.spec.rb +140 -0
- data/specs/r_eval.spec.rb +0 -15
- data/specs/r_formula.spec.rb +232 -0
- data/specs/r_function.spec.rb +7 -8
- data/specs/r_list.spec.rb +4 -0
- data/specs/r_list_apply.spec.rb +11 -11
- data/specs/r_matrix.spec.rb +3 -3
- data/specs/{r_plots.spec.rb~ → r_nse.spec.rb} +29 -6
- data/specs/r_vector_creation.spec.rb +6 -0
- data/specs/r_vector_object.spec.rb +2 -2
- data/specs/r_vector_operators.spec.rb +3 -3
- data/specs/r_vector_subsetting.spec.rb +4 -4
- data/specs/ruby_expression.spec.rb +324 -0
- data/specs/tmp.rb +12 -524
- data/sty/galaaz.sty +71 -0
- data/version.rb +1 -1
- metadata +31 -41
- data/bin/gknit2~ +0 -6
- data/bin/ogk~ +0 -4
- data/bin/prepareR.rb~ +0 -1
- data/blogs/dev/dev.Rmd~ +0 -104
- data/blogs/galaaz_ggplot/galaaz_ggplot.dvi +0 -0
- data/blogs/galaaz_ggplot/midwest_external_png~ +0 -1
- data/blogs/gknit/gknit.Rmd~ +0 -184
- data/blogs/gknit/gknit.Rnd~ +0 -17
- data/blogs/gknit/model.rb~ +0 -46
- data/blogs/ruby_plot/ruby_plot.Rmd~ +0 -215
- data/examples/islr/Figure.jpg +0 -0
- data/examples/misc/moneyball.rb~ +0 -16
- data/examples/misc/subsetting.rb~ +0 -372
- data/lib/R/eng_ruby.R~ +0 -63
- data/lib/R_interface/capture_plot.rb~ +0 -23
- data/lib/R_interface/r.rb~ +0 -121
- data/lib/R_interface/rdevices.rb~ +0 -27
- data/lib/gknit.rb~ +0 -26
- data/lib/gknit/knitr_engine.rb~ +0 -102
- data/lib/gknit/ruby_engine.rb~ +0 -72
- data/lib/util/inline_file.rb~ +0 -23
- data/r_requires/knitr.rb~ +0 -4
- data/specs/r_language.spec.rb +0 -157
Binary file
|
data/lib/R_interface/r.rb
CHANGED
@@ -21,6 +21,10 @@
|
|
21
21
|
# OR MODIFICATIONS.
|
22
22
|
##########################################################################################
|
23
23
|
|
24
|
+
# Load required R libraries
|
25
|
+
dir = File.dirname(File.expand_path('.', __FILE__))
|
26
|
+
Polyglot.eval_file("#{dir}/r_libs.R")
|
27
|
+
|
24
28
|
require_relative 'robject'
|
25
29
|
require_relative 'rsupport'
|
26
30
|
|
@@ -81,15 +85,20 @@ module R
|
|
81
85
|
|
82
86
|
end
|
83
87
|
|
84
|
-
# define methods for accessing indexed object: Vector, Lists
|
85
|
-
require_relative 'rindexed_object'
|
86
|
-
# define methods for accessing multi dimensional indexed objects: Matrix, DataFrames
|
87
|
-
require_relative 'rmd_indexed_object'
|
88
88
|
# Binary operators: '+', '-', etc
|
89
89
|
require_relative 'rbinary_operators'
|
90
90
|
# Unary operators: '!', '@-', etc
|
91
91
|
require_relative 'runary_operators'
|
92
|
-
#
|
92
|
+
# Ruby class extensions. Extends Symbol to allow the creation of
|
93
|
+
# expressions using Symbol: (:x > 10)
|
94
|
+
require_relative 'ruby_extensions'
|
95
|
+
|
96
|
+
# define methods for accessing indexed object: Vector, Lists
|
97
|
+
require_relative 'rindexed_object'
|
98
|
+
# define methods for accessing multi dimensional indexed objects: Matrix, DataFrames
|
99
|
+
require_relative 'rmd_indexed_object'
|
100
|
+
|
101
|
+
# Definition of R Vector. Vectors include Unary and Binary operators
|
93
102
|
require_relative 'rvector'
|
94
103
|
# Definition of R Lists
|
95
104
|
require_relative 'rlist'
|
@@ -110,11 +119,6 @@ require_relative 'rsymbol'
|
|
110
119
|
# Access to package symbols
|
111
120
|
require_relative 'rpkg'
|
112
121
|
|
113
|
-
# Defines the E module for creating R expressions
|
114
|
-
require_relative 'expression'
|
115
|
-
# Ruby class extensions. Extends Symbol to allow the creation of
|
116
|
-
# expressions using Symbol: (:x > 10)
|
117
|
-
require_relative 'ruby_extensions'
|
118
122
|
# Class to allow R calling back into Ruby
|
119
123
|
require_relative 'ruby_callback'
|
120
124
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
list.of.packages <- c('rlang', 'purrr', 'formula.tools', 'lobstr')
|
2
|
+
|
3
|
+
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
|
4
|
+
if(length(new.packages)) install.packages(new.packages)
|
5
|
+
|
6
|
+
library('formula.tools')
|
7
|
+
library('lobstr')
|
8
|
+
library('rlang')
|
9
|
+
library('purrr')
|
@@ -22,7 +22,7 @@
|
|
22
22
|
##########################################################################################
|
23
23
|
|
24
24
|
module R
|
25
|
-
|
25
|
+
|
26
26
|
module Support
|
27
27
|
|
28
28
|
#--------------------------------------------------------------------------------------
|
@@ -41,6 +41,21 @@ module R
|
|
41
41
|
R
|
42
42
|
end
|
43
43
|
|
44
|
+
def self.capture2
|
45
|
+
Polyglot.eval("R", <<-R)
|
46
|
+
function(obj, ...) {
|
47
|
+
tryCatch({
|
48
|
+
sink(tt <- textConnection("results","w"), split=FALSE, type = c("output", "message"));
|
49
|
+
print(obj, ...);
|
50
|
+
sink();
|
51
|
+
results
|
52
|
+
}, finally = {
|
53
|
+
close(tt);
|
54
|
+
})
|
55
|
+
}
|
56
|
+
R
|
57
|
+
end
|
58
|
+
|
44
59
|
def self.start_capture
|
45
60
|
Polyglot.eval("R", <<-R)
|
46
61
|
function(cap_variable) {
|
@@ -59,6 +74,18 @@ module R
|
|
59
74
|
R
|
60
75
|
end
|
61
76
|
|
77
|
+
#--------------------------------------------------------------------------------------
|
78
|
+
#
|
79
|
+
#--------------------------------------------------------------------------------------
|
80
|
+
|
81
|
+
def self.dbk_index
|
82
|
+
Polyglot.eval("R", <<-R)
|
83
|
+
function(obj, index) {
|
84
|
+
obj[[index]]
|
85
|
+
}
|
86
|
+
R
|
87
|
+
end
|
88
|
+
|
62
89
|
#--------------------------------------------------------------------------------------
|
63
90
|
# multi-dimensional indexing
|
64
91
|
#--------------------------------------------------------------------------------------
|
@@ -89,15 +116,59 @@ module R
|
|
89
116
|
end
|
90
117
|
|
91
118
|
#--------------------------------------------------------------------------------------
|
92
|
-
#
|
119
|
+
#
|
120
|
+
#--------------------------------------------------------------------------------------
|
121
|
+
|
122
|
+
def self.enquo
|
123
|
+
Polyglot.eval("R", <<-R)
|
124
|
+
function(x, ...) {
|
125
|
+
enquo(x)
|
126
|
+
}
|
127
|
+
R
|
128
|
+
end
|
129
|
+
|
130
|
+
#--------------------------------------------------------------------------------------
|
131
|
+
#
|
93
132
|
#--------------------------------------------------------------------------------------
|
94
133
|
|
95
|
-
def self.
|
96
|
-
Polyglot.eval("R",
|
134
|
+
def self.range
|
135
|
+
Polyglot.eval("R", <<-R)
|
136
|
+
function(x, y, neg = FALSE) {
|
137
|
+
e1 = enexpr(x)
|
138
|
+
e2 = enexpr(y)
|
139
|
+
if (neg) {
|
140
|
+
expr(-(!!e1:!!e2))
|
141
|
+
} else {
|
142
|
+
expr(!!e1:!!e2)
|
143
|
+
}
|
144
|
+
}
|
145
|
+
R
|
97
146
|
end
|
98
147
|
|
99
|
-
|
100
|
-
|
148
|
+
#--------------------------------------------------------------------------------------
|
149
|
+
#
|
150
|
+
#--------------------------------------------------------------------------------------
|
151
|
+
|
152
|
+
def self.create_bin_expr(operator)
|
153
|
+
is_formula = (operator == "`~`")? 'TRUE' : 'FALSE'
|
154
|
+
Polyglot.eval("R", <<-R)
|
155
|
+
function(op1, op2) {
|
156
|
+
o1 = enexpr(op1)
|
157
|
+
o2 = enexpr(op2)
|
158
|
+
if (typeof(o1) == 'symbol' && o1 == expr(`__`)) {
|
159
|
+
o1 = expr(.)
|
160
|
+
}
|
161
|
+
if (typeof(o2) == 'symbol' && o2 == expr(`__`)) {
|
162
|
+
o2 = expr(.)
|
163
|
+
}
|
164
|
+
exp = expr(#{operator}(!!o1, !!o2))
|
165
|
+
if (#{is_formula}) {
|
166
|
+
as.formula(exp)
|
167
|
+
} else {
|
168
|
+
exp
|
169
|
+
}
|
170
|
+
}
|
171
|
+
R
|
101
172
|
end
|
102
173
|
|
103
174
|
end
|
@@ -21,24 +21,23 @@
|
|
21
21
|
# OR MODIFICATIONS.
|
22
22
|
##########################################################################################
|
23
23
|
|
24
|
-
module
|
25
|
-
|
26
|
-
#----------------------------------------------------------------------------------------
|
27
|
-
# @param symbol [Symbol]
|
28
|
-
# @param args [Array] arguments to the missing method
|
29
|
-
#----------------------------------------------------------------------------------------
|
24
|
+
module R
|
30
25
|
|
31
|
-
def self.method_missing(symbol, *args)
|
32
|
-
name = R::Support.convert_symbol2r(symbol)
|
33
|
-
R::Language.build(name, *args)
|
34
|
-
end
|
35
|
-
|
36
26
|
#--------------------------------------------------------------------------------------
|
37
|
-
#
|
27
|
+
# Module S, is a support module with R functions that we do not want to polute the
|
28
|
+
# R namespace
|
38
29
|
#--------------------------------------------------------------------------------------
|
39
30
|
|
40
|
-
|
41
|
-
|
31
|
+
module S
|
32
|
+
|
33
|
+
#--------------------------------------------------------------------------------------
|
34
|
+
#
|
35
|
+
#--------------------------------------------------------------------------------------
|
36
|
+
|
37
|
+
def self.columns(col_ini, col_end, remove: false)
|
38
|
+
R::Support.exec_function(R::Support.range, col_ini, col_end, remove)
|
39
|
+
end
|
40
|
+
|
42
41
|
end
|
43
42
|
|
44
43
|
end
|
@@ -28,76 +28,39 @@ module R
|
|
28
28
|
#--------------------------------------------------------------------------------------
|
29
29
|
|
30
30
|
module ExecBinOp
|
31
|
-
|
32
|
-
#--------------------------------------------------------------------------------------
|
33
|
-
#
|
31
|
+
|
34
32
|
#--------------------------------------------------------------------------------------
|
33
|
+
#
|
34
|
+
#--------------------------------------------------------------------------------------
|
35
35
|
|
36
|
-
def
|
36
|
+
def exec_bin_oper(operator, other_object)
|
37
37
|
R::Support.exec_function_name(operator, @r_interop, other_object)
|
38
38
|
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
#--------------------------------------------------------------------------------------
|
43
|
-
# Module for binary operators when creating an expression (call)
|
44
|
-
#--------------------------------------------------------------------------------------
|
45
|
-
|
46
|
-
module CallBinOp
|
47
|
-
|
39
|
+
|
48
40
|
#--------------------------------------------------------------------------------------
|
49
|
-
#
|
41
|
+
#
|
50
42
|
#--------------------------------------------------------------------------------------
|
51
43
|
|
52
|
-
|
53
|
-
R
|
54
|
-
|
55
|
-
|
44
|
+
def coerce(numeric)
|
45
|
+
[R.c(numeric), self]
|
46
|
+
end
|
47
|
+
|
56
48
|
end
|
57
|
-
|
49
|
+
|
58
50
|
#--------------------------------------------------------------------------------------
|
59
|
-
# Module for binary operators when creating
|
51
|
+
# Module for binary operators when creating an expression (call)
|
60
52
|
#--------------------------------------------------------------------------------------
|
61
|
-
|
62
|
-
module
|
53
|
+
|
54
|
+
module CallBinOp
|
63
55
|
|
64
|
-
#--------------------------------------------------------------------------------------
|
65
|
-
#
|
66
|
-
#--------------------------------------------------------------------------------------
|
67
|
-
|
68
|
-
def prep_object(object)
|
69
|
-
|
70
|
-
case object
|
71
|
-
when :all
|
72
|
-
'.'
|
73
|
-
when R::RSymbol, Symbol
|
74
|
-
object.to_s
|
75
|
-
when R::Language
|
76
|
-
R.deparse(object).substring(2)
|
77
|
-
when String
|
78
|
-
object
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
82
|
-
|
83
56
|
#--------------------------------------------------------------------------------------
|
84
57
|
#
|
85
58
|
#--------------------------------------------------------------------------------------
|
86
59
|
|
87
|
-
def
|
88
|
-
|
89
|
-
o1 = prep_object(self)
|
90
|
-
o2 = prep_object(other_object)
|
91
|
-
|
92
|
-
response ? R.reformulate(o2, response: o1) :
|
93
|
-
R.reformulate(R.paste0(o1, operator.delete("`"), o2))
|
94
|
-
|
60
|
+
def exec_bin_oper(operator, other_object)
|
61
|
+
R::Language.build(operator, self, other_object)
|
95
62
|
end
|
96
63
|
|
97
|
-
#--------------------------------------------------------------------------------------
|
98
|
-
#
|
99
|
-
#--------------------------------------------------------------------------------------
|
100
|
-
|
101
64
|
end
|
102
65
|
|
103
66
|
#--------------------------------------------------------------------------------------
|
@@ -111,7 +74,7 @@ module R
|
|
111
74
|
#--------------------------------------------------------------------------------------
|
112
75
|
|
113
76
|
def +(other_object)
|
114
|
-
|
77
|
+
exec_bin_oper("`+`", other_object)
|
115
78
|
end
|
116
79
|
|
117
80
|
#--------------------------------------------------------------------------------------
|
@@ -119,7 +82,7 @@ module R
|
|
119
82
|
#--------------------------------------------------------------------------------------
|
120
83
|
|
121
84
|
def -(other_object)
|
122
|
-
|
85
|
+
exec_bin_oper("`-`", other_object)
|
123
86
|
end
|
124
87
|
|
125
88
|
#--------------------------------------------------------------------------------------
|
@@ -127,7 +90,7 @@ module R
|
|
127
90
|
#--------------------------------------------------------------------------------------
|
128
91
|
|
129
92
|
def *(other_object)
|
130
|
-
|
93
|
+
exec_bin_oper("`*`", other_object)
|
131
94
|
end
|
132
95
|
|
133
96
|
#--------------------------------------------------------------------------------------
|
@@ -135,7 +98,7 @@ module R
|
|
135
98
|
#--------------------------------------------------------------------------------------
|
136
99
|
|
137
100
|
def /(other_object)
|
138
|
-
|
101
|
+
exec_bin_oper("`/`", other_object)
|
139
102
|
end
|
140
103
|
|
141
104
|
#--------------------------------------------------------------------------------------
|
@@ -143,7 +106,7 @@ module R
|
|
143
106
|
#--------------------------------------------------------------------------------------
|
144
107
|
|
145
108
|
def **(other_object)
|
146
|
-
|
109
|
+
exec_bin_oper("`^`", other_object)
|
147
110
|
end
|
148
111
|
|
149
112
|
#--------------------------------------------------------------------------------------
|
@@ -151,15 +114,25 @@ module R
|
|
151
114
|
#--------------------------------------------------------------------------------------
|
152
115
|
|
153
116
|
def %(other_object)
|
154
|
-
|
117
|
+
exec_bin_oper("`%%`", other_object)
|
155
118
|
end
|
119
|
+
|
120
|
+
alias_method :mod, :%
|
121
|
+
|
122
|
+
#--------------------------------------------------------------------------------------
|
123
|
+
#
|
124
|
+
#--------------------------------------------------------------------------------------
|
156
125
|
|
126
|
+
def int_div(other_object)
|
127
|
+
exec_bin_oper("`%/%`", other_object)
|
128
|
+
end
|
129
|
+
|
157
130
|
#--------------------------------------------------------------------------------------
|
158
131
|
#
|
159
132
|
#--------------------------------------------------------------------------------------
|
160
133
|
|
161
|
-
def
|
162
|
-
|
134
|
+
def eq(other_object)
|
135
|
+
exec_bin_oper("`==`", other_object)
|
163
136
|
end
|
164
137
|
|
165
138
|
#--------------------------------------------------------------------------------------
|
@@ -167,63 +140,77 @@ module R
|
|
167
140
|
#--------------------------------------------------------------------------------------
|
168
141
|
|
169
142
|
def <(other_object)
|
170
|
-
|
143
|
+
exec_bin_oper("`<`", other_object)
|
171
144
|
end
|
172
|
-
|
145
|
+
|
146
|
+
alias_method :lt, :<
|
147
|
+
|
173
148
|
#--------------------------------------------------------------------------------------
|
174
149
|
#
|
175
150
|
#--------------------------------------------------------------------------------------
|
176
151
|
|
177
152
|
def <=(other_object)
|
178
|
-
|
153
|
+
exec_bin_oper("`<=`", other_object)
|
179
154
|
end
|
180
155
|
|
156
|
+
alias_method :le, :<=
|
157
|
+
|
181
158
|
#--------------------------------------------------------------------------------------
|
182
159
|
#
|
183
160
|
#--------------------------------------------------------------------------------------
|
184
161
|
|
185
162
|
def >(other_object)
|
186
|
-
|
163
|
+
exec_bin_oper("`>`", other_object)
|
187
164
|
end
|
188
165
|
|
166
|
+
alias_method :gt, :>
|
167
|
+
|
189
168
|
#--------------------------------------------------------------------------------------
|
190
169
|
#
|
191
170
|
#--------------------------------------------------------------------------------------
|
192
171
|
|
193
172
|
def >=(other_object)
|
194
|
-
|
173
|
+
exec_bin_oper("`>=`", other_object)
|
195
174
|
end
|
196
175
|
|
176
|
+
alias_method :ge, :>=
|
177
|
+
|
197
178
|
#--------------------------------------------------------------------------------------
|
198
179
|
#
|
199
180
|
#--------------------------------------------------------------------------------------
|
200
181
|
|
201
182
|
def !=(other_object)
|
202
|
-
|
183
|
+
exec_bin_oper("`!=`", other_object)
|
203
184
|
end
|
185
|
+
|
186
|
+
alias_method :ne, :!=
|
204
187
|
|
205
188
|
#--------------------------------------------------------------------------------------
|
206
189
|
#
|
207
190
|
#--------------------------------------------------------------------------------------
|
208
191
|
|
209
192
|
def &(other_object)
|
210
|
-
|
193
|
+
exec_bin_oper("`&`", other_object)
|
211
194
|
end
|
195
|
+
|
196
|
+
alias_method :and, :&
|
212
197
|
|
213
198
|
#--------------------------------------------------------------------------------------
|
214
199
|
#
|
215
200
|
#--------------------------------------------------------------------------------------
|
216
201
|
|
217
202
|
def |(other_object)
|
218
|
-
|
203
|
+
exec_bin_oper("`|`", other_object)
|
219
204
|
end
|
220
205
|
|
206
|
+
alias_method :or, :|
|
207
|
+
|
221
208
|
#--------------------------------------------------------------------------------------
|
222
209
|
#
|
223
210
|
#--------------------------------------------------------------------------------------
|
224
211
|
|
225
|
-
def
|
226
|
-
|
212
|
+
def til(other_object)
|
213
|
+
exec_bin_oper("`~`", other_object)
|
227
214
|
end
|
228
215
|
|
229
216
|
end
|