From: dagbrown@... (Dave Brown) Date: 2004-01-14T09:46:35+09:00 Subject: Re: faster integer arithmetics & arbitrary precision floating number In article , GGarramuno wrote: : Just look at irb. Try doing: : : irb> methods(String) : : or similar in it and see the dozen or so methods that should remain : internal to irb exposed to the user. Well, for starters, that doesn't give you the list of methods for the String class. That gives you the methods for "self" which happens to be irb. Of COURSE it gives you the methods for irb. I think what you meant was: irb(main):008:0> String.methods => ["send", "name", "class_eval", "object_id", "autoload?", "new", "singleton_methods", "__send__", "private_method_defined?", "equal?", "taint", "method", "frozen?", "instance_variable_get", "constants", "kind_of?", "to_a", "instance_eval", "ancestors", "const_missing", "type", "instance_methods", "protected_methods", "extend", "protected_method_defined?", "eql?", "public_class_method", "const_get", "instance_variable_set", "hash", "is_a?", "to_s", "class_variables", "class", "tainted?", "private_methods", "public_instance_methods", "untaint", "included_modules", "private_class_method", "const_set", "id", "<", "inspect", "<=>", "==", "autoload", "method_defined?", ">", "===", "clone", "public_methods", "protected_instance_methods", "display", ">=", "respond_to?", "instance_method", "<=", "freeze", "module_eval", "allocate", "__id__", "=~", "methods", "public_method_defined?", "superclass", "nil?", "dup", "private_instance_methods", "instance_variables", "include?", "const_d! efined?", "instance_of?"] But that generally gives you more than you're often interested in. I find myself typing things like this more often: irb(main):015:0> String.methods-Object.methods => [] Hrm, that gave me rather less than I was hoping for, seems String doesn't add any methods. irb(main):016:0> String.methods-Kernel.methods => ["new", "allocate", "superclass"] Ah, there we go. Or perhaps: irb(main):019:0> String.instance_methods-Object.instance_methods => ["%", "rindex", "between?", "reject", "[]=", "split", "<<", "strip", "size", "downcase", "gsub!", "count", "succ!", "downcase!", "intern", "member?", "squeeze!", "*", "next", "find", "each_with_index", "rstrip!", "each_line", "+", "sub", "slice!", "tr", "replace", "collect", "reverse", "all?", "entries", "lstrip", "capitalize", "chop!", "capitalize!", "scan", "to_sym", "detect", "zip", "each_byte", "casecmp", "~", "gsub", "empty?", "to_str", "map", "tr_s", "any?", "tr!", "match", "sort", "rstrip", "next!", "swapcase", "min", "chomp!", "swapcase!", "ljust", "find_all", "upto", "hex", "each", "sum", "reverse!", "chop", "to_i", "insert", "<", "unpack", "inject", "<=>", "delete", "dump", "tr_s!", ">", "concat", "succ", "sort_by", "strip!", "max", "rjust", ">=", "index", "select", "<=", "slice", "oct", "to_f", "length", "chomp", "upcase", "partition", "sub!", "squeeze", "upcase!", "crypt", "delete!", "grep", "lstrip!", "include?", "center", "[]"] No irb gunk in there at all. --Dave