fOOrth 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -9
- data/fOOrth.gemspec +1 -1
- data/images/fOOrth_logo.png +0 -0
- data/lib/fOOrth/compiler/process/procedure.rb +1 -1
- data/lib/fOOrth/core.rb +1 -1
- data/lib/fOOrth/core/object.rb +0 -4
- data/lib/fOOrth/library/thread_library.rb +5 -0
- data/lib/fOOrth/version.rb +1 -1
- data/rakefile.rb +2 -0
- data/tests/core_tests.rb +7 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 017935fd5de0aa99dd253192f27aa7b8eed5c44d
|
4
|
+
data.tar.gz: bd17a2cc1e29f0a6580d65352a0c777fa3061b8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29b76d8377052fefcbb828d7d8b3064047d5cff2bc42c26393f422d155473988ccac810920abda799ff36ef55ac9c530e6847c946299a4a2389960bc6d875ed4
|
7
|
+
data.tar.gz: 693816d9ee22cc7743bdef76835d5eb072a014bd85edbdbd2f50f01123b3603a8c70670574b452a771aa37fcc48fb3c17d9c750085421890e6f1ffeb5a6b0eb6
|
data/README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
workings of Ruby and meta programming.
|
1
|
+
![fOOrth Project Logo](images/fOOrth_logo.png)
|
2
|
+
|
3
|
+
The fOOrth language is an experimental variant of FORTH that attempts to
|
4
|
+
incorporate object oriented and functional programming concepts. It also
|
5
|
+
tries to extrapolate an alternate reality where FORTH was not frozen in the
|
6
|
+
past, but continued to grow and develop with the times. Above all this project
|
7
|
+
is the result of nearly 30 years of thought on the design of threaded
|
8
|
+
compilers and languages with simplified grammars and syntax.
|
10
9
|
|
11
10
|
## Usage
|
12
11
|
Adding fOOrth can be as simple as:
|
data/fOOrth.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = XfOOrth::VERSION
|
9
9
|
spec.authors = ["Peter Camilleri"]
|
10
10
|
spec.email = "peter.c.camilleri@gmail.com"
|
11
|
-
spec.homepage = "http://
|
11
|
+
spec.homepage = "http://www.foorth.org/"
|
12
12
|
spec.description = "An Object Oriented FORTHesque language gem."
|
13
13
|
spec.summary = "FNF == fOOrth is Not FORTH."
|
14
14
|
spec.license = 'MIT'
|
Binary file
|
data/lib/fOOrth/core.rb
CHANGED
@@ -16,7 +16,7 @@ module XfOOrth
|
|
16
16
|
#Predefine the default implementation of the .init method. This method must
|
17
17
|
#exist at this point in order to proceed further.
|
18
18
|
name = '.init'
|
19
|
-
|
19
|
+
SymbolMap.add_entry(name, :foorth_init)
|
20
20
|
Object.create_shared_method(name, TosSpec, [], &lambda {|vm| })
|
21
21
|
|
22
22
|
#Create a virtual machine instance for the main thread. The constructor
|
data/lib/fOOrth/core/object.rb
CHANGED
@@ -50,10 +50,6 @@ class Object
|
|
50
50
|
self.class.map_foorth_shared(symbol)
|
51
51
|
end
|
52
52
|
|
53
|
-
#The default foorth_init method does nothing.
|
54
|
-
def foorth_init(_vm)
|
55
|
-
end
|
56
|
-
|
57
53
|
#The \method_missing hook is used to provide meaningful error messages
|
58
54
|
#when problems are encountered.
|
59
55
|
#<br>Parameters:
|
@@ -47,6 +47,11 @@ module XfOOrth
|
|
47
47
|
sleep(Float.foorth_coerce(self))
|
48
48
|
})
|
49
49
|
|
50
|
+
#Put the current thread to sleep for the specified number of seconds.
|
51
|
+
Float.create_shared_method('.sleep', TosSpec, [], &lambda {|vm|
|
52
|
+
sleep(self)
|
53
|
+
})
|
54
|
+
|
50
55
|
#Wait for a thread to finish.
|
51
56
|
#[a_thread] .join []
|
52
57
|
Thread.create_shared_method('.join', TosSpec, [], &lambda {|vm|
|
data/lib/fOOrth/version.rb
CHANGED
data/rakefile.rb
CHANGED
@@ -27,12 +27,14 @@ Rake::TestTask.new do |t|
|
|
27
27
|
#List out all the test files.
|
28
28
|
t.test_files = FileList['tests/**/*.rb']
|
29
29
|
t.verbose = false
|
30
|
+
#t.warning = false
|
30
31
|
end
|
31
32
|
|
32
33
|
#Run the fOOrth integration test suite.
|
33
34
|
Rake::TestTask.new(:integration) do |t|
|
34
35
|
#List out all the test files.
|
35
36
|
t.test_files = FileList['integration/*.rb']
|
37
|
+
t.warning = false
|
36
38
|
end
|
37
39
|
|
38
40
|
desc "Run a scan for smelly code!"
|
data/tests/core_tests.rb
CHANGED
@@ -36,7 +36,7 @@ class CoreTester < Minitest::Test
|
|
36
36
|
|
37
37
|
XfOOrth::SymbolMap.add_entry("a_test_one", :a_test_one)
|
38
38
|
|
39
|
-
spec = Object.create_shared_method("a_test_one", XfOOrth::TosSpec, []) {|
|
39
|
+
spec = Object.create_shared_method("a_test_one", XfOOrth::TosSpec, []) {|lvm| lvm.push(9671111) }
|
40
40
|
|
41
41
|
obj.a_test_one(vm)
|
42
42
|
|
@@ -56,8 +56,8 @@ class CoreTester < Minitest::Test
|
|
56
56
|
|
57
57
|
XfOOrth::SymbolMap.add_entry("a_test_two", :a_test_two)
|
58
58
|
|
59
|
-
spec = obj.create_exclusive_method("a_test_two", XfOOrth::TosSpec, []) do |
|
60
|
-
|
59
|
+
spec = obj.create_exclusive_method("a_test_two", XfOOrth::TosSpec, []) do |lvm|
|
60
|
+
lvm.push(9686668)
|
61
61
|
end
|
62
62
|
|
63
63
|
obj.a_test_two(vm)
|
@@ -108,11 +108,11 @@ class CoreTester < Minitest::Test
|
|
108
108
|
assert_equal(XfOOrth::XfOOrth_MyClass, $FOORTH_GLOBALS[symbol].new_class)
|
109
109
|
|
110
110
|
assert_raises(XfOOrth::XfOOrthError) do
|
111
|
-
|
111
|
+
Object.create_foorth_subclass('No Class')
|
112
112
|
end
|
113
113
|
|
114
114
|
assert_raises(XfOOrth::XfOOrthError) do
|
115
|
-
|
115
|
+
Object.create_foorth_subclass('MyClass')
|
116
116
|
end
|
117
117
|
end
|
118
118
|
|
@@ -126,11 +126,11 @@ class CoreTester < Minitest::Test
|
|
126
126
|
assert_equal(String, $FOORTH_GLOBALS[symbol].new_class)
|
127
127
|
|
128
128
|
assert_raises(XfOOrth::XfOOrthError) do
|
129
|
-
|
129
|
+
Object.create_foorth_subclass('My Class')
|
130
130
|
end
|
131
131
|
|
132
132
|
assert_raises(XfOOrth::XfOOrthError) do
|
133
|
-
|
133
|
+
Module.create_foorth_proxy('Mod ule')
|
134
134
|
end
|
135
135
|
|
136
136
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fOOrth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- demo.rb
|
194
194
|
- fOOrth.gemspec
|
195
195
|
- fOOrth.reek
|
196
|
+
- images/fOOrth_logo.png
|
196
197
|
- integration/README.md
|
197
198
|
- integration/_FILE_test.foorth
|
198
199
|
- integration/array_lib_tests.rb
|
@@ -338,7 +339,7 @@ files:
|
|
338
339
|
- tests/monkey_patch/rational_test.rb
|
339
340
|
- tests/monkey_patch/string_test.rb
|
340
341
|
- tests/symbol_map_tests.rb
|
341
|
-
homepage: http://
|
342
|
+
homepage: http://www.foorth.org/
|
342
343
|
licenses:
|
343
344
|
- MIT
|
344
345
|
metadata: {}
|