ruby-dev summary: 21928-22011

  • Thread starter Masayoshi Takahashi
  • Start date
M

Masayoshi Takahashi

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: (e-mail address removed)
 
S

Simon Strandgaard

[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 ?

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:
 
N

nobu.nokada

Hi,

At Sat, 29 Nov 2003 06:42:13 +0900,
Simon said:
[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.
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: ruby-dev summary: 21928-22011"

|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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top