M
Minero Aoki
Hi all,
This is a summary of ruby-dev ML in these days.
[ruby-dev:21296] test and sample directory
NAKAMURA Hiroshi suggested to locate tests and examples of
standard libraries in the CVS repository. Matz agreed with
him. Committers are recommended to place tests and examples
in following places:
test/Library_Name/test_*.rb
sample/Library_Name/*
[ruby-dev:21325] illegal member in %w array
K.Kosako reported that an unexpected member is included in %w
array:
% ruby -e 'p %w(a b \
c)'
["a", "b", "c"]
% ruby -e 'p %w(a b \
c)'
["a", "b", "", "c"] # third member is wrong
Matz regard it as a bug and modified %w feature.
On CVS HEAD, these expressions are evaluated as:
% ruby -e 'p %w(a b \
c)'
["a", "b", "\nc"]
% ruby -e 'p %w(a b \
c)'
["a", "b", "\n", "c"]
K.Kosako also pointed out that \\n works differently in single quote
string and single quote here-document:
p 'a\
b
'
--> "ab\n"
p(<<'EOS')
a\
b
EOS
--> "a\\\nb\n"
Matz modified these features, too. On CVS HEAD, these expressions
are evaluated as:
p 'a\
b
'
--> "a\\\nb\n"
p(<<'EOS')
a\
b
EOS
--> "a\\\nb\n"
Summary of feature changes:
* in %w array, '\' escapes all spaces (\ \r\n\t\f\v).
%w(a \
b
-> 1.8.0 ["a", "b"]
-> CVS HEAD ["a", "\nb"]
%w(a \
b
-> 1.8.0 ["a", "", "b"]
-> CVS HEAD ["a", "\n", "b"]
* In single quote string, '\' escapes only backslash itself.
'a\
b'
-> 1.8.0 "ab"
-> CVS HEAD "a\\\nb"
-- Minero Aoki
This is a summary of ruby-dev ML in these days.
[ruby-dev:21296] test and sample directory
NAKAMURA Hiroshi suggested to locate tests and examples of
standard libraries in the CVS repository. Matz agreed with
him. Committers are recommended to place tests and examples
in following places:
test/Library_Name/test_*.rb
sample/Library_Name/*
[ruby-dev:21325] illegal member in %w array
K.Kosako reported that an unexpected member is included in %w
array:
% ruby -e 'p %w(a b \
c)'
["a", "b", "c"]
% ruby -e 'p %w(a b \
c)'
["a", "b", "", "c"] # third member is wrong
Matz regard it as a bug and modified %w feature.
On CVS HEAD, these expressions are evaluated as:
% ruby -e 'p %w(a b \
c)'
["a", "b", "\nc"]
% ruby -e 'p %w(a b \
c)'
["a", "b", "\n", "c"]
K.Kosako also pointed out that \\n works differently in single quote
string and single quote here-document:
p 'a\
b
'
--> "ab\n"
p(<<'EOS')
a\
b
EOS
--> "a\\\nb\n"
Matz modified these features, too. On CVS HEAD, these expressions
are evaluated as:
p 'a\
b
'
--> "a\\\nb\n"
p(<<'EOS')
a\
b
EOS
--> "a\\\nb\n"
Summary of feature changes:
* in %w array, '\' escapes all spaces (\ \r\n\t\f\v).
%w(a \
b
-> 1.8.0 ["a", "b"]
-> CVS HEAD ["a", "\nb"]
%w(a \
b
-> 1.8.0 ["a", "", "b"]
-> CVS HEAD ["a", "\n", "b"]
* In single quote string, '\' escapes only backslash itself.
'a\
b'
-> 1.8.0 "ab"
-> CVS HEAD "a\\\nb"
-- Minero Aoki