Unikitty scheme
Port of base16-unikitty scheme to Komodo.
# Fruit salad recipe
# Let's build a fruit-salad maker
# This snippet just shows various parts of Ruby speech.
module Salad
class Fruit
@@class_var = 0
attr :symbol
def initialize(fruit_list, counts)
@instance_var = {}
fruit_list.zip(counts).each { |a, b| @instance_var[a] = b } # block code
end
def mix()
print "double-quoted string"
print 'single-quoted string'
print `command`
print %Q(Q string)
print %q(q string)
print %r(reg ex)
print %x(backquoted string)
regex = /pattern/isx
@@class_var += 1
end
end
end
fruit_list = %w(guava rambutan longan mangosteen)
counts = [3, 4, 1, 5]
fruits = Salad::Fruit.new(fruit_list, counts)
print <<abc
here document
abc
=begin
rubydoc
block comment
=end
__END__
end section