rename meta to singleton class

seems more appropriate, as it is the class for a single object
Also seems to be called that on the net (don't remember where the meta came from, but it's gone)
This commit is contained in:
2019-09-23 20:57:33 +03:00
parent 6993e337bf
commit d901c6f27c
12 changed files with 33 additions and 33 deletions

View File

@ -37,7 +37,7 @@ module Vool
when MethodExpression
node.to_mom(@clazz)
when ClassMethodExpression
node.to_mom(@clazz.meta_class)
node.to_mom(@clazz.singleton_class)
else
raise "Only methods for now #{node.class}:#{node}"
end
@ -62,7 +62,7 @@ module Vool
end
# goes through the code looking for instance variables (and their assignments)
# adding each to the respective type, ie class or meta_class, depending
# adding each to the respective type, ie class or singleton_class, depending
# on if they are instance or class instance variables.
#
# Class variables are deemed a design mistake, ie not implemented (yet)
@ -72,7 +72,7 @@ module Vool
when MethodExpression
target = @clazz
when ClassMethodExpression
target = @clazz.meta_class
target = @clazz.singleton_class
else
raise "Only methods for now #{node.class}:#{node}"
end

View File

@ -8,7 +8,7 @@ module Vool
end
def to_mom(clazz)
raise "not meta" unless clazz.class == Parfait::MetaClass
raise "not singleton" unless clazz.class == Parfait::SingletonClass
raise( "no class in #{self}") unless clazz
method = clazz.add_instance_method_for(name , make_arg_type , make_frame , body )
#puts "CLass method Class:#{clazz}:#{name}"

View File

@ -49,7 +49,7 @@ module Vool
class ModuleName < Expression
include Named
def ct_type
get_named_class.meta_class.instance_type
get_named_class.singleton_class.instance_type
end
def to_slot(_)
return Mom::SlotDefinition.new( get_named_class, [])