ruby-dev summary 21833-21882

K

Kazuo Saito

Hello,

This is a summary of ruby-dev mailing list last week.


[ruby-dev:21809] lib/test/unit/ui/tk/testrunner.rb

A new GUI interface for lib/test/unit using Tk extensions
has been developed by Kazuhiro NISHIYAMA, with help of
U.Nakamura, Nobu Nakada and Hidetoshi NAGAI. The TK
interface almost works well so far if you apply a patch
for pthread by NAGAI(See an article below). Let's try it out.


[ruby-dev:21819] error message of Array.new(9,0) {|x|x+1}

Take_tk reported a strange error message from Array.new:

Array.new(9,0){|x|x+1}
#=> wrong number of arguments (ArgumentError)

The Array.new takes only 4 styles of arguments, an another array,
size of array, size and a default value, or size and a block to
generate default values. The example above mixes 2 argument
styles at once, but the error message is a little bit difficult
to understand.

Proper English message for this error is wanted. Fell free to
post your idea.


[ruby-dev:21833] pthread trouble on tcltklib (Re: ruby-tk hangs
when exception is raised)

Hidetoshi NAGAI commited a patch to make pthread to work well with
Ruby's thread together. The patch will solve problems in extension
libraries using pthreads, Tcl/Tk extension for example. You can
try it by adding "--with-pthread-ext" to configure options. The
options is disabled by default.
Nagai said the patch works, but it is just preliminary. Testing
with other extensions using pthread and sending bug reports are
welcome.


[ruby-dev:21846] StringIO#path

In 1.8.0, StringIO#path behaved the same as StringIO#inspect.
This behavior was to provide polymorphic #path operation for
applications uses not only File objects but also similar IO
subclasses. By suggestions that StringIO and other IO subclasses
(such as sockets) doesn't always have an applicable path, and a
comment that using #path with File#rename and #open may occur
unexpected behavior, Nobu Nakada has changed StringIO#path to
return nil.


[ruby-dev:21876] get_last_error or getLastError by DL::Importable

Take_tk found a difference of imported method name between Ruby/DL
and Apollo. For instance, When you import GetLastError() from
kernel32.dll on Windows, Ruby/DL converts its name to "getLastError".
Meanwhile, Apollo converts it to "get_last_error".

Takaaki Tateishi, who is the maintainer of Ruby/DL, said that the
behavior can be changed but he also received a request from who
wants to use imported method name as-is, "GetLastError" in this case.

They started talking about how Ruby/DL treat this and how to implement
it.


Kazuo Saito <[email protected]>
 
B

Ben Giddings

Kazuo said:
[ruby-dev:21819] error message of Array.new(9,0) {|x|x+1}

Take_tk reported a strange error message from Array.new:

Array.new(9,0){|x|x+1}
#=> wrong number of arguments (ArgumentError)

The Array.new takes only 4 styles of arguments, an another array,
size of array, size and a default value, or size and a block to
generate default values. The example above mixes 2 argument
styles at once, but the error message is a little bit difficult
to understand.

Proper English message for this error is wanted. Fell free to
post your idea.

Hrm, well you could try "too many arguments", or be more specific and say
"default value must either be block or value, not both".

Ben
 
P

Paul Brannan

[ruby-dev:21819] error message of Array.new(9,0) {|x|x+1}

Array.new(9,0){|x|x+1}
#=> wrong number of arguments (ArgumentError)

Proper English message for this error is wanted. Fell free to
post your idea.

How about "cannot pass block and default value to Array.new"?
[ruby-dev:21833] pthread trouble on tcltklib (Re: ruby-tk hangs
when exception is raised)

Hidetoshi NAGAI commited a patch to make pthread to work well with
Ruby's thread together. The patch will solve problems in extension
libraries using pthreads, Tcl/Tk extension for example. You can
try it by adding "--with-pthread-ext" to configure options. The
options is disabled by default.
Nagai said the patch works, but it is just preliminary. Testing
with other extensions using pthread and sending bug reports are
welcome.

What exactly does this patch do? To what degree does ruby work with
pthreads now?

Looking at the source to the patch, it looks like Ruby now acquires a
lock every time it wants to switch threads. What impact does this have
on performance?

What is the purpose of the patch to signal.c that comes with the patch?
It almost looks unrelated...

Paul
 

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,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top