basic immutability for type

add_instance_variable now uses global type list to check
adds hash and to_has functions
use backdoor (send) for booting
This commit is contained in:
Torsten Ruger
2016-12-08 12:50:25 +02:00
parent 137d3c9231
commit a31f75fe93
5 changed files with 108 additions and 19 deletions

View File

@ -93,8 +93,8 @@ module Register
# helper to create a Type, name is the parfait name, ie :Type
def type_for( name , ivars )
l = Parfait::Type.allocate.compile_time_init
l.add_instance_variable :type , name
ivars.each {|n,t| l.add_instance_variable( n , t) }
l.send(:private_add_instance_variable , :type , name)
ivars.each {|n,t| l.send(:private_add_instance_variable, n , t) }
l
end