fancy 0.6.0 → 0.7.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/LICENSE +1 -1
- data/README.md +4 -1
- data/Rakefile +0 -52
- data/bin/fspec +22 -12
- data/bin/ifancy +1 -1
- data/boot/fancy_ext/class.rb +1 -0
- data/boot/fancy_ext/object.rb +8 -6
- data/boot/rbx-compiler/compiler/ast/method_def.rb +2 -0
- data/boot/rbx-compiler/parser/fancy_parser.bundle +0 -0
- data/boot/rbx-compiler/parser/parser.y +9 -0
- data/doc/api/fancy.jsonp +1 -1
- data/examples/stupid_quicksort.fy +11 -9
- data/lib/array.fy +26 -58
- data/lib/block.fy +0 -1
- data/lib/boot.fy +2 -2
- data/lib/class.fy +85 -0
- data/lib/compiler/ast/class_def.fy +1 -1
- data/lib/compiler/ast/expression_list.fy +4 -12
- data/lib/compiler/ast/identifier.fy +3 -3
- data/lib/compiler/ast/method_def.fy +3 -1
- data/lib/compiler/ast/singleton_method_def.fy +4 -1
- data/lib/contracts.fy +53 -56
- data/lib/dynamic_slot_object.fy +39 -3
- data/lib/enumerable.fy +144 -47
- data/lib/fancy_spec.fy +2 -6
- data/lib/file.fy +67 -0
- data/lib/future.fy +42 -3
- data/lib/hash.fy +35 -29
- data/lib/html.fy +1 -1
- data/lib/integer.fy +34 -0
- data/lib/main.fy +13 -7
- data/lib/message_sink.fy +1 -1
- data/lib/number.fy +10 -0
- data/lib/object.fy +27 -1
- data/lib/package.fy +2 -0
- data/lib/package/handler.fy +56 -0
- data/lib/package/installer.fy +21 -51
- data/lib/package/specification.fy +12 -5
- data/lib/package/uninstaller.fy +22 -3
- data/lib/parser/ext/parser.y +9 -0
- data/lib/proxy.fy +25 -2
- data/lib/rbx.fy +2 -1
- data/lib/rbx/array.fy +16 -1
- data/lib/rbx/class.fy +34 -9
- data/lib/rbx/file.fy +2 -2
- data/lib/rbx/fixnum.fy +1 -11
- data/lib/rbx/io.fy +4 -0
- data/lib/rbx/module.fy +11 -0
- data/lib/rbx/object.fy +12 -12
- data/lib/rbx/proc.fy +7 -0
- data/lib/rbx/string.fy +5 -1
- data/lib/rbx/symbol.fy +9 -0
- data/lib/string.fy +1 -1
- data/lib/tuple.fy +37 -35
- data/lib/version.fy +6 -5
- data/tests/array.fy +14 -2
- data/tests/class.fy +79 -0
- data/tests/dynamic_key_hash.fy +16 -0
- data/tests/dynamic_slot_object.fy +28 -0
- data/tests/dynamic_value_array.fy +12 -0
- data/tests/enumerable.fy +46 -0
- data/tests/file.fy +38 -0
- data/tests/fixnum.fy +22 -0
- data/tests/future.fy +40 -0
- data/tests/hash.fy +8 -7
- data/tests/object.fy +31 -5
- data/tests/set.fy +1 -1
- data/tests/string.fy +18 -2
- data/tests/tuple.fy +7 -0
- data/tools/fancy-mode.el +10 -0
- metadata +9 -12
- data/examples/99bottles.fy +0 -5
- data/examples/conditions_exceptions.fy +0 -9
- data/examples/conditions_parsing.fy +0 -68
- data/examples/dynamic.fy +0 -8
- data/examples/greeter.fy +0 -9
- data/examples/parsing.fy +0 -1
- data/lib/rbx/process.fy +0 -13
- data/lib/remote_object.fy +0 -59
data/examples/dynamic.fy
DELETED
data/examples/greeter.fy
DELETED
data/examples/parsing.fy
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require: "parsing"
|
data/lib/rbx/process.fy
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
RbxProcess = Process
|
2
|
-
|
3
|
-
class send('remove_const, 'Process)
|
4
|
-
|
5
|
-
class Process {
|
6
|
-
include: RbxProcess
|
7
|
-
metaclass include: (RbxProcess metaclass)
|
8
|
-
forwards_unary_ruby_methods
|
9
|
-
metaclass forwards_unary_ruby_methods
|
10
|
-
}
|
11
|
-
|
12
|
-
Process pid println
|
13
|
-
Process instance_methods sort println
|
data/lib/remote_object.fy
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
require: "fyzmq"
|
2
|
-
|
3
|
-
class RemoteObject : BasicObject {
|
4
|
-
def initialize {
|
5
|
-
@context = ZMQ Context new
|
6
|
-
@sock = @context socket: ZMQ PAIR
|
7
|
-
Thread new: { self receive_remote }
|
8
|
-
}
|
9
|
-
|
10
|
-
def bind: port {
|
11
|
-
bind_addr = "ipc://127.0.0.1:#{port}"
|
12
|
-
"Binding #{self} to #{bind_addr}" println
|
13
|
-
@sock bind: bind_addr
|
14
|
-
}
|
15
|
-
|
16
|
-
def connect_port: port {
|
17
|
-
connect: "ipc://127.0.0.1:#{port}"
|
18
|
-
}
|
19
|
-
|
20
|
-
def connect: addr {
|
21
|
-
@sock connect: addr
|
22
|
-
"Connected #{self} to #{addr}" println
|
23
|
-
}
|
24
|
-
|
25
|
-
def receive_remote {
|
26
|
-
loop: {
|
27
|
-
"waiting" println
|
28
|
-
msg = @sock recv
|
29
|
-
"Got: #{msg inspect}" println
|
30
|
-
}
|
31
|
-
}
|
32
|
-
|
33
|
-
def send_async: message with_params: p {
|
34
|
-
"sending" println
|
35
|
-
@sock send: "foo" # ('send, message, p inspect)
|
36
|
-
}
|
37
|
-
|
38
|
-
def to_s {
|
39
|
-
"#<RemoteObject:#{object_id to_s: 16}>"
|
40
|
-
}
|
41
|
-
|
42
|
-
def inspect {
|
43
|
-
to_s
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
r = RemoteObject new
|
48
|
-
|
49
|
-
if: (ARGV includes?: "bind") then: {
|
50
|
-
r bind: 3001
|
51
|
-
} else: {
|
52
|
-
r connect_port: 3001
|
53
|
-
}
|
54
|
-
|
55
|
-
Thread sleep: 2
|
56
|
-
|
57
|
-
r send_async: 'to_s: with_params: 16
|
58
|
-
|
59
|
-
Thread sleep: 2
|