first oo program to compile. But no worries, there is still work left to be done

This commit is contained in:
Torsten Ruger
2014-06-05 18:17:00 +03:00
parent f523d0946d
commit c59f22f11f
13 changed files with 68 additions and 27 deletions

View File

@ -32,17 +32,17 @@ module Boot
return get_function
end
def _set_instance_variable(name , value)
def _set_instance_variable(context , name , value)
raise name
end
def _get_singleton_method(name )
def _get_singleton_method(context , name )
raise name
end
def _add_singleton_method(method)
def _add_singleton_method(context, method)
raise "4"
end
def initialize()
def initialize(context)
raise "4"
end
end

15
lib/boot/string.rb Normal file
View File

@ -0,0 +1,15 @@
module Boot
class String
module ClassMethods
def get context , index = Vm::Integer
get_function = Vm::Function.new(:get , [Vm::Integer, Vm::Integer] , Vm::Integer )
return get_function
end
def set context , index = Vm::Integer , char = Vm::Integer
set_function = Vm::Function.new(:set , [Vm::Integer, Vm::Integer, Vm::Integer] , Vm::Integer )
return set_function
end
end
extend ClassMethods
end
end