Skip to content

Instantly share code, notes, and snippets.

@ravinggenius
Last active August 29, 2015 14:01
Show Gist options
  • Save ravinggenius/75af019d62c8dc80a703 to your computer and use it in GitHub Desktop.
Save ravinggenius/75af019d62c8dc80a703 to your computer and use it in GitHub Desktop.
# comment
_true = true
_false = false
integer = 42
rational = 3.14
rational = 2 / 3
complex = integer + decimal.i
date = 1980-10-16
time = 13:59:00
datetime = 1980-10-16T13:59:00
pair = key : value
range = 1..5
list = []
map = {}
character = `c
regular_expression = /abc/
string_symbol = :rip
string_single = 'foo'
string_double = "b#{a}r"
string_heredoc = <<-RIP
hello, world!
RIP
Person = type {
@.initialize = -> (name) { @.name = name }
find = -> (id) { }
}
People = type (System.List<Person>) {
all = => {
-> { new([]) }
-> (filter) {
new([].where(filter))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment