Mercurial > repos > rhope
diff nworker.rhope @ 40:789a146a48e1
Started adding support for naked values in user defined objects
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 09 Oct 2009 01:01:26 -0400 |
parents | 640f541e9116 |
children | aabda74c7a88 |
line wrap: on
line diff
--- a/nworker.rhope Thu Oct 08 00:37:24 2009 -0400 +++ b/nworker.rhope Fri Oct 09 01:01:26 2009 -0400 @@ -766,28 +766,46 @@ Make Init[func,field:out] { name <- [field]Index[0] - out <- [func]Set Field Null["obj", name] + variant <- [[field]Index[1]]Variant >> + If[[variant] = ["Boxed"]] + { + out <- [func]Set Field Null["obj", name] + }{ + out <- func + } } Make Copy[func,field:out] { name <- [field]Index[0] - got <- [func]Read Field["obj", name] {} - { - stream <- [[got]Instruction Stream - ]AddRef No Dest[~] - out <- [got]Do If[~, stream] + variant <- [[field]Index[1]]Variant >> + If[[variant] = ["Boxed"]] + { + got <- [func]Read Field["obj", name] {} + { + stream <- [[got]Instruction Stream + ]AddRef No Dest[~] + out <- [got]Do If[~, stream] + } + }{ + out <- func } } Make Cleanup[func,field:out] { name <- [field]Index[0] - got <- [func]Read Field["obj", name] {} - { - stream <- [[got]Instruction Stream - ]Release[~] - out <- [got]Do If[~, stream] + variant <- [[field]Index[1]]Variant >> + If[[variant] = ["Boxed"]] + { + got <- [func]Read Field["obj", name] {} + { + stream <- [[got]Instruction Stream + ]Release[~] + out <- [got]Do If[~, stream] + } + }{ + out <- func } }