[#19075] Request For Removal: No Operator Concatenation — James Gray <james@...>

I'm disappointed that Ruby still supports this goofy syntax:

30 messages 2008/10/01
[#19076] Re: Request For Removal: No Operator Concatenation — "Gregory Brown" <gregory.t.brown@...> 2008/10/01

On Wed, Oct 1, 2008 at 1:58 PM, James Gray <james@grayproductions.net> wrote:

[#19078] Re: Request For Removal: No Operator Concatenation — "Jim Freeze" <jimfreeze@...> 2008/10/01

On Wed, Oct 1, 2008 at 1:08 PM, Gregory Brown <gregory.t.brown@gmail.com> wrote:

[#19080] Re: Request For Removal: No Operator Concatenation — James Gray <james@...> 2008/10/01

On Oct 1, 2008, at 1:15 PM, Jim Freeze wrote:

[#19081] Re: Request For Removal: No Operator Concatenation — "Jim Freeze" <jimfreeze@...> 2008/10/01

On Wed, Oct 1, 2008 at 1:29 PM, James Gray <james@grayproductions.net> wrote:

[#19082] Re: Request For Removal: No Operator Concatenation — James Gray <james@...> 2008/10/01

On Oct 1, 2008, at 1:37 PM, Jim Freeze wrote:

[#19083] Re: Request For Removal: No Operator Concatenation — Eric Hodel <drbrain@...7.net> 2008/10/01

On Oct 1, 2008, at 11:42 AM, James Gray wrote:

[#19084] Re: Request For Removal: No Operator Concatenation — "Gregory Brown" <gregory.t.brown@...> 2008/10/01

On Wed, Oct 1, 2008 at 2:45 PM, Eric Hodel <drbrain@segment7.net> wrote:

[#19087] Re: Request For Removal: No Operator Concatenation — "Jim Freeze" <jimfreeze@...> 2008/10/01

On Wed, Oct 1, 2008 at 2:10 PM, Gregory Brown <gregory.t.brown@gmail.com> wrote:

[#19132] [Feature #615] "with" operator — Lavir the Whiolet <redmine@...>

Feature #615: "with" operator

33 messages 2008/10/05
[#19137] Re: [Feature #615] "with" operator — Nobuyoshi Nakada <nobu@...> 2008/10/06

Hi,

[#19138] Re: [Feature #615] "with" operator — Paul Brannan <pbrannan@...> 2008/10/06

On Mon, Oct 06, 2008 at 10:46:49AM +0900, Nobuyoshi Nakada wrote:

[#19141] Re: [Feature #615] "with" operator — _why <why@...> 2008/10/06

On Mon, Oct 06, 2008 at 10:56:23PM +0900, Paul Brannan wrote:

[#19148] Re: [Feature #615] "with" operator — Trans <transfire@...> 2008/10/06

[#19149] Re: [Feature #615] "with" operator — "Austin Ziegler" <halostatue@...> 2008/10/06

On Mon, Oct 6, 2008 at 3:34 PM, Trans <transfire@gmail.com> wrote:

[#19150] Re: [Feature #615] "with" operator — "David A. Black" <dblack@...> 2008/10/06

Hi --

[#19154] Re: [Feature #615] "with" operator — _why <why@...> 2008/10/07

On Tue, Oct 07, 2008 at 05:47:23AM +0900, David A. Black wrote:

[#19250] default_internal encoding — Dave Thomas <dave@...>

I'm documenting default_internal for the PickAxe, and have a couple of

26 messages 2008/10/09
[#19254] Re: default_internal encoding — "Michael Selig" <michael.selig@...> 2008/10/09

Hi,

[#19255] Re: performance of C function calls in 1.8 vs 1.9 — "Michael Selig" <michael.selig@...> 2008/10/10

On Wed, Oct 8, 2008 at 3:52 PM, Paul Brannan <pbrannan / atdesk.com> wrote:

[#19289] [Bug #633] dl segfaults on x86_64-linux systems — Benjamin Floering <redmine@...>

Bug #633: dl segfaults on x86_64-linux systems

19 messages 2008/10/10

[#19315] [Feature #643] __DIR__ — Thomas Sawyer <redmine@...>

Feature #643: __DIR__

14 messages 2008/10/13

[#19342] [Bug #649] Memory leak in a array assignment? — Henri Suur-Inkeroinen <redmine@...>

Bug #649: Memory leak in a array assignment?

14 messages 2008/10/15

[#19350] Net::HTTP.post_form bug : can't post form to correct uri which contains QueryString(QueryString part are lost) and revise — Klesh <kleshwong@...>

Hi,

10 messages 2008/10/16
[#19352] Re: Net::HTTP.post_form bug : can't post form to correct uri which contains QueryString(QueryString part are lost) and revise — "Matt Todd" <chiology@...> 2008/10/16

You are trying to use GET-style query params instead of POSTing the

[#19378] Constant names in 1.9 — Dave Thomas <dave@...>

When Ruby makes the tIDENTIFIER/tCONSTANT test, it looks to see if the =20=

13 messages 2008/10/18

[#19397] [Feature #666] Enumerable::to_hash — Marc-Andre Lafortune <redmine@...>

Feature #666: Enumerable::to_hash

14 messages 2008/10/20
[#23249] [Feature #666](Rejected) Enumerable::to_hash — Yukihiro Matsumoto <redmine@...> 2009/04/18

Issue #666 has been updated by Yukihiro Matsumoto.

[#19422] Now that lambda has more powerful arguments... — Dave Thomas <dave@...>

is there anything that

24 messages 2008/10/21
[#19423] Re: Now that lambda has more powerful arguments... — Wolfgang N疆asi-Donner <ed.odanow@...> 2008/10/21

Dave Thomas schrieb:

[#19424] Re: Now that lambda has more powerful arguments... — Dave Thomas <dave@...> 2008/10/21

[#19427] Re: Now that lambda has more powerful arguments... — Paul Brannan <pbrannan@...> 2008/10/21

On Wed, Oct 22, 2008 at 04:01:45AM +0900, Dave Thomas wrote:

[#19429] Re: Now that lambda has more powerful arguments... — "David A. Black" <dblack@...> 2008/10/21

Hi --

[#19430] Re: Now that lambda has more powerful arguments... — Paul Brannan <pbrannan@...> 2008/10/21

On Wed, Oct 22, 2008 at 04:38:19AM +0900, David A. Black wrote:

[#19431] Re: Now that lambda has more powerful arguments... — "David A. Black" <dblack@...> 2008/10/21

Hi --

[#19432] Re: Now that lambda has more powerful arguments... — Jim Weirich <jim.weirich@...> 2008/10/21

On Oct 21, 2008, at 4:24 PM, David A. Black wrote:

[#19465] [Bug #680] csv.rb: CSV.parse is too late when encoding is mismatch — Takeyuki Fujioka <redmine@...>

Bug #680: csv.rb: CSV.parse is too late when encoding is mismatch

41 messages 2008/10/24
[#19466] Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is too late when encoding is mismatch) — "Michael Selig" <michael.selig@...> 2008/10/24

Hi,

[#19471] Re: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch) — Martin Duerst <duerst@...> 2008/10/24

A default for the source encoding has been discussed quite a long

[#19473] Re: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch) — "Michael Selig" <michael.selig@...> 2008/10/24

Hi,

[#19474] Re: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch) — Yukihiro Matsumoto <matz@...> 2008/10/24

Hi,

[#19515] String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — "Michael Selig" <michael.selig@...> 2008/10/26

Hi,

[#19517] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — Nobuyoshi Nakada <nobu@...> 2008/10/26

Hi,

[#19518] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — "Michael Selig" <michael.selig@...> 2008/10/26

On Sun, 26 Oct 2008 17:26:32 +1100, Nobuyoshi Nakada <nobu@ruby-lang.org>

[#19522] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — Nobuyoshi Nakada <nobu@...> 2008/10/26

Hi,

[#19525] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — "Michael Selig" <michael.selig@...> 2008/10/26

On Sun, 26 Oct 2008 23:34:26 +1100, Nobuyoshi Nakada <nobu@ruby-lang.org>

[#19531] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — Nobuyoshi Nakada <nobu@...> 2008/10/27

Hi,

[#19532] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — "Michael Selig" <michael.selig@...> 2008/10/27

On Mon, 27 Oct 2008 16:07:54 +1100, Nobuyoshi Nakada <nobu@ruby-lang.org>

[#19533] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — Nobuyoshi Nakada <nobu@...> 2008/10/27

Hi,

[#19535] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — "Michael Selig" <michael.selig@...> 2008/10/27

On Mon, 27 Oct 2008 17:27:57 +1100, Nobuyoshi Nakada <nobu@ruby-lang.org>

[#19538] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — Nobuyoshi Nakada <nobu@...> 2008/10/27

Hi,

[#19540] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — "Michael Selig" <michael.selig@...> 2008/10/27

On Mon, 27 Oct 2008 20:55:32 +1100, Nobuyoshi Nakada <nobu@ruby-lang.org>

[#19546] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) — Nobuyoshi Nakada <nobu@...> 2008/10/27

Hi,

[#19480] Re: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch) — James Gray <james@...> 2008/10/24

On Oct 24, 2008, at 1:52 AM, Martin Duerst wrote:

[#19566] GC thought — "Roger Pack" <roger.pack@...>

Here is a recent patch I've been experimenting with--for any advice. [1]

26 messages 2008/10/28
[#19569] Re: GC thought — Ken Bloom <kbloom@...> 2008/10/28

On Tue, 28 Oct 2008 17:02:17 +0900, Roger Pack wrote:

[#19575] Re: GC thought — "Roger Pack" <roger.pack@...> 2008/10/28

> Letting the program continue execution during the mark phase could cause

[#19577] Re: GC thought — Paul Brannan <pbrannan@...> 2008/10/28

On Wed, Oct 29, 2008 at 01:04:52AM +0900, Roger Pack wrote:

[#19596] Re: GC thought — "Robert Klemme" <shortcutter@...> 2008/10/29

2008/10/28 Paul Brannan <pbrannan@atdesk.com>:

[#19590] [Feature #695] More flexibility when combining ASCII-8BIT strings with other encodings — Michael Selig <redmine@...>

Feature #695: More flexibility when combining ASCII-8BIT strings with other encodings

13 messages 2008/10/29
[#19646] Re: [Feature #695] More flexibility when combining ASCII-8BIT strings with other encodings — "Michael Selig" <michael.selig@...> 2008/10/30

Hi,

[ruby-core:19648] Re: [Feature #695] More flexibility when combiningASCII-8BIT strings with other encodings

From: Martin Duerst <duerst@...>
Date: 2008-10-31 02:51:53 UTC
List: ruby-core #19648
At 07:14 08/10/31, Michael Selig wrote:
>Hi,
>
>Feature #695 was closed & marked done, but unfortunately it does not seem  
>to have been implemented :-(

I think it should have been marked part done, part rejected,
I guess.

>The request was:
>
>> When combining 2 strings, with one being ASCII-8BIT, and the other is  
>> encoding "E":
>> 1) If the ASCII-8BIT string is valid if forced to encoding E, then treat  
>> the ASCII-8BIT string as being in encoding E;
>> 2) Otherwise treat both strings as ASCII-8BIT.
>>
>> Part (2) is less important, and can probably be omitted if it is hard to  
>> implement.

In my understanding, this would be a rather strong departure
from the current Ruby multilingual architecture, and not necessarily
a desirable one. It would be much more appropriate to start with
automatic conversion between labeled real encodings than to introduce
some conversion between arbitrary bytes and characters.
This distinction is already present in Ruby, you have to use
String#force_encoding in the above case, but String#encode
for actual conversion.

While things might 'just work' in some cases, treating arbitrary
ASCII-8BIT as a specific encoding if the byte pattern is okay
can result in many garbage-in-garbage-out cases. Some encodings
are more restrictive (e.g. UTF-8), but others, in particular all
single-byte encodings, have no restrictions at all.

I don't think it is by chance that most programming languages I
know, even if they have a somewhat different internationalization
model, more focused on Unicode than Ruby, make a clear distinction
between characters and bytes. It also isn't by chance that one
of the first things people have to learn when they learn about
internationalization is "bytes are not characters".

The above change would also be very difficult and tedious to
implement in Ruby currently. I was looking into this just a little
bit to see how easy it would be to implement automatic conversions
between actual character sets.

>However:
>
>ruby -Kn -ve 'p "abc\xD8\xB5" + "abc\u0635"'
>ruby 1.9.0 (2008-10-30 revision 20062) [i686-linux]
>-e:1:in `<main>': incompatible character encodings: ASCII-8BIT and UTF-8  
>(Encoding::CompatibilityError)
>
>(The -Kn is only necessary here because with -e ruby uses the locale to  
>determine the encoding of the string containing "\x".)
>I thought this feature was implemented very quickly!
>
>What appears to have been implemented is the encoding of "Array#pack"  
>output with "U".
>However, I am not totally convinced that even this was done correctly, as  
>the pack output seems now to be marked UTF-8 even if the pack option  
>contains a mixture of "U" with other options which then can result in an  
>invalid UTF-8 string.
>
>My feature request would mean that "pack" and "\x" string literals could  
>be left as ASCII-8BIT, and be "forced" to another encoding transparently  
>depending on how the programmer uses it.

I think this is totally the wrong way. The problems are with
pack and \x in string literals, and it would be a bad idea to
try and solve them by introducing a general "bytes become characters"
feature.


>You can liken this feature to the transparent conversion of an integer to  
>a float when doing arithmetic.

Well, it's not very similar. The conversion of an interger to a float
is very predictable, but the 'conversion' of ASCII-8BIT to some
real encoding is just a wild guess.


>If you agree that this is a good idea, I don't mind trying to produce a  
>patch for it myself. Please let me know.

I don't know about Matz or Nobu, but I don't think at all that this
is the way to go.

Regards,   Martin.


>
>Cheers
>Mike
>
>On Wed, 29 Oct 2008 14:53:15 +1100, Michael Selig <redmine@ruby-lang.org>  
>wrote:
>
>> Feature #695: More flexibility when combining ASCII-8BIT strings with  
>> other encodings
>> http://redmine.ruby-lang.org/issues/show/695
>>
>> Author: Michael Selig
>> Status: Open, Priority: Normal
>> Category: M17N
>>
>> Consider the following 3 Ruby statements:
>>
>> # String#pack always returns ASCII-8BIT
>> s1 = [97, 98, 99, 1589].pack("U*")
>>
>> # \xNN returns the source encoding (even if it is an invalid string), or  
>> ASCII-8BIT if not set
>> s2 = "abc\xD8\xB5"
>>
>> # \uNNNN always returns UTF-8
>> s3 = "abc\u0635"
>>
>> All of s1, s2, and s3 have the same contents, but different encodings.  
>> When you try to combine them, you get different "encoding compatibility"  
>> problems, which can change depending on the source encoding, due to the  
>> treatment of s2.
>>
>> I would like to see Ruby be able to combine all the above without error.  
>> I don't think it is reasonable to have to use "force_encoding" in these  
>> cases. This would
>> - give better compatibility with 1.8,
>> - make handling of methods returning ASCII-8BIT strings much easier (eg  
>> String#pack and libraries which return strings in ASCII-8BIT because the  
>> encoding is unknown)
>> - reduce the confusion caused with "\x" producing a string which depends  
>> on the source encoding (which I dislike - I think it should always  
>> return ASCII-8BIT).
>>
>> So the feature request is:
>>
>> When combining 2 strings, with one being ASCII-8BIT, and the other is  
>> encoding "E":
>> 1) If the ASCII-8BIT string is valid if forced to encoding E, then treat  
>> the ASCII-8BIT string as being in encoding E;
>> 2) Otherwise treat both strings as ASCII-8BIT.
>>
>> Part (2) is less important, and can probably be omitted if it is hard to  
>> implement.
>>
>> Thank you
>> Michael Selig
>>
>>
>> ----------------------------------------
>> http://redmine.ruby-lang.org
>
>
>


#-#-#  Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-#  http://www.sw.it.aoyama.ac.jp       mailto:duerst@it.aoyama.ac.jp     


In This Thread