From 26134a6dc13f8cd6af6692ae53d440d7ea9deb13 Mon Sep 17 00:00:00 2001 From: marcandre Date: Mon, 17 May 2010 21:50:00 +0000 Subject: * array.c: Documentation: change => in call-seq to ->. Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * hash.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@27870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 140 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 9d4a527a1c..9babd5da4b 100644 --- a/proc.c +++ b/proc.c @@ -124,69 +124,69 @@ proc_clone(VALUE self) /* * call-seq: - * prc.lambda? => true or false + * prc.lambda? -> true or false * * Returns true for a Proc object which argument handling is rigid. * Such procs are typically generated by lambda. * * A Proc object generated by proc ignore extra arguments. * - * proc {|a,b| [a,b] }.call(1,2,3) => [1,2] + * proc {|a,b| [a,b] }.call(1,2,3) #=> [1,2] * * It provides nil for lacked arguments. * - * proc {|a,b| [a,b] }.call(1) => [1,nil] + * proc {|a,b| [a,b] }.call(1) #=> [1,nil] * * It expand single-array argument. * - * proc {|a,b| [a,b] }.call([1,2]) => [1,2] + * proc {|a,b| [a,b] }.call([1,2]) #=> [1,2] * * A Proc object generated by lambda doesn't have such tricks. * - * lambda {|a,b| [a,b] }.call(1,2,3) => ArgumentError - * lambda {|a,b| [a,b] }.call(1) => ArgumentError - * lambda {|a,b| [a,b] }.call([1,2]) => ArgumentError + * lambda {|a,b| [a,b] }.call(1,2,3) #=> ArgumentError + * lambda {|a,b| [a,b] }.call(1) #=> ArgumentError + * lambda {|a,b| [a,b] }.call([1,2]) #=> ArgumentError * * Proc#lambda? is a predicate for the tricks. * It returns true if no tricks. * - * lambda {}.lambda? => true - * proc {}.lambda? => false + * lambda {}.lambda? #=> true + * proc {}.lambda? #=> false * * Proc.new is same as proc. * - * Proc.new {}.lambda? => false + * Proc.new {}.lambda? #=> false * * lambda, proc and Proc.new preserves the tricks of * a Proc object given by & argument. * - * lambda(&lambda {}).lambda? => true - * proc(&lambda {}).lambda? => true - * Proc.new(&lambda {}).lambda? => true + * lambda(&lambda {}).lambda? #=> true + * proc(&lambda {}).lambda? #=> true + * Proc.new(&lambda {}).lambda? #=> true * - * lambda(&proc {}).lambda? => false - * proc(&proc {}).lambda? => false - * Proc.new(&proc {}).lambda? => false + * lambda(&proc {}).lambda? #=> false + * proc(&proc {}).lambda? #=> false + * Proc.new(&proc {}).lambda? #=> false * * A Proc object generated by & argument has the tricks * * def n(&b) b.lambda? end - * n {} => false + * n {} #=> false * * The & argument preserves the tricks if a Proc object is given * by & argument. * - * n(&lambda {}) => true - * n(&proc {}) => false - * n(&Proc.new {}) => false + * n(&lambda {}) #=> true + * n(&proc {}) #=> false + * n(&Proc.new {}) #=> false * * A Proc object converted from a method has no tricks. * * def m() end - * method(:m).to_proc.lambda? => true + * method(:m).to_proc.lambda? #=> true * - * n(&method(:m)) => true - * n(&method(:m).to_proc) => true + * n(&method(:m)) #=> true + * n(&method(:m).to_proc) #=> true * * define_method is treated same as method definition. * The defined method has no tricks. @@ -194,8 +194,8 @@ proc_clone(VALUE self) * class C * define_method(:d) {} * end - * C.new.e(1,2) => ArgumentError - * C.new.method(:d).to_proc.lambda? => true + * C.new.e(1,2) #=> ArgumentError + * C.new.method(:d).to_proc.lambda? #=> true * * define_method always defines a method without the tricks, * even if a non-lambda Proc object is given. @@ -204,8 +204,8 @@ proc_clone(VALUE self) * class C * define_method(:e, &proc {}) * end - * C.new.e(1,2) => ArgumentError - * C.new.method(:e).to_proc.lambda? => true + * C.new.e(1,2) #=> ArgumentError + * C.new.method(:e).to_proc.lambda? #=> true * * This exception is for a wrapper of define_method. * It eases defining a method defining method which defines a usual method which has no tricks. @@ -218,7 +218,7 @@ proc_clone(VALUE self) * class C * def2(:f) {} * end - * C.new.f(1,2) => ArgumentError + * C.new.f(1,2) #=> ArgumentError * * The wrapper, def2, defines a method which has no tricks. * @@ -348,7 +348,7 @@ rb_f_binding(VALUE self) /* * call-seq: - * binding.eval(string [, filename [,lineno]]) => obj + * binding.eval(string [, filename [,lineno]]) -> obj * * Evaluates the Ruby expression(s) in string, in the * binding's context. If the optional filename and @@ -426,8 +426,8 @@ proc_new(VALUE klass, int is_lambda) /* * call-seq: - * Proc.new {|...| block } => a_proc - * Proc.new => a_proc + * Proc.new {|...| block } -> a_proc + * Proc.new -> a_proc * * Creates a new Proc object, bound to the current * context. Proc::new may be called without a block only @@ -452,7 +452,7 @@ rb_proc_s_new(int argc, VALUE *argv, VALUE klass) /* * call-seq: - * proc { |...| block } => a_proc + * proc { |...| block } -> a_proc * * Equivalent to Proc.new. */ @@ -478,7 +478,7 @@ rb_f_lambda(void) /* * call-seq: - * lambda { |...| block } => a_proc + * lambda { |...| block } -> a_proc * * Equivalent to Proc.new, except the resulting Proc objects * check the number of parameters passed when called. @@ -494,9 +494,9 @@ proc_lambda(void) /* * call-seq: - * prc.call(params,...) => obj - * prc[params,...] => obj - * prc.(params,...) => obj + * prc.call(params,...) -> obj + * prc[params,...] -> obj + * prc.(params,...) -> obj * * Invokes the block, setting the block's parameters to the values in * params using something close to method calling semantics. @@ -528,7 +528,7 @@ proc_lambda(void) /* * call-seq: - * prc === obj => obj + * prc === obj -> obj * * Invokes the block, with obj as the block's parameter. It is * to allow a proc object to be a target of when clause in the case statement. @@ -693,7 +693,7 @@ iseq_location(rb_iseq_t *iseq) /* * call-seq: - * prc.source_location => [String, Fixnum] + * prc.source_location -> [String, Fixnum] * * returns the ruby source filename and line number containing this proc * or nil if this proc was not defined in ruby (i.e. native) @@ -726,7 +726,7 @@ unnamed_parameters(int arity) /* * call-seq: - * proc.parameters => array + * proc.parameters -> array * * returns the parameter information of this proc */ @@ -744,7 +744,7 @@ rb_proc_parameters(VALUE self) /* * call-seq: - * prc == other_proc => true or false + * prc == other_proc -> true or false * * Return true if prc is the same object as * other_proc, or if they are both procs with the same body. @@ -775,7 +775,7 @@ proc_eq(VALUE self, VALUE other) /* * call-seq: - * prc.hash => integer + * prc.hash -> integer * * Return hash value corresponding to proc body. */ @@ -795,7 +795,7 @@ proc_hash(VALUE self) /* * call-seq: - * prc.to_s => string + * prc.to_s -> string * * Shows the unique identifier for this proc, along with * an indication of where the proc was defined. @@ -1000,7 +1000,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) /* * call-seq: - * meth == other_meth => true or false + * meth == other_meth -> true or false * * Two method objects are equal if they are bound to the same * object and refer to the same method definition. @@ -1032,7 +1032,7 @@ method_eq(VALUE method, VALUE other) /* * call-seq: - * meth.hash => integer + * meth.hash -> integer * * Return a hash value corresponding to the method object. */ @@ -1054,7 +1054,7 @@ method_hash(VALUE method) /* * call-seq: - * meth.unbind => unbound_method + * meth.unbind -> unbound_method * * Dissociates meth from it's current receiver. The resulting * UnboundMethod can subsequently be bound to a new object @@ -1082,7 +1082,7 @@ method_unbind(VALUE obj) /* * call-seq: - * meth.receiver => object + * meth.receiver -> object * * Returns the bound receiver of the method object. */ @@ -1098,7 +1098,7 @@ method_receiver(VALUE obj) /* * call-seq: - * meth.name => symbol + * meth.name -> symbol * * Returns the name of the method. */ @@ -1114,7 +1114,7 @@ method_name(VALUE obj) /* * call-seq: - * meth.owner => class_or_module + * meth.owner -> class_or_module * * Returns the class or module that defines the method. */ @@ -1130,7 +1130,7 @@ method_owner(VALUE obj) /* * call-seq: - * obj.method(sym) => method + * obj.method(sym) -> method * * Looks up the named method as a receiver in obj, returning a * Method object (or raising NameError). The @@ -1164,7 +1164,7 @@ rb_obj_method(VALUE obj, VALUE vid) /* * call-seq: - * obj.public_method(sym) => method + * obj.public_method(sym) -> method * * Similar to _method_, searches public method only. */ @@ -1177,7 +1177,7 @@ rb_obj_public_method(VALUE obj, VALUE vid) /* * call-seq: - * mod.instance_method(symbol) => unbound_method + * mod.instance_method(symbol) -> unbound_method * * Returns an +UnboundMethod+ representing the given * instance method in _mod_. @@ -1214,7 +1214,7 @@ rb_mod_instance_method(VALUE mod, VALUE vid) /* * call-seq: - * mod.public_instance_method(symbol) => unbound_method + * mod.public_instance_method(symbol) -> unbound_method * * Similar to _instance_method_, searches public method only. */ @@ -1227,8 +1227,8 @@ rb_mod_public_instance_method(VALUE mod, VALUE vid) /* * call-seq: - * define_method(symbol, method) => new_method - * define_method(symbol) { block } => proc + * define_method(symbol, method) -> new_method + * define_method(symbol) { block } -> proc * * Defines an instance method in the receiver. The _method_ * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. @@ -1324,8 +1324,8 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod) /* * call-seq: - * define_singleton_method(symbol, method) => new_method - * define_singleton_method(symbol) { block } => proc + * define_singleton_method(symbol, method) -> new_method + * define_singleton_method(symbol) { block } -> proc * * Defines a singleton method in the receiver. The _method_ * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. @@ -1345,7 +1345,7 @@ rb_mod_define_method(int argc, VALUE *argv, VALUE mod) * * guy = "Bob" * guy.define_singleton_method(:hello) { "#{self}: Hello there!" } - * guy.hello # => "Bob: Hello there!" + * guy.hello #=> "Bob: Hello there!" */ static VALUE @@ -1378,8 +1378,8 @@ method_clone(VALUE self) /* * call-seq: - * meth.call(args, ...) => obj - * meth[args, ...] => obj + * meth.call(args, ...) -> obj + * meth[args, ...] -> obj * * Invokes the meth with the specified arguments, returning the * method's return value. @@ -1588,7 +1588,7 @@ rb_method_entry_arity(const rb_method_entry_t *me) /* * call-seq: - * meth.arity => fixnum + * meth.arity -> fixnum * * Returns an indication of the number of arguments accepted by a * method. Returns a nonnegative integer for methods that take a fixed @@ -1678,7 +1678,7 @@ rb_method_get_iseq(VALUE method) /* * call-seq: - * meth.source_location => [String, Fixnum] + * meth.source_location -> [String, Fixnum] * * returns the ruby source filename and line number containing this method * or nil if this method was not defined in ruby (i.e. native) @@ -1698,7 +1698,7 @@ rb_method_location(VALUE method) /* * call-seq: - * meth.parameters => array + * meth.parameters -> array * * returns the parameter information of this method */ @@ -1715,8 +1715,8 @@ rb_method_parameters(VALUE method) /* * call-seq: - * meth.to_s => string - * meth.inspect => string + * meth.to_s -> string + * meth.inspect -> string * * Show the name of the underlying method. * @@ -1815,7 +1815,7 @@ rb_proc_new( /* * call-seq: - * meth.to_proc => prc + * meth.to_proc -> prc * * Returns a Proc object corresponding to this method. */ @@ -1842,7 +1842,7 @@ method_proc(VALUE method) /* * call_seq: - * local_jump_error.exit_value => obj + * local_jump_error.exit_value -> obj * * Returns the exit value associated with this +LocalJumpError+. */ @@ -1854,7 +1854,7 @@ localjump_xvalue(VALUE exc) /* * call-seq: - * local_jump_error.reason => symbol + * local_jump_error.reason -> symbol * * The reason this block was terminated: * :break, :redo, :retry, :next, :return, or :noreason. @@ -1868,7 +1868,7 @@ localjump_reason(VALUE exc) /* * call-seq: - * prc.binding => binding + * prc.binding -> binding * * Returns the binding associated with prc. Note that * Kernel#eval accepts either a Proc or a @@ -1954,8 +1954,8 @@ curry(VALUE dummy, VALUE args, int argc, VALUE *argv, VALUE passed_proc) /* * call-seq: - * prc.curry => a_proc - * prc.curry(arity) => a_proc + * prc.curry -> a_proc + * prc.curry(arity) -> a_proc * * Returns a curried proc. If the optional arity argument is given, * it determines the number of arguments. -- cgit v1.2.3