Ruby-dev summary: 21928-22011

Hello all,

This is a summary of ruby-dev ML in these days.

[ruby-dev:21932] rough / tabs.rb

Minero Aoki reviewed tabs.rb in CVS rough directory
because he wanted a standard library to treat tabs. But
he had some complaints of that, so he rewrote new one.

  • much faster than original in difficult case
  • nearly fast in normal case (some tabs in line head)
  • bang method is slower than non-bang method

His thought:

  • better name for expand_tabs in the case it’s in String class?
  • someone may want to put under the Text module, not top class.
    (Minero himself doesn’t care of it)
  • may want aliases tabify/untabify
  • may want detab/entab

[ruby-dev:21933] new hash literal

Nobu Nakata read Matz’s RC2003 slides
(http://www.rubyist.net/~matz/slides/rc2003/mgp00027.html)
and made a patch for a new hash literal like {key: value}.

[ruby-dev:21955] block local parameters in Ruby2

Shugo Maeda read Matz’s slides of RC2003 and found a notation:

  • Block parameters will be block local
    even if variables with same names exist

But he thought that a sample like below should raise an error.

def foo
x = 1
iter do |x|
p x # x is block local -> error!
end
p x # x is method local
end

Maeda and Matz feel that such style is ugly, but
some people doesn’t. So Matz will allow such nested
variables with warning.

[ruby-dev:21990] environment variables in ruby.1

Minero Aoki added a new section 'environment variables’
to man page of Ruby. Now we can see it in CVS.

[ruby-dev:22000] purge pthread at configure

U. Nakamura reported that he cannot pass 'make test’
with -lpthread option in his NetBSD/i386-current,
so he proposed to make an option to disable pthread.
Then a new option ‘–enable-pthread’ was added.

Regards,

TAKAHASHI ‘Maki’ Masayoshi E-mail: maki@rubycolor.org

Matz slide says:
{a: 45, b: 55, c: 65} same as {:a => 45, :b => 55 :c => 65}

Will it be possible to leave out spaces,
so that {a:45, b:55, c:65} are possible ?

Leaving out comma, will it be possible?
like this: {a:45 b:55 c:65}

What happens if no value are specified ? nil?
For instance ‘verbose:’ has no value
copy source:“file.in” dest:“file.out” verbose:

···

On Sat, 29 Nov 2003 03:57:05 +0900, Masayoshi Takahashi wrote:

[ruby-dev:21933] new hash literal
Nobu Nakata read Matz’s RC2003 slides
(http://www.rubyist.net/~matz/slides/rc2003/mgp00027.html)
and made a patch for a new hash literal like {key: value}.


Simon Strandgaard

Hi,

[ruby-dev:21933] new hash literal
Nobu Nakata read Matz’s RC2003 slides
(http://www.rubyist.net/~matz/slides/rc2003/mgp00027.html)
and made a patch for a new hash literal like {key: value}.

Matz slide says:
{a: 45, b: 55, c: 65} same as {:a => 45, :b => 55 :c => 65}

Will it be possible to leave out spaces,
so that {a:45, b:55, c:65} are possible ?

Yes, but impossible to put spaces before colons.

{a :45, b :55, c :65} same as {a(:45), b(:55), c(:65)}

But :45 and so on cause SyntaxError, of course.

Leaving out comma, will it be possible?
like this: {a:45 b:55 c:65}

No. I’ve not thought about such syntax.

What happens if no value are specified ? nil?
For instance ‘verbose:’ has no value
copy source:“file.in” dest:“file.out” verbose:

Parse error.

···

At Sat, 29 Nov 2003 06:42:13 +0900, Simon Strandgaard wrote:


Nobu Nakada

Hi,

Matz slide says:
{a: 45, b: 55, c: 65} same as {:a => 45, :b => 55 :c => 65}

Will it be possible to leave out spaces,
so that {a:45, b:55, c:65} are possible ?

Possible.

Leaving out comma, will it be possible?
like this: {a:45 b:55 c:65}

Not possible.

What happens if no value are specified ? nil?
For instance ‘verbose:’ has no value
copy source:“file.in” dest:“file.out” verbose:

Not possible. You always have to specify value to the keyword
arguments.

copy(source:“file.in”, dest:“file.out”, verbose:true)

						matz.
···

In message “Re: ruby-dev summary: 21928-22011” on 03/11/29, Simon Strandgaard neoneye@adslhome.dk writes:

Thanks for your insight, Nobu.

···


Simon Strandgaard