[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby-dev summary 21637-21729

Takaaki Tateishi

10/30/2003 10:01:00 PM

Hello,

I present you a summary of the ruby-dev mailing list.

[ruby-dev:21639] load() blocks thread scheduling
Tietew posted the following scripts which didn't timeout and didn't
accept Ctrl+C.

-- main.rb --
require 'timeout'
timeout(60) { load 'block.rb' }

--- block.rb
loop { }

He also posted a patch to change the thread. Matz wrote that
it would cause unexpected troubles if we didn't block other
thread while loading a script.


[ruby-dev:21641] SOAP::StreamError: Illegal media type
SOAP4R's test suite failed since it required pre-installed SOAP4R
library. Matz suggested that the test suite in ruby should use
not pre-installed libraries but use archived new libraries from
the archive.


[ruby-dev:21678] Problems of testing test/drb on Windows
U. Nakamura showed two opinions about test/drb on Windows as follows.
(a) test/drb/test_drbunix.rb failed if it was executed via
test/runner.rb, since Windows didn't have Socket::UNIX*.
He thought that such error had better occur when loading
'drb/unix'.
(b) The result of test/drb/test_acl.rb was 'E', since the
ruby was compiled without AF_INET6 and IPAddr#ipv6?
caused NameError. He proposed some solutions to avoid
NameError.


[ruby-dev:21679] Proposal: string literal concatenation
Mput proposed a specification which enables us to concatenate
strings using a new line like the following script.

s = "foo1" "bar1"
"foo2" "bar2"

Matz answered that he will discard string literal concatenation.


[ruby-dev:21682] ruby-tk hangs when exception is raised

Akira Yamada received a bug report as a package maintainer of
Debian. The following Ruby/TK script caused a problem that
Ctrl+C was not available. This problem have not been solved yet.

require 'tk'
r = TkRoot.new
b = TkButton.new(r) { text "break me" }
b.command proc {
raise "error!"
}
b.pack
Tk.mainloop

--
Takaaki Tateishi <ttate@ttsky.net>

21 Answers

Paul Brannan

11/6/2003 2:12:00 PM

0

On Fri, Oct 31, 2003 at 07:01:28AM +0900, Takaaki Tateishi wrote:
> [ruby-dev:21679] Proposal: string literal concatenation
> Mput proposed a specification which enables us to concatenate
> strings using a new line like the following script.
>
> s = "foo1" "bar1"
> "foo2" "bar2"
>
> Matz answered that he will discard string literal concatenation.

So what will the result of the above two lines of code be?

Paul


matz

11/6/2003 2:18:00 PM

0

Hi,

In message "Re: ruby-dev summary 21637-21729"
on 03/11/06, Paul Brannan <pbrannan@atdesk.com> writes:

|On Fri, Oct 31, 2003 at 07:01:28AM +0900, Takaaki Tateishi wrote:
|> [ruby-dev:21679] Proposal: string literal concatenation
|> Mput proposed a specification which enables us to concatenate
|> strings using a new line like the following script.
|>
|> s = "foo1" "bar1"
|> "foo2" "bar2"
|>
|> Matz answered that he will discard string literal concatenation.
|
|So what will the result of the above two lines of code be?

Plain syntax error in 1.9.x.

matz.

Paul Brannan

11/6/2003 2:28:00 PM

0

On Thu, Nov 06, 2003 at 11:17:59PM +0900, Yukihiro Matsumoto wrote:
> In message "Re: ruby-dev summary 21637-21729"
> on 03/11/06, Paul Brannan <pbrannan@atdesk.com> writes:
> |So what will the result of the above two lines of code be?
>
> Plain syntax error in 1.9.x.

Is the syntax error because of the first line or because of the second?
I ask because I do this a lot in my code:

s = "this is a string " "that I have chosen to break " "into multiple lines

I would be happy to switch to using heredocs if there were an easy way
to indent heredocs.

Paul


matz

11/6/2003 3:36:00 PM

0

Hi,

In message "Re: ruby-dev summary 21637-21729"
on 03/11/06, Paul Brannan <pbrannan@atdesk.com> writes:

|Is the syntax error because of the first line or because of the second?

Both. Sequence of strings will no longer be valid.

|I ask because I do this a lot in my code:
|
| s = "this is a string " | "that I have chosen to break " | "into multiple lines"

How about

s = "this is a string " +
"that I have chosen to break " +
"into multiple lines"
?

matz.

Paul Brannan

11/6/2003 10:58:00 PM

0

On Fri, Nov 07, 2003 at 12:36:23AM +0900, Yukihiro Matsumoto wrote:
> In message "Re: ruby-dev summary 21637-21729"
> on 03/11/06, Paul Brannan <pbrannan@atdesk.com> writes:
> |
> | s = "this is a string " > | "that I have chosen to break " > | "into multiple lines"
>
> How about
>
> s = "this is a string " +
> "that I have chosen to break " +
> "into multiple lines"

This works, but the concatenation is done at run-time instead of at
compile-time.

Paul


Robert Church

11/6/2003 11:10:00 PM

0

On Fri, Nov 07, 2003 at 07:57:32AM +0900, Paul Brannan quipped:
> > How about
> >
> > s = "this is a string " +
> > "that I have chosen to break " +
> > "into multiple lines"
>
> This works, but the concatenation is done at run-time instead of at
> compile-time.

Or so you assume. I don't know how Matz will handle this, but there's
no reason concatenation of string constants could not be done at
compile time.

Eric Hodel

11/6/2003 11:12:00 PM

0

Robert Church (rc@pgdn.org) wrote:

> On Fri, Nov 07, 2003 at 07:57:32AM +0900, Paul Brannan quipped:
> > > How about
> > >
> > > s = "this is a string " +
> > > "that I have chosen to break " +
> > > "into multiple lines"
> >
> > This works, but the concatenation is done at run-time instead of at
> > compile-time.
>
> Or so you assume. I don't know how Matz will handle this, but there's
> no reason concatenation of string constants could not be done at
> compile time.

You can redefine String#+, so no such optimization must be made at
compile time.

--
Eric Hodel - drbrain@segment7.net - http://se...
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

gabriele renzi

11/6/2003 11:18:00 PM

0

il Fri, 7 Nov 2003 07:57:32 +0900, Paul Brannan <pbrannan@atdesk.com>
ha scritto::


>This works, but the concatenation is done at run-time instead of at
>compile-time.

well, this could be meaningful if ruby had a real compiling fase.
And if it had it this could be esailt solved from the compiler (I
think javac does this, for example)

Sean O'Dell

11/6/2003 11:46:00 PM

0

On Thursday 06 November 2003 07:36 am, Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: ruby-dev summary 21637-21729"
>
> on 03/11/06, Paul Brannan <pbrannan@atdesk.com> writes:
> |Is the syntax error because of the first line or because of the second?
>
> Both. Sequence of strings will no longer be valid.
>
> |I ask because I do this a lot in my code:
> |
> | s = "this is a string " > | "that I have chosen to break " > | "into multiple lines"
>
> How about
>
> s = "this is a string " +
> "that I have chosen to break " +
> "into multiple lines"
> ?

My 1 cent: I really wish "" \ style concatenation wouldn't go away.

Sean O'Dell


nobu.nokada

11/7/2003 1:38:00 AM

0

Hi,

At Fri, 7 Nov 2003 07:57:32 +0900,
Paul Brannan wrote:
> On Fri, Nov 07, 2003 at 12:36:23AM +0900, Yukihiro Matsumoto wrote:
> > In message "Re: ruby-dev summary 21637-21729"
> > on 03/11/06, Paul Brannan <pbrannan@atdesk.com> writes:
> > |
> > | s = "this is a string " > > | "that I have chosen to break " > > | "into multiple lines"
> >
> > How about
> >
> > s = "this is a string " +
> > "that I have chosen to break " +
> > "into multiple lines"
>
> This works, but the concatenation is done at run-time instead of at
> compile-time.

In 1.8, this is concatenated at compile-time. :)

s = "this is a string #{ # And you can write
""}that I have chosen to break #{ # comments!
""}into multiple lines"

--
Nobu Nakada