Skip to content

Instantly share code, notes, and snippets.

@ReneSac
Forked from dom96/gist:959f27018ea3247a4498
Last active August 29, 2015 13:56
Show Gist options
  • Save ReneSac/02076a8ed3cfc4d559c3 to your computer and use it in GitHub Desktop.
Save ReneSac/02076a8ed3cfc4d559c3 to your computer and use it in GitHub Desktop.
let # let
x = 5 # x equal 5
type # type
Foo = int # `Foo` equals `int`
Bar = object # `Bar` equals object
field: Foo # With field `field` of type `Foo`
proc foo: int = 5 # procedure `foo` of type `int` equals 5
var x: int = 2 # variable `x` of type `int` equals 2
proc bar: int =
10 # procedure `bar` of type `int` equals 10
var y: int =
4 # variable `y` of type `int` equals 4
proc boo: int = ( # what is already possible, if you respect indentation rules
let a = 3; # but you can't nest (;), so it is not very useful for that.
echo a;
return a
)
echo boo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment