Skip to content

Instantly share code, notes, and snippets.

@mwja
Last active February 2, 2017 08:03
Show Gist options
  • Save mwja/f579f6e4bf297fbf218fedf41729f729 to your computer and use it in GitHub Desktop.
Save mwja/f579f6e4bf297fbf218fedf41729f729 to your computer and use it in GitHub Desktop.
A program written in Otter
// Edit a file using private scope
File("text.txt") { | object:file |
file.append("Writing this to file \(file.name)")
}
// Edit a file using global scope
consistent#object:file = File("download.txt")
// Download a file using private scope
Stream(Console.arguments[1]) { | string:stream |
file.append(string)
Console.stdout("Added \(stream.bytes) bytes to download.txt")
}
{
"name": "Example Gist",
"depends": [
"Console",
"Stream",
"File"
],
"version": "0.0.0.1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment