From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id D87C017C239B for ; Tue, 5 Jul 2011 22:35:02 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id DBFC4EA6692 for ; Tue, 5 Jul 2011 22:46:31 +0900 (JST) Received: from localhost (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id F26EA8FC1B for ; Tue, 5 Jul 2011 22:46:32 +0900 (JST) X-Virus-Scanned: amavisd-new at funfun.nagaokaut.ac.jp Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by localhost (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PUKirQcoKQAH for ; Tue, 5 Jul 2011 22:46:32 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id CFF748FC19 for ; Tue, 5 Jul 2011 22:46:32 +0900 (JST) Received: from carbon.ruby-lang.org (carbon.ruby-lang.org [221.186.184.68]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id A7549952421 for ; Tue, 5 Jul 2011 22:46:28 +0900 (JST) Received: from beryllium.ruby-lang.org (beryllium.ruby-lang.org [127.0.0.1]) by carbon.ruby-lang.org (Postfix) with ESMTP id B2A133C21F72E; Tue, 5 Jul 2011 22:46:27 +0900 (JST) Received: from fluorine.ruby-lang.org (www.rubyist.net [210.251.121.216]) by carbon.ruby-lang.org (Postfix) with ESMTP id 383CF3C21EB50 for ; Tue, 5 Jul 2011 22:46:25 +0900 (JST) Received: from ruby-lang.org (localhost [127.0.0.1]) by fluorine.ruby-lang.org (Postfix) with ESMTP id 2127B3ED40 for ; Tue, 5 Jul 2011 22:46:25 +0900 (JST) Delivered-To: ruby-core@ruby-lang.org Date: Tue, 5 Jul 2011 22:46:25 +0900 Posted: Tue, 5 Jul 2011 22:46:25 +0900 From: Lazaridis Ilias Reply-To: ruby-core@ruby-lang.org Subject: [ruby-core:37797] [Ruby 1.9 - Bug #4893] Literal Instantiation breaks Object Model To: ruby-core@ruby-lang.org Message-Id: References: X-ML-Name: ruby-core X-Mail-Count: 37797 X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only members can post) X-ML-Info: If you have a question, send e-mail with the body "help" (without quotes) to the address ruby-core-ctl@ruby-lang.org; help= X-Mailer: Redmine X-Spam-Checker-Version: SpamAssassin 3.1.7-deb3 (2006-10-05) on carbon.ruby-lang.org X-Spam-Level: X-Spam-Status: No, score=0.9 required=7.0 tests=BAYES_50,CONTENT_TYPE_PRESENT, FAKEDWORD_VERTICALLINE,FORGED_RCVD_HELO,RCVD_IN_CHINA, RCVD_IN_CHINA_KR,RCVD_IN_TAIWAN,X_MAILER_PRESENT autolearn=disabled version=3.1.7-deb3 X-Redmine-Issue-Author: lazaridis.com X-Redmine-Issue-Assignee: matz X-Redmine-Issue-Id: 4893 X-Redmine-Mailinglistintegration-Message-Ids: 7047 X-Redmine-Project: ruby-19 Auto-Submitted: auto-generated X-Redmine-Site: Ruby Issue Tracking System X-Redmine-Host: redmine.ruby-lang.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Precedence: bulk List-Id: ruby-core.ruby-lang.org List-Software: fml [fml 4.0.3 release (20011202/4.0.3)] List-Post: List-Owner: List-Help: List-Unsubscribe: Issue #4893 has been updated by Lazaridis Ilias. Yukihiro Matsumoto wrote: > |DEFINITION: > | > |What do you mean with "global status"? > > That something you implemented by the C global variable in this case. * I do not use a "C global variable", but a class-object variable. * There is no "global status", but a class-object status. > |Would it be still a "global status", if the flag would be set automatically and internally, without user intervention? > > Depends on the automatic set strategy, which you haven't told me. I've described the outline. But it would be nice if you would tell me a strategy, which would make you accept that it's not a "global status". Possibly this way I can understand your interpretation "global status". > |INFLUENCE: > | > |Why is it not acceptable? > > The global status tends to make program behavior unpredictable, > especially under threading environment. I understand that, but this is not the case here: VARIABLE: * I don't use *any* global variable (but an internal class-object scope variable) * I use the same (string-)class-object scope flags that are used *excessively* within the existent ruby source-codes. STATUS: * The status is class-object-bound (exactly as the status "redefined initialize method exists" is) * The test-all passes (with an activated redefined String#initialize) At this point, if you still have objections, I ask you friendly to demonstrate them with test-code. This issue is far to deep to be handled with words. [And may I remind you that this issue is still on status "rejected". This is not the way issues are processed: if they exist, they are open/assigned/feedback, until rejected/closed.] ---------------------------------------- Bug #4893: Literal Instantiation breaks Object Model http://redmine.ruby-lang.org/issues/4893 Author: Lazaridis Ilias Status: Rejected Priority: Normal Assignee: Yukihiro Matsumoto Category: Target version: ruby -v: 1.9.2 #String2.rb class String def initialize(val) self.replace(val) puts object_id end def my_method_test 'has method ' end end # command line $ irb irb(main):001:0> original = String.new("original") => "original" irb(main):002:0> load "String2.rb" => true irb(main):003:0> altered = String.new("altered") 21878604 => "altered" irb(main):004:0> altered.my_method_test => "has method " irb(main):005:0> literal = "literal" => "literal" irb(main):006:0> literal.my_method_test => "has method " irb(main):007:0> - The initialize method is an integral part of the class String. >From the moment that "String2.rb" is loaded, the initialize method of class String has been validly redefined. (The behaviour of the String class within the "irb session" is altered) The altered initialize method is now an integral part of the class String. The altered String object behaves as expected (responds to "my_method_test, initialized via redefined initialize method). The String(Literal) object responds to "my_method_test", but it is was not initialized with the redefined initialize method. - The "Literal Instantiation" calls the original (core-C-level) String initialize method instead of the redefined one (user-language-level). This *breaks* the object model. -- http://redmine.ruby-lang.org