package tinyvm sealed class Node(type: String) : Object(type) class Tree(val nodes: Map) : Node("tree") { // For simplicity just use the hex-formatted hash, not the actual value like git does. override val data: String get() = nodes.map { (name, node) -> "${node.type} $name\u0000${node.hash()}" }.sorted().joinToString() } class Blob(override val data: String) : Node("blob")