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.
Files changed (79) hide show
  1. data/LICENSE +1 -1
  2. data/README.md +4 -1
  3. data/Rakefile +0 -52
  4. data/bin/fspec +22 -12
  5. data/bin/ifancy +1 -1
  6. data/boot/fancy_ext/class.rb +1 -0
  7. data/boot/fancy_ext/object.rb +8 -6
  8. data/boot/rbx-compiler/compiler/ast/method_def.rb +2 -0
  9. data/boot/rbx-compiler/parser/fancy_parser.bundle +0 -0
  10. data/boot/rbx-compiler/parser/parser.y +9 -0
  11. data/doc/api/fancy.jsonp +1 -1
  12. data/examples/stupid_quicksort.fy +11 -9
  13. data/lib/array.fy +26 -58
  14. data/lib/block.fy +0 -1
  15. data/lib/boot.fy +2 -2
  16. data/lib/class.fy +85 -0
  17. data/lib/compiler/ast/class_def.fy +1 -1
  18. data/lib/compiler/ast/expression_list.fy +4 -12
  19. data/lib/compiler/ast/identifier.fy +3 -3
  20. data/lib/compiler/ast/method_def.fy +3 -1
  21. data/lib/compiler/ast/singleton_method_def.fy +4 -1
  22. data/lib/contracts.fy +53 -56
  23. data/lib/dynamic_slot_object.fy +39 -3
  24. data/lib/enumerable.fy +144 -47
  25. data/lib/fancy_spec.fy +2 -6
  26. data/lib/file.fy +67 -0
  27. data/lib/future.fy +42 -3
  28. data/lib/hash.fy +35 -29
  29. data/lib/html.fy +1 -1
  30. data/lib/integer.fy +34 -0
  31. data/lib/main.fy +13 -7
  32. data/lib/message_sink.fy +1 -1
  33. data/lib/number.fy +10 -0
  34. data/lib/object.fy +27 -1
  35. data/lib/package.fy +2 -0
  36. data/lib/package/handler.fy +56 -0
  37. data/lib/package/installer.fy +21 -51
  38. data/lib/package/specification.fy +12 -5
  39. data/lib/package/uninstaller.fy +22 -3
  40. data/lib/parser/ext/parser.y +9 -0
  41. data/lib/proxy.fy +25 -2
  42. data/lib/rbx.fy +2 -1
  43. data/lib/rbx/array.fy +16 -1
  44. data/lib/rbx/class.fy +34 -9
  45. data/lib/rbx/file.fy +2 -2
  46. data/lib/rbx/fixnum.fy +1 -11
  47. data/lib/rbx/io.fy +4 -0
  48. data/lib/rbx/module.fy +11 -0
  49. data/lib/rbx/object.fy +12 -12
  50. data/lib/rbx/proc.fy +7 -0
  51. data/lib/rbx/string.fy +5 -1
  52. data/lib/rbx/symbol.fy +9 -0
  53. data/lib/string.fy +1 -1
  54. data/lib/tuple.fy +37 -35
  55. data/lib/version.fy +6 -5
  56. data/tests/array.fy +14 -2
  57. data/tests/class.fy +79 -0
  58. data/tests/dynamic_key_hash.fy +16 -0
  59. data/tests/dynamic_slot_object.fy +28 -0
  60. data/tests/dynamic_value_array.fy +12 -0
  61. data/tests/enumerable.fy +46 -0
  62. data/tests/file.fy +38 -0
  63. data/tests/fixnum.fy +22 -0
  64. data/tests/future.fy +40 -0
  65. data/tests/hash.fy +8 -7
  66. data/tests/object.fy +31 -5
  67. data/tests/set.fy +1 -1
  68. data/tests/string.fy +18 -2
  69. data/tests/tuple.fy +7 -0
  70. data/tools/fancy-mode.el +10 -0
  71. metadata +9 -12
  72. data/examples/99bottles.fy +0 -5
  73. data/examples/conditions_exceptions.fy +0 -9
  74. data/examples/conditions_parsing.fy +0 -68
  75. data/examples/dynamic.fy +0 -8
  76. data/examples/greeter.fy +0 -9
  77. data/examples/parsing.fy +0 -1
  78. data/lib/rbx/process.fy +0 -13
  79. data/lib/remote_object.fy +0 -59
@@ -1,8 +0,0 @@
1
- *foo* = 100
2
- *foo* println
3
- let: '*foo* be: 10
4
- *foo* println
5
- let: '*foo* be: "foobarbaz" in: {
6
- *foo* println
7
- }
8
- *foo* println
@@ -1,9 +0,0 @@
1
- class Greeter {
2
- def initialize: @name
3
- def greet {
4
- "Hello, #{@name}" println
5
- }
6
- }
7
-
8
- g = Greeter new: "World!"
9
- g greet # => "Hello, World!"
@@ -1 +0,0 @@
1
- require: "parsing"
@@ -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
@@ -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