Created
June 12, 2020 01:53
-
-
Save AbePralle/50de14ba078d894c9ebeba22fca60a71 to your computer and use it in GitHub Desktop.
Unpack Rogue Class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Point(x:Int32,y:Int32) [compound] | |
| METHODS | |
| method to->String | |
| return "($,$)"(x,y) | |
| endClass | |
| $essential Boxed<<Point>> | |
| class Alpha | |
| PROPERTIES | |
| name : String | |
| value : Int32 | |
| beta : Beta | |
| position : Point | |
| METHODS | |
| method to->String | |
| return "Alpha($,$,$,$)"(name,value,beta,position) | |
| endClass | |
| class Beta | |
| PROPERTIES | |
| list : Int32[] | |
| table : StringTable<<Int32>> | |
| METHODS | |
| method to->String | |
| return "Beta($,$)" (list,table) | |
| endClass | |
| local alpha = Alpha().[ unpack( | |
| @{ | |
| name:"a", | |
| value:5, | |
| beta:{ list:[1,2,3], table:{"four":4} }, | |
| position:{x:6,y:7} | |
| } | |
| ) ] | |
| @trace alpha | |
| # alpha:Alpha(a,5,Beta([1,2,3],{four:4}),(6,7)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment