# HG changeset patch # User Mike Pavone # Date 1255656763 14400 # Node ID 709df3e82bb4672af79618eb1f937c325c699845 # Parent aabda74c7a880f330aa885d8f4387abdfd1399b4 Added methods to support type inference diff -r aabda74c7a88 -r 709df3e82bb4 nworker.rhope --- a/nworker.rhope Tue Oct 13 00:07:34 2009 -0400 +++ b/nworker.rhope Thu Oct 15 21:32:43 2009 -0400 @@ -751,6 +751,18 @@ out <- [bp]Methods <<[ [[bp]Methods >>]Set[name, Yes] ] } +Understands Method@NBlueprint[bp,name:out] +{ + out <- [[bp]Methods >>]Index[name] {} + { out <- No } +} + +Get Field Type@NBlueprint[bp,name:out,notfound] +{ + ,notfound <- [[bp]Fields >>]Index[name] + { out <- [~]Index[1] } +} + _Compile Blueprint Fields[type,field:out] { name <- [field]Index[0] @@ -983,3 +995,17 @@ out,notfound <- [[prog]Worker Refs >>]Index[name] } +Find Method@NProgram[prog, name, type:out,notfound] +{ + bp,notfound <- [[prog]Blueprints >>]Index[[type]Name >>] + ,notfound <- If[[bp]Understands Method[name]] + { + out <- [[prog]Workers >>]Index[[[name]Append["@"]]Append[[type]Name >>]] + } +} + +Find Field@NProgram[prog, name, type:fieldtype,notfound] +{ + bp,notfound <- [[prog]Blueprints >>]Index[[type]Name >>] + fieldtype,notfound <- [bp]Get Field Type[name] +}