diff options
author | BurdetteLamar <burdettelamar@yahoo.com> | 2023-08-12 14:54:39 +0100 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-08-12 10:04:39 -0400 |
commit | b18462c14be62f7572ed03dee470ffb99ae74521 (patch) | |
tree | 04500f3f9b8a86b0f3397af3e32c89890aef415a /hash.c | |
parent | e1683b4958b217d246ff737bdd1b046554c73e18 (diff) |
[DOC] Don't suppress autolinks
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8211
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 122 |
1 files changed, 61 insertions, 61 deletions
@@ -1765,7 +1765,7 @@ static VALUE rb_hash_to_a(VALUE hash); * h = {foo: 0, bar: 1, baz: 2} * Hash[h] # => {:foo=>0, :bar=>1, :baz=>2} * - * When the single given argument is an \Array of 2-element Arrays, + * When the single given argument is an Array of 2-element Arrays, * returns a new \Hash object wherein each 2-element array forms a * key-value entry: * @@ -2419,7 +2419,7 @@ shift_i_safe(VALUE key, VALUE value, VALUE arg) * * Removes the first hash entry * (see {Entry Order}[rdoc-ref:Hash@Entry+Order]); - * returns a 2-element \Array containing the removed key and value: + * returns a 2-element Array containing the removed key and value: * h = {foo: 0, bar: 1, baz: 2} * h.shift # => [:foo, 0] * h # => {:bar=>1, :baz=>2} @@ -2493,7 +2493,7 @@ hash_enum_size(VALUE hash, VALUE args, VALUE eobj) * h = {foo: 0, bar: 1, baz: 2} * h.delete_if {|key, value| value > 0 } # => {:foo=>0} * - * If no block given, returns a new \Enumerator: + * If no block given, returns a new Enumerator: * h = {foo: 0, bar: 1, baz: 2} * e = h.delete_if # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:delete_if> * e.each { |key, value| value > 0 } # => {:foo=>0} @@ -2522,7 +2522,7 @@ rb_hash_delete_if(VALUE hash) * * Returns +nil+ if no entries are removed. * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.reject! # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:reject!> * e.each {|key, value| key.start_with?('b') } # => {:foo=>0} @@ -2553,7 +2553,7 @@ rb_hash_reject_bang(VALUE hash) * h1 = h.reject {|key, value| key.start_with?('b') } * h1 # => {:foo=>0} * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.reject # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:reject> * h1 = e.each {|key, value| key.start_with?('b') } @@ -2636,7 +2636,7 @@ rb_hash_except(int argc, VALUE *argv, VALUE hash) * call-seq: * hash.values_at(*keys) -> new_array * - * Returns a new \Array containing values for the given +keys+: + * Returns a new Array containing values for the given +keys+: * h = {foo: 0, bar: 1, baz: 2} * h.values_at(:baz, :foo) # => [2, 0] * @@ -2662,11 +2662,11 @@ rb_hash_values_at(int argc, VALUE *argv, VALUE hash) * hash.fetch_values(*keys) -> new_array * hash.fetch_values(*keys) {|key| ... } -> new_array * - * Returns a new \Array containing the values associated with the given keys *keys: + * Returns a new Array containing the values associated with the given keys *keys: * h = {foo: 0, bar: 1, baz: 2} * h.fetch_values(:baz, :foo) # => [2, 0] * - * Returns a new empty \Array if no arguments given. + * Returns a new empty Array if no arguments given. * * When a block is given, calls the block with each missing key, * treating the block's return value as the value for that key: @@ -2708,7 +2708,7 @@ keep_if_i(VALUE key, VALUE value, VALUE hash) * h = {foo: 0, bar: 1, baz: 2} * h.select {|key, value| value < 2 } # => {:foo=>0, :bar=>1} * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.select # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:select> * e.each {|key, value| value < 2 } # => {:foo=>0, :bar=>1} @@ -2738,7 +2738,7 @@ rb_hash_select(VALUE hash) * * Returns +nil+ if no entries were removed. * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.select! # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:select!> * e.each { |key, value| value < 2 } # => {:foo=>0, :bar=>1} @@ -2769,7 +2769,7 @@ rb_hash_select_bang(VALUE hash) * h = {foo: 0, bar: 1, baz: 2} * h.keep_if { |key, value| key.start_with?('b') } # => {:bar=>1, :baz=>2} * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.keep_if # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:keep_if> * e.each { |key, value| key.start_with?('b') } # => {:bar=>1, :baz=>2} @@ -2979,7 +2979,7 @@ each_value_i(VALUE key, VALUE value, VALUE _) * 1 * 2 * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.each_value # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:each_value> * h1 = e.each {|value| puts value } @@ -3018,7 +3018,7 @@ each_key_i(VALUE key, VALUE value, VALUE _) * bar * baz * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.each_key # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:each_key> * h1 = e.each {|key| puts key } @@ -3068,7 +3068,7 @@ each_pair_i_fast(VALUE key, VALUE value, VALUE _) * bar: 1 * baz: 2 * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.each_pair # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:each_pair> * h1 = e.each {|key, value| puts "#{key}: #{value}"} @@ -3151,7 +3151,7 @@ transform_keys_i(VALUE key, VALUE value, VALUE result) * h1 = h.transform_keys {|key| :bat } * h1 # => {:bat=>2} * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.transform_keys # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:transform_keys> * h1 = e.each { |key| key.to_s } @@ -3275,7 +3275,7 @@ transform_values_foreach_replace(st_data_t *key, st_data_t *value, st_data_t arg * h1 = h.transform_values {|value| value * 100} * h1 # => {:foo=>0, :bar=>100, :baz=>200} * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.transform_values # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:transform_values> * h1 = e.each { |value| value * 100} @@ -3306,7 +3306,7 @@ rb_hash_transform_values(VALUE hash) * h = {foo: 0, bar: 1, baz: 2} * h.transform_values! {|value| value * 100} # => {:foo=>0, :bar=>100, :baz=>200} * - * Returns a new \Enumerator if no block given: + * Returns a new Enumerator if no block given: * h = {foo: 0, bar: 1, baz: 2} * e = h.transform_values! # => #<Enumerator: {:foo=>0, :bar=>100, :baz=>200}:transform_values!> * h1 = e.each {|value| value * 100} @@ -3336,8 +3336,8 @@ to_a_i(VALUE key, VALUE value, VALUE ary) * call-seq: * hash.to_a -> new_array * - * Returns a new \Array of 2-element \Array objects; - * each nested \Array contains a key-value pair from +self+: + * Returns a new Array of 2-element Array objects; + * each nested Array contains a key-value pair from +self+: * h = {foo: 0, bar: 1, baz: 2} * h.to_a # => [[:foo, 0], [:bar, 1], [:baz, 2]] */ @@ -3390,7 +3390,7 @@ inspect_hash(VALUE hash, VALUE dummy, int recur) * call-seq: * hash.inspect -> new_string * - * Returns a new \String containing the hash entries: + * Returns a new String containing the hash entries: * h = {foo: 0, bar: 1, baz: 2} * h.inspect # => "{:foo=>0, :bar=>1, :baz=>2}" @@ -3462,8 +3462,8 @@ rb_hash_to_h_block(VALUE hash) * * When a block is given, returns a new \Hash object * whose content is based on the block; - * the block should return a 2-element \Array object - * specifying the key-value pair to be included in the returned \Array: + * the block should return a 2-element Array object + * specifying the key-value pair to be included in the returned Array: * h = {foo: 0, bar: 1, baz: 2} * h1 = h.to_h {|key, value| [value, key] } * h1 # => {0=>:foo, 1=>:bar, 2=>:baz} @@ -3493,7 +3493,7 @@ keys_i(VALUE key, VALUE value, VALUE ary) * call-seq: * hash.keys -> new_array * - * Returns a new \Array containing all keys in +self+: + * Returns a new Array containing all keys in +self+: * h = {foo: 0, bar: 1, baz: 2} * h.keys # => [:foo, :bar, :baz] */ @@ -3537,7 +3537,7 @@ values_i(VALUE key, VALUE value, VALUE ary) * call-seq: * hash.values -> new_array * - * Returns a new \Array containing all values in +self+: + * Returns a new Array containing all values in +self+: * h = {foo: 0, bar: 1, baz: 2} * h.values # => [0, 1, 2] */ @@ -3769,7 +3769,7 @@ hash_i(VALUE key, VALUE val, VALUE arg) * call-seq: * hash.hash -> an_integer * - * Returns the \Integer hash-code for the hash. + * Returns the Integer hash-code for the hash. * * Two \Hash objects have the same hash-code if their content is the same * (regardless or order): @@ -4076,7 +4076,7 @@ assoc_i(VALUE key, VALUE val, VALUE arg) * call-seq: * hash.assoc(key) -> new_array or nil * - * If the given +key+ is found, returns a 2-element \Array containing that key and its value: + * If the given +key+ is found, returns a 2-element Array containing that key and its value: * h = {foo: 0, bar: 1, baz: 2} * h.assoc(:bar) # => [:bar, 1] * @@ -4135,7 +4135,7 @@ rassoc_i(VALUE key, VALUE val, VALUE arg) * call-seq: * hash.rassoc(value) -> new_array or nil * - * Returns a new 2-element \Array consisting of the key and value + * Returns a new 2-element Array consisting of the key and value * of the first-found entry whose value is <tt>==</tt> to value * (see {Entry Order}[rdoc-ref:Hash@Entry+Order]): * h = {foo: 0, bar: 1, baz: 1} @@ -4172,7 +4172,7 @@ flatten_i(VALUE key, VALUE val, VALUE ary) * hash.flatten -> new_array * hash.flatten(level) -> new_array * - * Returns a new \Array object that is a 1-dimensional flattening of +self+. + * Returns a new Array object that is a 1-dimensional flattening of +self+. * * --- * @@ -4180,7 +4180,7 @@ flatten_i(VALUE key, VALUE val, VALUE ary) * h = {foo: 0, bar: [:bat, 3], baz: 2} * h.flatten # => [:foo, 0, :bar, [:bat, 3], :baz, 2] * - * Takes the depth of recursive flattening from \Integer argument +level+: + * Takes the depth of recursive flattening from Integer argument +level+: * h = {foo: 0, bar: [:bat, [:baz, [:bat, ]]]} * h.flatten(1) # => [:foo, 0, :bar, [:bat, [:baz, [:bat]]]] * h.flatten(2) # => [:foo, 0, :bar, :bat, [:baz, [:bat]]] @@ -4617,7 +4617,7 @@ hash_proc_call(RB_BLOCK_CALL_FUNC_ARGLIST(key, hash)) * call-seq: * hash.to_proc -> proc * - * Returns a \Proc object that maps a key to its value: + * Returns a Proc object that maps a key to its value: * h = {foo: 0, bar: 1, baz: 2} * proc = h.to_proc * proc.class # => Proc @@ -5488,7 +5488,7 @@ env_each_value(VALUE ehash) * ENV.each_pair { |name, value| block } -> ENV * ENV.each_pair -> an_enumerator * - * Yields each environment variable name and its value as a 2-element \Array: + * Yields each environment variable name and its value as a 2-element Array: * h = {} * ENV.each_pair { |name, value| h[name] = value } # => ENV * h # => {"bar"=>"1", "foo"=>"0"} @@ -5624,7 +5624,7 @@ env_delete_if(VALUE ehash) * Returns +nil+ in the Array for each name that is not an ENV name: * ENV.values_at('foo', 'bat', 'bar', 'bam') # => ["0", nil, "1", nil] * - * Returns an empty \Array if no names given. + * Returns an empty Array if no names given. * * Raises an exception if any name is invalid. * See {Invalid Names and Values}[rdoc-ref:ENV@Invalid+Names+and+Values]. @@ -6573,8 +6573,8 @@ static const rb_data_type_t env_data_type = { /* * A \Hash maps each of its unique keys to a specific value. * - * A \Hash has certain similarities to an \Array, but: - * - An \Array index is always an \Integer. + * A \Hash has certain similarities to an Array, but: + * - An Array index is always an Integer. * - A \Hash key can be (almost) any object. * * === \Hash \Data Syntax @@ -6584,14 +6584,14 @@ static const rb_data_type_t env_data_type = { * h = {:foo => 0, :bar => 1, :baz => 2} * h # => {:foo=>0, :bar=>1, :baz=>2} * - * Alternatively, but only for a \Hash key that's a \Symbol, + * Alternatively, but only for a \Hash key that's a Symbol, * you can use a newer JSON-style syntax, - * where each bareword becomes a \Symbol: + * where each bareword becomes a Symbol: * * h = {foo: 0, bar: 1, baz: 2} * h # => {:foo=>0, :bar=>1, :baz=>2} * - * You can also use a \String in place of a bareword: + * You can also use a String in place of a bareword: * * h = {'foo': 0, 'bar': 1, 'baz': 2} * h # => {:foo=>0, :bar=>1, :baz=>2} @@ -6716,7 +6716,7 @@ static const rb_data_type_t env_data_type = { * * - Iterative methods such as <tt>each</tt>, <tt>each_key</tt>, <tt>each_pair</tt>, <tt>each_value</tt>. * - Other order-sensitive methods such as <tt>shift</tt>, <tt>keys</tt>, <tt>values</tt>. - * - The \String returned by method <tt>inspect</tt>. + * - The String returned by method <tt>inspect</tt>. * * A new \Hash has its initial ordering per the given entries: * @@ -6775,9 +6775,9 @@ static const rb_data_type_t env_data_type = { * h.include?(a0) # => true * h[a0] # => 0 * - * A \String key is always safe. - * That's because an unfrozen \String - * passed as a key will be replaced by a duplicated and frozen \String: + * A String key is always safe. + * That's because an unfrozen String + * passed as a key will be replaced by a duplicated and frozen String: * * s = 'foo' * s.frozen? # => false @@ -6791,9 +6791,9 @@ static const rb_data_type_t env_data_type = { * Note: this requirement does not apply if the \Hash uses #compare_by_identity since comparison will then * rely on the keys' object id instead of <code>hash</code> and <code>eql?</code>. * - * \Object defines basic implementation for <code>hash</code> and <code>eq?</code> that makes each object + * Object defines basic implementation for <code>hash</code> and <code>eq?</code> that makes each object * a distinct key. Typically, user-defined classes will want to override these methods to provide meaningful - * behavior, or for example inherit \Struct that has useful definitions for these. + * behavior, or for example inherit Struct that has useful definitions for these. * * A typical implementation of <code>hash</code> is based on the * object's data while <code>eql?</code> is usually aliased to the overridden @@ -6874,7 +6874,7 @@ static const rb_data_type_t env_data_type = { * * To use a mutable object as default, it is recommended to use a default proc * - * ==== Default \Proc + * ==== Default Proc * * When the default proc for a \Hash is set (i.e., not +nil+), * the default value returned by method #[] is determined by the default proc alone. @@ -7153,15 +7153,15 @@ Init_Hash(void) /* Document-class: ENV * - * ENV is a hash-like accessor for environment variables. + * \ENV is a hash-like accessor for environment variables. * * === Interaction with the Operating System * - * The ENV object interacts with the operating system's environment variables: + * The \ENV object interacts with the operating system's environment variables: * - * - When you get the value for a name in ENV, the value is retrieved from among the current environment variables. - * - When you create or set a name-value pair in ENV, the name and value are immediately set in the environment variables. - * - When you delete a name-value pair in ENV, it is immediately deleted from the environment variables. + * - When you get the value for a name in \ENV, the value is retrieved from among the current environment variables. + * - When you create or set a name-value pair in \ENV, the name and value are immediately set in the environment variables. + * - When you delete a name-value pair in \ENV, it is immediately deleted from the environment variables. * * === Names and Values * @@ -7211,24 +7211,24 @@ Init_Hash(void) * * === About Ordering * - * ENV enumerates its name/value pairs in the order found + * \ENV enumerates its name/value pairs in the order found * in the operating system's environment variables. - * Therefore the ordering of ENV content is OS-dependent, and may be indeterminate. + * Therefore the ordering of \ENV content is OS-dependent, and may be indeterminate. * * This will be seen in: - * - A Hash returned by an ENV method. - * - An Enumerator returned by an ENV method. + * - A Hash returned by an \ENV method. + * - An Enumerator returned by an \ENV method. * - An Array returned by ENV.keys, ENV.values, or ENV.to_a. * - The String returned by ENV.inspect. * - The Array returned by ENV.shift. * - The name returned by ENV.key. * * === About the Examples - * Some methods in ENV return ENV itself. Typically, there are many environment variables. - * It's not useful to display a large ENV in the examples here, - * so most example snippets begin by resetting the contents of ENV: - * - ENV.replace replaces ENV with a new collection of entries. - * - ENV.clear empties ENV. + * Some methods in \ENV return \ENV itself. Typically, there are many environment variables. + * It's not useful to display a large \ENV in the examples here, + * so most example snippets begin by resetting the contents of \ENV: + * - ENV.replace replaces \ENV with a new collection of entries. + * - ENV.clear empties \ENV. * * == What's Here * @@ -7288,8 +7288,8 @@ Init_Hash(void) * - ::except: Returns a hash of all name/value pairs except those given. * - ::fetch: Returns the value for the given name. * - ::inspect: Returns the contents of \ENV as a string. - * - ::invert: Returns a hash whose keys are the ENV values, - and whose values are the corresponding ENV names. + * - ::invert: Returns a hash whose keys are the \ENV values, + and whose values are the corresponding \ENV names. * - ::keys: Returns an array of all names. * - ::rassoc: Returns the name and value of the first found entry * that has the given value. @@ -7378,7 +7378,7 @@ Init_Hash(void) rb_undef_method(envtbl_class, "initialize_dup"); /* - * ENV is a Hash-like accessor for environment variables. + * \ENV is a Hash-like accessor for environment variables. * * See ENV (the class) for more details. */ |