Skip to content

Instantly share code, notes, and snippets.

@rectalogic
Created September 25, 2024 15:33
Show Gist options
  • Save rectalogic/24a59b720090a324d14317135ab79d00 to your computer and use it in GitHub Desktop.
Save rectalogic/24a59b720090a324d14317135ab79d00 to your computer and use it in GitHub Desktop.
struct Value(Formattable):
var value: Float64
fn __init__(inout self, value: Float64):
self.value = value
fn format_to(self, inout writer: Formatter):
writer.write("Value(", self.value, ")")
def main():
v = Value(33)
t = Tuple(Reference(v), Reference(Value(99)), Reference(Value(66)))
print(t[1][])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment