[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dennou-ruby:000236] Re: NumArray prototype in ruby
���Ȥ���Ǥ�
In message "[dennou-ruby:000233] Re: NumArray prototype in ruby"
on 00/02/07, Takeshi Horinouchi <horinout@xxxxxx> writes:
>% ruby numarray.rb
>
>�Ȥ��������ޤ���������������ʤ�˿��ڤʥץ���ʸ��Ĥ��Ƥޤ���
>�¹Է�̤�Ĺ���Ǥ��Τǡ�less �ˤǤ��������Dz�������
���Τ���Υ桼�ƥ���ƥ��Ȥ��� xmp �Ȥ����Τ�����ޤ���
RAA �� devel ���������ˤ����Ǥ���������ޤ���
http://www.ruby-lang.org/en/raa.html
-- gotoken
# ���Τ�û���ΤǤĤ��Ȥ��ޤ�
module Kernel
XMP_VERSION = "2000-01-03"
def xmp(arg, show = true) # prints expample code and result line by line
if show
__res__ = []
eval arg.gsub(/^(.*)\n?/){ "__res__ << (#{$1}).inspect;" }
arg.split(/\n/).each_with_index{|l,i|
(puts "\n" ; next) if l =~ /^$/
print "#{l}\n #=> #{__res__[i]}\n"
}
else
print arg; eval arg
end
end
alias __xmp__ xmp
end