use cattr instead of metaclass
so we can catch it in the compiler, like also attr define cattr in adapter, no change in tests !
This commit is contained in:
@ -54,6 +54,14 @@ module Parfait
|
||||
@memory._set(index , value)
|
||||
end
|
||||
end
|
||||
|
||||
def self.cattr( *names )
|
||||
names.each do |ca|
|
||||
class_eval "@@#{ca} = 0"
|
||||
class_eval "def self.#{ca}; return @#{ca};end"
|
||||
class_eval "def self.#{ca}=(val); @#{ca} = val;end"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# new list from ruby array to be precise
|
||||
|
Reference in New Issue
Block a user