Project

General

Profile

Bug #8729 ยป 0001-Fix-character-literals-in-documentation.patch

henrikhodne (Henrik Hodne), 08/04/2013 07:44 AM

View differences:

enum.c
888 888
 *
889 889
 *     files = Dir["*"]
890 890
 *     sorted = files.sort { |a, b|
891
 *       test(?M, a) <=> test(?M, b)
891
 *       test(??M, a) <=> test(??M, b)
892 892
 *     }
893 893
 *     sorted   #=> ["mon", "tues", "wed", "thurs"]
894 894
 *
......
901 901
 *  and then extract the filename from the result.
902 902
 *
903 903
 *     sorted = Dir["*"].collect { |f|
904
 *        [test(?M, f), f]
904
 *        [test(??M, f), f]
905 905
 *     }.sort.collect { |f| f[1] }
906 906
 *     sorted   #=> ["mon", "tues", "wed", "thurs"]
907 907
 *
908 908
 *  This is exactly what <code>sort_by</code> does internally.
909 909
 *
910
 *     sorted = Dir["*"].sort_by { |f| test(?M, f) }
910
 *     sorted = Dir["*"].sort_by { |f| test(??M, f) }
911 911
 *     sorted   #=> ["mon", "tues", "wed", "thurs"]
912 912
 */
913 913

  
numeric.c
2543 2543
 *
2544 2544
 *  Returns the +int+ itself.
2545 2545
 *
2546
 *     ?a.ord    #=> 97
2546
 *     ??a.ord    #=> 97
2547 2547
 *
2548 2548
 *  This method is intended for compatibility to character constant in Ruby
2549 2549
 *  1.9.
string.c
2599 2599
 *     "hello".index('e')             #=> 1
2600 2600
 *     "hello".index('lo')            #=> 3
2601 2601
 *     "hello".index('a')             #=> nil
2602
 *     "hello".index(?e)              #=> 1
2602
 *     "hello".index(??e)              #=> 1
2603 2603
 *     "hello".index(/[aeiou]/, -3)   #=> 4
2604 2604
 */
2605 2605

  
......
2713 2713
 *     "hello".rindex('e')             #=> 1
2714 2714
 *     "hello".rindex('l')             #=> 3
2715 2715
 *     "hello".rindex('a')             #=> nil
2716
 *     "hello".rindex(?e)              #=> 1
2716
 *     "hello".rindex(??e)              #=> 1
2717 2717
 *     "hello".rindex(/[aeiou]/, -2)   #=> 1
2718 2718
 */
2719 2719

  
......
4443 4443
 *
4444 4444
 *     "hello".include? "lo"   #=> true
4445 4445
 *     "hello".include? "ol"   #=> false
4446
 *     "hello".include? ?h     #=> true
4446
 *     "hello".include? ??h     #=> true
4447 4447
 */
4448 4448

  
4449 4449
static VALUE
4450
-