Skip to content

Commit 2cccb7f

Browse files
committed
Stub out Fixnum with support for assigning a raw integer
1 parent df6ae1a commit 2cccb7f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/core/fixnum.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11

22
class Fixnum < Integer
33

4+
def initialize
5+
%s(assign @value 0)
6+
end
7+
8+
def __set_raw(value)
9+
@value = value
10+
end
11+
12+
def __get_raw
13+
@value
14+
end
15+
416
def + other
517

618
end
@@ -47,3 +59,10 @@ def / other
4759
end
4860

4961
end
62+
63+
64+
%s(defun __get_fixnum (val) (let (num)
65+
(assign num (callm Fixnum new))
66+
(callm num __set_raw (val))
67+
num
68+
))

0 commit comments

Comments
 (0)