/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/ruby/functor/runme.rb
16 строк
342 B
Dave Beazley
The great merge
01 дек 2002, 01:01
01 дек 2002, 01:01
12a43ed
Код
Авторство
О чём код?
# Operator overloading example require 'example' a = Example::IntSum.new(0) b = Example::DoubleSum.new(100.0) # Use the objects. They should be callable just like a normal # Ruby function. (0..100).each do |i| a.call(i) # note: function call b.call(Math.sqrt(i)) # note: function call end puts a.result puts b.result