fancy 0.3.0
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/AUTHORS +7 -0
- data/LICENSE +19 -0
- data/README +173 -0
- data/Rakefile +255 -0
- data/bin/fancy +40 -0
- data/bin/fdoc +23 -0
- data/bin/fyi +22 -0
- data/bin/ifancy +46 -0
- data/boot/README +12 -0
- data/boot/code_loader.rb +165 -0
- data/boot/compile.fy +3 -0
- data/boot/fancy_ext.rb +13 -0
- data/boot/fancy_ext/block_env.rb +29 -0
- data/boot/fancy_ext/class.rb +26 -0
- data/boot/fancy_ext/kernel.rb +12 -0
- data/boot/fancy_ext/module.rb +89 -0
- data/boot/fancy_ext/object.rb +34 -0
- data/boot/fancy_ext/string_helper.rb +10 -0
- data/boot/load.rb +72 -0
- data/boot/rbx-compiler/README +12 -0
- data/boot/rbx-compiler/compiler.rb +24 -0
- data/boot/rbx-compiler/compiler/ast.rb +23 -0
- data/boot/rbx-compiler/compiler/ast/README +11 -0
- data/boot/rbx-compiler/compiler/ast/array_literal.rb +13 -0
- data/boot/rbx-compiler/compiler/ast/assign.rb +57 -0
- data/boot/rbx-compiler/compiler/ast/block.rb +70 -0
- data/boot/rbx-compiler/compiler/ast/class_def.rb +35 -0
- data/boot/rbx-compiler/compiler/ast/expression_list.rb +57 -0
- data/boot/rbx-compiler/compiler/ast/hash_literal.rb +11 -0
- data/boot/rbx-compiler/compiler/ast/identifier.rb +120 -0
- data/boot/rbx-compiler/compiler/ast/match.rb +81 -0
- data/boot/rbx-compiler/compiler/ast/message_send.rb +71 -0
- data/boot/rbx-compiler/compiler/ast/method_def.rb +116 -0
- data/boot/rbx-compiler/compiler/ast/node.rb +6 -0
- data/boot/rbx-compiler/compiler/ast/range_literal.rb +22 -0
- data/boot/rbx-compiler/compiler/ast/require.rb +20 -0
- data/boot/rbx-compiler/compiler/ast/return.rb +29 -0
- data/boot/rbx-compiler/compiler/ast/ruby_args.rb +35 -0
- data/boot/rbx-compiler/compiler/ast/script.rb +56 -0
- data/boot/rbx-compiler/compiler/ast/singleton_method_def.rb +39 -0
- data/boot/rbx-compiler/compiler/ast/string_literal.rb +14 -0
- data/boot/rbx-compiler/compiler/ast/super.rb +25 -0
- data/boot/rbx-compiler/compiler/ast/try_catch_block.rb +220 -0
- data/boot/rbx-compiler/compiler/ast/tuple_literal.rb +33 -0
- data/boot/rbx-compiler/compiler/command.rb +39 -0
- data/boot/rbx-compiler/compiler/compiler.rb +83 -0
- data/boot/rbx-compiler/compiler/stages.rb +99 -0
- data/boot/rbx-compiler/parser.rb +2 -0
- data/boot/rbx-compiler/parser/README +15 -0
- data/boot/rbx-compiler/parser/Rakefile +54 -0
- data/boot/rbx-compiler/parser/extconf.rb +3 -0
- data/boot/rbx-compiler/parser/fancy_parser.bundle +0 -0
- data/boot/rbx-compiler/parser/fancy_parser.c +46 -0
- data/boot/rbx-compiler/parser/fancy_parser.h +8 -0
- data/boot/rbx-compiler/parser/lexer.lex +180 -0
- data/boot/rbx-compiler/parser/parser.rb +356 -0
- data/boot/rbx-compiler/parser/parser.y +711 -0
- data/boot/rsexp_pretty_printer.rb +76 -0
- data/doc/api/fancy.css +93 -0
- data/doc/api/fancy.jsonp +1 -0
- data/doc/api/fdoc.js +187 -0
- data/doc/api/index.html +57 -0
- data/doc/api/underscore-min.js +18 -0
- data/doc/features.md +228 -0
- data/examples/argv.fy +8 -0
- data/examples/arithmetic.fy +7 -0
- data/examples/armstrong_numbers.fy +33 -0
- data/examples/array.fy +52 -0
- data/examples/blocks.fy +15 -0
- data/examples/boolean.fy +24 -0
- data/examples/call_with_receiver.fy +9 -0
- data/examples/class.fy +68 -0
- data/examples/closures.fy +24 -0
- data/examples/constant_access.fy +15 -0
- data/examples/default_args.fy +17 -0
- data/examples/define_methods.fy +15 -0
- data/examples/documentation.fy +57 -0
- data/examples/documentation_formatters.fy +25 -0
- data/examples/echo.fy +16 -0
- data/examples/empty_catch.fy +4 -0
- data/examples/exception.fy +9 -0
- data/examples/factorial.fy +12 -0
- data/examples/fibonacci.fy +16 -0
- data/examples/files.fy +23 -0
- data/examples/finally.fy +5 -0
- data/examples/game_of_life.fy +148 -0
- data/examples/hashes.fy +7 -0
- data/examples/hello_world.fy +6 -0
- data/examples/html_generator.fy +54 -0
- data/examples/implicit_return.fy +3 -0
- data/examples/matchers.fy +6 -0
- data/examples/methods.fy +29 -0
- data/examples/nested_classes.fy +27 -0
- data/examples/nested_try.fy +9 -0
- data/examples/numbers.fy +12 -0
- data/examples/pattern_matching.fy +40 -0
- data/examples/person.fy +65 -0
- data/examples/project-euler/01.fy +8 -0
- data/examples/project-euler/02.fy +21 -0
- data/examples/project-euler/28.fy +33 -0
- data/examples/rbx/and_or.fy +7 -0
- data/examples/rbx/blocks.fy +22 -0
- data/examples/rbx/classes.fy +32 -0
- data/examples/rbx/hello.fy +8 -0
- data/examples/rbx/include.fy +12 -0
- data/examples/rbx/inherit.fy +11 -0
- data/examples/rbx/methods.fy +15 -0
- data/examples/rbx/nested_classes.fy +9 -0
- data/examples/rbx/require.fy +3 -0
- data/examples/rbx/strings.fy +5 -0
- data/examples/regex.fy +7 -0
- data/examples/require.fy +7 -0
- data/examples/retry.fy +12 -0
- data/examples/return.fy +13 -0
- data/examples/ruby_require.fy +7 -0
- data/examples/ruby_send.fy +3 -0
- data/examples/singleton_methods.fy +21 -0
- data/examples/stupid_quicksort.fy +12 -0
- data/examples/threads.fy +18 -0
- data/examples/tuple.fy +8 -0
- data/examples/webserver/webserver.fy +18 -0
- data/lib/argv.fy +36 -0
- data/lib/array.fy +207 -0
- data/lib/block.fy +88 -0
- data/lib/boot.fy +41 -0
- data/lib/class.fy +106 -0
- data/lib/compiler.fy +14 -0
- data/lib/compiler/ast.fy +40 -0
- data/lib/compiler/ast/assign.fy +96 -0
- data/lib/compiler/ast/block.fy +84 -0
- data/lib/compiler/ast/class_def.fy +33 -0
- data/lib/compiler/ast/expression_list.fy +47 -0
- data/lib/compiler/ast/identifier.fy +113 -0
- data/lib/compiler/ast/literals.fy +122 -0
- data/lib/compiler/ast/match.fy +88 -0
- data/lib/compiler/ast/message_send.fy +110 -0
- data/lib/compiler/ast/method_def.fy +90 -0
- data/lib/compiler/ast/node.fy +7 -0
- data/lib/compiler/ast/range.fy +16 -0
- data/lib/compiler/ast/require.fy +15 -0
- data/lib/compiler/ast/return.fy +23 -0
- data/lib/compiler/ast/script.fy +52 -0
- data/lib/compiler/ast/singleton_method_def.fy +35 -0
- data/lib/compiler/ast/super.fy +17 -0
- data/lib/compiler/ast/try_catch.fy +176 -0
- data/lib/compiler/ast/tuple_literal.fy +34 -0
- data/lib/compiler/command.fy +51 -0
- data/lib/compiler/compiler.fy +73 -0
- data/lib/compiler/stages.fy +81 -0
- data/lib/directory.fy +17 -0
- data/lib/documentation.fy +115 -0
- data/lib/enumerable.fy +269 -0
- data/lib/eval.fy +31 -0
- data/lib/fancy_spec.fy +202 -0
- data/lib/fdoc.fy +359 -0
- data/lib/fdoc_hook.fy +10 -0
- data/lib/file.fy +54 -0
- data/lib/hash.fy +56 -0
- data/lib/main.fy +80 -0
- data/lib/method.fy +22 -0
- data/lib/nil_class.fy +56 -0
- data/lib/number.fy +87 -0
- data/lib/object.fy +170 -0
- data/lib/package.fy +61 -0
- data/lib/package/dependency.fy +24 -0
- data/lib/package/installer.fy +180 -0
- data/lib/package/specification.fy +55 -0
- data/lib/package/uninstaller.fy +15 -0
- data/lib/parser.fy +4 -0
- data/lib/parser/ext/README +15 -0
- data/lib/parser/ext/ext.c +42 -0
- data/lib/parser/ext/ext.h +8 -0
- data/lib/parser/ext/extconf.rb +3 -0
- data/lib/parser/ext/lexer.lex +187 -0
- data/lib/parser/ext/parser.y +744 -0
- data/lib/parser/methods.fy +297 -0
- data/lib/rbx.fy +37 -0
- data/lib/rbx/array.fy +237 -0
- data/lib/rbx/bignum.fy +23 -0
- data/lib/rbx/block.fy +9 -0
- data/lib/rbx/class.fy +129 -0
- data/lib/rbx/code_loader.fy +192 -0
- data/lib/rbx/console.fy +63 -0
- data/lib/rbx/directory.fy +46 -0
- data/lib/rbx/documentation.fy +64 -0
- data/lib/rbx/environment_variables.fy +3 -0
- data/lib/rbx/exception.fy +30 -0
- data/lib/rbx/false_class.fy +58 -0
- data/lib/rbx/fiber.fy +25 -0
- data/lib/rbx/file.fy +191 -0
- data/lib/rbx/fixnum.fy +25 -0
- data/lib/rbx/float.fy +14 -0
- data/lib/rbx/hash.fy +38 -0
- data/lib/rbx/integer.fy +15 -0
- data/lib/rbx/io.fy +30 -0
- data/lib/rbx/match_data.fy +9 -0
- data/lib/rbx/method.fy +22 -0
- data/lib/rbx/name_error.fy +3 -0
- data/lib/rbx/no_method_error.fy +15 -0
- data/lib/rbx/object.fy +117 -0
- data/lib/rbx/range.fy +15 -0
- data/lib/rbx/regexp.fy +9 -0
- data/lib/rbx/string.fy +63 -0
- data/lib/rbx/symbol.fy +12 -0
- data/lib/rbx/system.fy +37 -0
- data/lib/rbx/tcp_server.fy +6 -0
- data/lib/rbx/tcp_socket.fy +7 -0
- data/lib/rbx/thread.fy +75 -0
- data/lib/rbx/tuple.fy +37 -0
- data/lib/set.fy +61 -0
- data/lib/stack.fy +51 -0
- data/lib/string.fy +58 -0
- data/lib/struct.fy +13 -0
- data/lib/symbol.fy +23 -0
- data/lib/true_class.fy +43 -0
- data/lib/tuple.fy +68 -0
- data/lib/version.fy +6 -0
- data/tests/argv.fy +13 -0
- data/tests/array.fy +343 -0
- data/tests/assignment.fy +53 -0
- data/tests/block.fy +103 -0
- data/tests/class.fy +409 -0
- data/tests/control_flow.fy +79 -0
- data/tests/documentation.fy +24 -0
- data/tests/exception.fy +115 -0
- data/tests/file.fy +86 -0
- data/tests/hash.fy +101 -0
- data/tests/method.fy +131 -0
- data/tests/nil_class.fy +55 -0
- data/tests/number.fy +128 -0
- data/tests/object.fy +125 -0
- data/tests/parsing/sexp.fy +50 -0
- data/tests/pattern_matching.fy +82 -0
- data/tests/range.fy +11 -0
- data/tests/set.fy +10 -0
- data/tests/stack.fy +22 -0
- data/tests/string.fy +102 -0
- data/tests/symbol.fy +17 -0
- data/tests/true_class.fy +63 -0
- data/tests/tuple.fy +21 -0
- data/tools/fancy-mode.el +63 -0
- metadata +321 -0
data/lib/rbx/integer.fy
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
class Integer {
|
2
|
+
# common ruby-forwarding methods used by Fixnum & Bignum classes
|
3
|
+
|
4
|
+
def times: block {
|
5
|
+
times(&block)
|
6
|
+
}
|
7
|
+
|
8
|
+
def upto: num do_each: block {
|
9
|
+
upto(num, &block)
|
10
|
+
}
|
11
|
+
|
12
|
+
def downto: num do_each: block {
|
13
|
+
downto(num, &block)
|
14
|
+
}
|
15
|
+
}
|
data/lib/rbx/io.fy
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
class IO {
|
2
|
+
ruby_alias: 'readlines
|
3
|
+
ruby_alias: 'readline
|
4
|
+
ruby_alias: 'read
|
5
|
+
ruby_alias: 'close
|
6
|
+
ruby_alias: 'eof?
|
7
|
+
|
8
|
+
def readln {
|
9
|
+
self readline
|
10
|
+
}
|
11
|
+
|
12
|
+
def println {
|
13
|
+
self puts()
|
14
|
+
}
|
15
|
+
|
16
|
+
def print: obj {
|
17
|
+
self print(obj)
|
18
|
+
}
|
19
|
+
|
20
|
+
def println: obj {
|
21
|
+
self puts(obj)
|
22
|
+
}
|
23
|
+
|
24
|
+
def printchar: char {
|
25
|
+
self printc(char)
|
26
|
+
}
|
27
|
+
|
28
|
+
alias_method: 'write: for: 'print:
|
29
|
+
alias_method: 'writeln: for: 'println:
|
30
|
+
}
|
data/lib/rbx/method.fy
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
class Method {
|
2
|
+
def documentation {
|
3
|
+
Fancy Documentation for: (self executable())
|
4
|
+
}
|
5
|
+
|
6
|
+
def documentation: str {
|
7
|
+
Fancy Documentation for: (self executable()) is: str
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
class UnboundMethod {
|
12
|
+
|
13
|
+
def documentation {
|
14
|
+
Fancy Documentation for: (self executable())
|
15
|
+
}
|
16
|
+
|
17
|
+
def documentation: str {
|
18
|
+
Fancy Documentation for: (self executable()) is: str
|
19
|
+
}
|
20
|
+
|
21
|
+
}
|
22
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class NoMethodError {
|
2
|
+
"""
|
3
|
+
Exception class that gets thrown when a method wasn't found within a class.
|
4
|
+
"""
|
5
|
+
|
6
|
+
def method_name {
|
7
|
+
"""
|
8
|
+
@return Name of the method not found (as @String@).
|
9
|
+
|
10
|
+
Returns the name of the method that was not found as a @String@.
|
11
|
+
"""
|
12
|
+
|
13
|
+
self name to_s from: 1 to: -1
|
14
|
+
}
|
15
|
+
}
|
data/lib/rbx/object.fy
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
class Class {
|
2
|
+
def alias_method: new for: old {
|
3
|
+
alias_method(new, old)
|
4
|
+
}
|
5
|
+
|
6
|
+
def ruby_alias: method_name {
|
7
|
+
alias_method(":" + (method_name to_s), method_name)
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
class String {
|
12
|
+
alias_method: ":+" for: "+"
|
13
|
+
}
|
14
|
+
|
15
|
+
class Object {
|
16
|
+
|
17
|
+
ruby_alias: '==
|
18
|
+
ruby_alias: '===
|
19
|
+
ruby_alias: 'class
|
20
|
+
|
21
|
+
def initialize {
|
22
|
+
self initialize()
|
23
|
+
}
|
24
|
+
|
25
|
+
def dclone {
|
26
|
+
"Returns a deep clone of self using Ruby's Marshal class."
|
27
|
+
Marshal load: $ Marshal dump: self
|
28
|
+
}
|
29
|
+
|
30
|
+
def ++ other {
|
31
|
+
self to_s + (other to_s)
|
32
|
+
}
|
33
|
+
|
34
|
+
def to_s {
|
35
|
+
self to_s()
|
36
|
+
}
|
37
|
+
|
38
|
+
def inspect {
|
39
|
+
self inspect()
|
40
|
+
}
|
41
|
+
|
42
|
+
def set_slot: slotname value: val {
|
43
|
+
instance_variable_set("@" ++ slotname, val)
|
44
|
+
}
|
45
|
+
|
46
|
+
def get_slot: slotname {
|
47
|
+
instance_variable_get("@" ++ slotname)
|
48
|
+
}
|
49
|
+
|
50
|
+
def and: other {
|
51
|
+
"""
|
52
|
+
Boolean conjunction.
|
53
|
+
Returns true if self and other are true, otherwise nil.
|
54
|
+
"""
|
55
|
+
|
56
|
+
self if_do: {
|
57
|
+
other if_do: {
|
58
|
+
return true
|
59
|
+
}
|
60
|
+
}
|
61
|
+
return false
|
62
|
+
}
|
63
|
+
|
64
|
+
def or: other {
|
65
|
+
"""
|
66
|
+
Boolean disjunction.
|
67
|
+
Returns true if either self or other is true, otherwise nil.
|
68
|
+
"""
|
69
|
+
self if_do: {
|
70
|
+
return true
|
71
|
+
} else: {
|
72
|
+
other if_do: {
|
73
|
+
return true
|
74
|
+
}
|
75
|
+
}
|
76
|
+
return false
|
77
|
+
}
|
78
|
+
|
79
|
+
def define_singleton_method: name with: block {
|
80
|
+
self metaclass define_method: name with: block
|
81
|
+
}
|
82
|
+
|
83
|
+
def undefine_singleton_method: name {
|
84
|
+
self metaclass undefine_method: name
|
85
|
+
}
|
86
|
+
|
87
|
+
def is_a?: class {
|
88
|
+
"Indicates, if an object is an instance of a given Class."
|
89
|
+
is_a?(class)
|
90
|
+
}
|
91
|
+
|
92
|
+
def kind_of?: class {
|
93
|
+
"Indicates, if an object is an instance of a given Class."
|
94
|
+
kind_of?(class)
|
95
|
+
}
|
96
|
+
|
97
|
+
def send: message {
|
98
|
+
self send(message_name: message)
|
99
|
+
}
|
100
|
+
|
101
|
+
def send: message params: params {
|
102
|
+
ruby: (message_name: message) args: params
|
103
|
+
}
|
104
|
+
|
105
|
+
def message_name: symbol {
|
106
|
+
symbol = symbol to_s
|
107
|
+
if: (symbol includes?: ":") then: {
|
108
|
+
symbol
|
109
|
+
} else: {
|
110
|
+
":" ++ symbol
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
def responds_to?: message {
|
115
|
+
self respond_to?(message_name: message)
|
116
|
+
}
|
117
|
+
}
|
data/lib/rbx/range.fy
ADDED
data/lib/rbx/regexp.fy
ADDED
data/lib/rbx/string.fy
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
class String {
|
2
|
+
|
3
|
+
# prepend a : to fancy version of ruby methods.
|
4
|
+
ruby_alias: '==
|
5
|
+
ruby_alias: 'upcase
|
6
|
+
ruby_alias: 'downcase
|
7
|
+
ruby_alias: '=~
|
8
|
+
ruby_alias: 'to_i
|
9
|
+
ruby_alias: 'to_f
|
10
|
+
ruby_alias: 'chomp
|
11
|
+
|
12
|
+
def [] index {
|
13
|
+
"""Given an Array of 2 Numbers, it returns the substring between the given indices.
|
14
|
+
If given a Number, returns the character at that index."""
|
15
|
+
|
16
|
+
# if given an Array, interpret it as a from:to: range substring
|
17
|
+
if: (index is_a?: Array) then: {
|
18
|
+
from: (index[0]) to: (index[1])
|
19
|
+
} else: {
|
20
|
+
ruby: '[] args: [index] . chr
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
def from: from to: to {
|
25
|
+
ruby: '[] args: [(from .. to)]
|
26
|
+
}
|
27
|
+
|
28
|
+
def each: block {
|
29
|
+
split("") each(&block)
|
30
|
+
}
|
31
|
+
|
32
|
+
def at: idx {
|
33
|
+
self[idx]
|
34
|
+
}
|
35
|
+
|
36
|
+
def split: str {
|
37
|
+
split(str)
|
38
|
+
}
|
39
|
+
|
40
|
+
def split {
|
41
|
+
split()
|
42
|
+
}
|
43
|
+
|
44
|
+
def eval {
|
45
|
+
binding = Binding setup(Rubinius VariableScope of_sender(),
|
46
|
+
Rubinius CompiledMethod of_sender(),
|
47
|
+
Rubinius StaticScope of_sender())
|
48
|
+
Fancy eval: self binding: binding
|
49
|
+
}
|
50
|
+
|
51
|
+
def eval_global {
|
52
|
+
Fancy eval: self
|
53
|
+
}
|
54
|
+
|
55
|
+
def to_sexp {
|
56
|
+
"Not implemented yet!" raise!
|
57
|
+
}
|
58
|
+
|
59
|
+
def raise! {
|
60
|
+
"Raises a new StdError with self as the message."
|
61
|
+
StdError new: self . raise!
|
62
|
+
}
|
63
|
+
}
|
data/lib/rbx/symbol.fy
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
class Symbol {
|
2
|
+
def eval {
|
3
|
+
binding = Binding setup(Rubinius VariableScope of_sender(),
|
4
|
+
Rubinius CompiledMethod of_sender(),
|
5
|
+
Rubinius StaticScope of_sender())
|
6
|
+
Fancy eval: (self to_s) binding: binding
|
7
|
+
}
|
8
|
+
|
9
|
+
def inspect {
|
10
|
+
"'" ++ (inspect() from: 1 to: -1)
|
11
|
+
}
|
12
|
+
}
|
data/lib/rbx/system.fy
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
class System {
|
2
|
+
def System exit {
|
3
|
+
"Exit the running Fancy process."
|
4
|
+
|
5
|
+
Kernel exit()
|
6
|
+
}
|
7
|
+
|
8
|
+
def System do: command_str {
|
9
|
+
"Runs the given string as a system() command."
|
10
|
+
|
11
|
+
Kernel system(command_str)
|
12
|
+
}
|
13
|
+
|
14
|
+
def System piperead: command_str {
|
15
|
+
"""
|
16
|
+
Runs the given string as a popen() call and returns the output
|
17
|
+
of the call as a string.
|
18
|
+
"""
|
19
|
+
|
20
|
+
pipe: command_str . readlines map: 'chomp
|
21
|
+
}
|
22
|
+
|
23
|
+
def System pipe: command_str {
|
24
|
+
"""
|
25
|
+
Runs the given string as a popen() call and returns a IO handle
|
26
|
+
that can be read from
|
27
|
+
"""
|
28
|
+
|
29
|
+
IO popen(command_str)
|
30
|
+
}
|
31
|
+
|
32
|
+
def System sleep: n_ms {
|
33
|
+
"Sets the Fancy process for a given amount of milliseconds to sleep."
|
34
|
+
|
35
|
+
Kernel sleep(n_ms / 1000)
|
36
|
+
}
|
37
|
+
}
|
data/lib/rbx/thread.fy
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
require("thread")
|
2
|
+
|
3
|
+
class Thread {
|
4
|
+
"""
|
5
|
+
Thread class.
|
6
|
+
Deals with parallel execution.
|
7
|
+
|
8
|
+
TODO:
|
9
|
+
=> Still need to add more Fancy-ish wrapper methods and method
|
10
|
+
documentation.
|
11
|
+
"""
|
12
|
+
|
13
|
+
ruby_alias: 'abort_on_exception
|
14
|
+
ruby_alias: 'join
|
15
|
+
ruby_alias: 'run
|
16
|
+
ruby_alias: 'alive?
|
17
|
+
ruby_alias: 'exit
|
18
|
+
ruby_alias: 'exit!
|
19
|
+
ruby_alias: 'kill
|
20
|
+
# ruby_alias: 'kill!
|
21
|
+
ruby_alias: 'terminate
|
22
|
+
# ruby_alias: 'terminate!
|
23
|
+
ruby_alias: 'priority
|
24
|
+
# ruby_alias: 'safe_level
|
25
|
+
ruby_alias: 'status
|
26
|
+
ruby_alias: 'stop?
|
27
|
+
ruby_alias: 'value
|
28
|
+
ruby_alias: 'wakeup
|
29
|
+
|
30
|
+
Thread metaclass ruby_alias: 'abort_on_exception
|
31
|
+
Thread metaclass ruby_alias: 'current
|
32
|
+
Thread metaclass ruby_alias: 'critical
|
33
|
+
Thread metaclass ruby_alias: 'exit
|
34
|
+
Thread metaclass ruby_alias: 'list
|
35
|
+
Thread metaclass ruby_alias: 'main
|
36
|
+
Thread metaclass ruby_alias: 'pass
|
37
|
+
Thread metaclass ruby_alias: 'stop
|
38
|
+
|
39
|
+
def priority: new_prio {
|
40
|
+
priority=(new_prio)
|
41
|
+
}
|
42
|
+
|
43
|
+
def raise: exception {
|
44
|
+
raise(exception)
|
45
|
+
}
|
46
|
+
|
47
|
+
def exclusive: block {
|
48
|
+
exclusive(&block)
|
49
|
+
}
|
50
|
+
|
51
|
+
def Thread new: block {
|
52
|
+
new(&block)
|
53
|
+
}
|
54
|
+
|
55
|
+
def Thread abort_on_exception: abort_on_exception {
|
56
|
+
abort_on_exception=(abort_on_exception)
|
57
|
+
}
|
58
|
+
|
59
|
+
def abort_on_exception: abort_on_exception {
|
60
|
+
abort_on_exception=(abort_on_exception)
|
61
|
+
}
|
62
|
+
|
63
|
+
def Thread critical: critical {
|
64
|
+
critical=(critical)
|
65
|
+
}
|
66
|
+
|
67
|
+
def Thread kill: thread {
|
68
|
+
kill(thread)
|
69
|
+
}
|
70
|
+
|
71
|
+
def Thread start: block {
|
72
|
+
start(&block)
|
73
|
+
}
|
74
|
+
|
75
|
+
}
|