>>>>> "n" == neleai <neleai@seznam.cz> writes:
n> Isnt. I mean use like def tt(a,b=sin(a))
Try this
moulon% ruby -e 'include Math; def x(a, b = sin(a)) p a, b; end; x(12)'
12
-0.536572918000435
moulon%
or
moulon% cat b.rb
#!/usr/bin/ruby
class A
attr_reader :x, :y
def initialize(x, y)
@x, @y = x, y
end
end
def x(a, b = a.x, c = a.y)
p a, b, c
end
x(A.new(12,24))
moulon%
moulon% ./b.rb
#<A:0xb7d559b4 @y=24, @x=12>
12
24
moulon%
--
Guy Decoux