From: Takaaki Tateishi Date: 2002-03-11T18:49:09+09:00 Subject: ruby-dev summary 16126-16200 The follows are ruby-dev summaries. This work will join RubyGarden after a few weeks. [ruby-dev:16134] Defining (Python) Source Code Encoding Masayoshi Takahashi asks if we define the source code encoding using "-*- coding: -*-" as follows: #!/usr/bin/ruby # -*- coding: -*- In case we enter above lines in our code, ruby will choose the specified encoding. This is the discussion around: PEP 0263 http://python.sourceforge.net/peps/pep-0263.html in the python community: Python-Dev http://mail.python.org/pipermail/python-dev/2002-February/thread.html#20350 Nobu Nakada posts a patch in [ruby-dev:16188] to implement the idea. (*) This patch have not been merged yet. The similar idea has been also proposed by Koji Arai in ruby-dev before. This idea, to specify the encoding at the first line, is however not recommended because of some restrictions for #!. [ruby-dev:16138] Hash implementation Naoyuki Morita writes "Hash seems to lose its efficiency if its size get bigger than 1000 since table->num_bins is initialized by 11.". However, since it can be dynamically extended, the efficiency seems to be independent of table->num_bins. [ruby-dev:16154] : and :: Hara Shinichiro writes "How about changing operator priorities of : and :: to obtain a value of "Foo::Bar".intern by :Foo::Bar?". Matz doesn't agree with this suggestion since both of the string "Foo::Bar" and the symbol "Foo::Bar" doesn't have a relation to an expression Foo::Bar. [ruby-dev:16159] autoload Matz writes "I'd like to discard the autoload mechanism.". He think that checking the fallback is needed before retrieving a constant of a parent class whenever we use a constant, and the cost of checking isn't negligible. Akihiko Morohoshi proposes another idea with a patch in [ruby-dev:16165]. That is to substitute a dummy object instread of a target object. When we obtain the dummy object using rb_const_get(), the autoload is executed. [ruby-dev:16196] Oni Guruma imported into our repository Musha Akinori commits "Oni Guruma" into the cvs repository. (*) "Oni Guruma" is another regular expression library mentioned in [ruby-dev:16070]. -- Takaaki Tateishi