Skip to content

Instantly share code, notes, and snippets.

@AbePralle
Created June 12, 2020 01:53
Show Gist options
  • Select an option

  • Save AbePralle/50de14ba078d894c9ebeba22fca60a71 to your computer and use it in GitHub Desktop.

Select an option

Save AbePralle/50de14ba078d894c9ebeba22fca60a71 to your computer and use it in GitHub Desktop.
Unpack Rogue Class
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