subjects 199-435

Welcome to the ruby-core mailing list
0001 [matz@ru y- a] Welcome to the ruby-core mailing list.  This is a develpers

Welcome to the ruby-core mailing list
0001 [matz@ru y- a] Welcome to the ruby-core mailing list.  This is a develpers
0002 [knu@iD em ns] Yay, at last!  I've always wanted to have a list that's oriented for

[Cleanup] GC
0003 [m.rokos@sh c] for the beginning I'll start with the very easy cleanup, just to
0004 [matz@ru y- a] Merged.  Thank you.

[Patch] Licence tags & tiny mini cleanup
0005 [m.rokos@sh c] because it's Sunday and I should have a rest, I'm sending just

[patch] Warnings on Solaris
0006 [larsch@cs au] I reorganized a couple of #include statements to avoid this warning on
0008 [m.rokos@sh c] I just noticed that your cleanups were imported to CVS thanks

Useless patch...
0007 [m.rokos@sh c] yesterday I read through array.c and made some comments for my
0009 [matz@ru y- a] * I'm not sure whether we don't need size adjustment in
+ 0010 [m.rokos@sh c] Thanks for them!
| 0012 [matz@ru y- a] Approved.
+ 0011 [matz@ru y- a] Type.  "it will *not* be a problem".
  0013 [vjoel@PA H. ] Are you talking about the code that shrinks an array if the length is

0014 [m.rokos@sh c] irb(main):001:0> RUBY_VERSION
+ 0015 [nobu.nokada@] It's intended.  String#oct recognizes prefixes "0", "0x" and
| 0016 [m.rokos@sh c] Could you state some reasons for it?
| 0017 [nobu.nokada@] there was no other way to do it automatically.
+ 0018 [matz@ru y- a] String#oct understands base prefix (i.e. 0x, 0b, 0).  It's intended
  0028 [m.rokos@sh c] Thanks nobu, matz for explanation.

Re: [BUG] thread failure after trap
0019 [nobu.nokada@] # Moving to ruby-core.
0020 [decoux@mo lo] If I've well understood, a signal is always run in the main thread.
+ 0021 [nobu.nokada@] Yes.
| 0022 [decoux@mo lo] Not understood : ruby must test if some other signal are pending.
| 0025 [nobu.nokada@] I meant no need to *restore*.  Regardless of current thread,
+ 0023 [nobu.nokada@] I read it and noticed rb_thread_schedule() is unnecessary to
  + 0024 [decoux@mo lo] This is better for me, perhaps add
  | 0026 [nobu.nokada@] It's better after rb_thread_schedule(), no?  While thread switched,
  | 0027 [decoux@mo lo] yes
  + 0029 [decoux@mo lo] $SAFE must be restored or not ?
    0030 [nobu.nokada@] I'm not sure, but guessed handler's context should differ from

Ruby obsolete
0031 [m.rokos@sh c] how about disable obsolete/deprecated things in Ruby. It could
0034 [matz@ru y- a] I don't take it.  a) They are part of the library even though they
0037 [m.rokos@sh c] There is #if !defined(RUBY_NO_OBSOLETE) - so it's enabled by
0038 [matz@ru y- a] getc is obsolete because
0039 [m.rokos@sh c] Hmm - thanks for info. (I should study more :-)

Long fmt?
0032 [m.rokos@sh c] shouldn't be in rb_raise and other places stated %ld instaed of
0035 [matz@ru y- a] Agreed.  Can you commit them as your first try?

[Cleanup] Array #2
0033 [m.rokos@sh c] sorry - I've been out for a while. (Thanks for commiting cleanup
0036 [matz@ru y- a] In fact, I don't care.  No one would notice the difference.  So if you

ToDo details?
0040 [m.rokos@sh c] do you think that 'ToDo' document could be more detailed so
0041 [matz@ru y- a] I'm usually on-demand-mode.  Feel free to ask me. ;-)

Re: possible bug: stack dump with <<-String, #{...} and large loops
0042 [decoux@mo lo] [[ moved to ruby-core ]]
0043 [nobu.nokada@] Oops.  Throw awy the second added line.
+ 0044 [decoux@mo lo] pigeon% cat b.rb
| 0090 [nobu.nokada@] ...
+ 0045 [decoux@mo lo] Well, expect have a special rb_compile_dstr() (to set a flag in this
  0046 [nobu.nokada@] Like this?
  0047 [decoux@mo lo] Yes, but I really hate the following line (I hope that nobody on this list
  0048 [decoux@mo lo] bad, very bad patch
  0049 [nobu.nokada@] I'm not sure how bad, how about this?
  0050 [decoux@mo lo] If ruby fail and the user has protected the call via (begin ... rescue)
  0051 [nobu.nokada@] # may misunderstand what you mean...
  0052 [decoux@mo lo] begin "#{a = 1:}"; rescue SyntaxError; end
  0053 [nobu.nokada@] Oops, RVarmap's in compilation time should be swept away at a
  0054 [decoux@mo lo] eval "x = 12"
  0055 [nobu.nokada@] Another approach.
  0056 [decoux@mo lo] Seems better,
  0057 [nobu.nokada@] ...
  + 0058 [matz@ru y- a] Commit them please.
  + 0065 [decoux@mo lo] Except that it exist a very special case if I'm right
    0084 [nobu.nokada@] Exactly, sigh...
    + 0092 [decoux@mo lo] ruby is in a case of undefined behaviour (i.e. it try to access a memory
    | 0093 [nobu.nokada@] But it means to push a dummy dvar *after* the expression.
    | 0094 [decoux@mo lo] No it is in top_local_init(), i.e. this will be the first node executed by
    | 0095 [nobu.nokada@] I see.
    | + 0096 [decoux@mo lo] No, you make the confusion between an effect at compile time and runtime.
    | | 0099 [nobu.nokada@] ...
    | | 0100 [decoux@mo lo] pigeon% cat b.rb
    | | 0101 [chr_news@gm ] Probably this isn't very helpful - but without
    | | 0103 [decoux@mo lo] The output is normal, for me.
    | | 0104 [decoux@mo lo] Is it not possible to find an unique name based on the name of the file
    | | 0105 [nobu.nokada@] Rather, it may be better on address of NODE_EVSTR and count of
    | | + 0106 [decoux@mo lo] Well, the other possibility is that PUSH_VARS() always push a place holder
    | | | + 0107 [nobu.nokada@] I'm thinking it must be, no other way to solve [ruby-core:00100].
    | | | | 0108 [decoux@mo lo] It exist just a small problem with #defined? which will return
    | | | | 0109 [nobu.nokada@] In ruby level, there is no diferrence between local variable
    | | | | 0110 [decoux@mo lo] Yes, but it was more for the user perhaps someone can be surprised with
    | | | | 0111 [nobu.nokada@] Well, the probability may not be 0 but very close to, I gueses.
    | | | + 0112 [nobu.nokada@] ...
    | | |   + 0113 [decoux@mo lo] Seems good, for me
    | | |   + 0121 [nobu.nokada@] It seems to be merged to CVS HEAD, so may I commit to 1.6 too?
    | | |     0123 [decoux@mo lo] Personally I must never say "Seems good, for me" because generally I find
    | | + 0125 [decoux@mo lo] Why not the address of the node ?
    | |   0126 [nobu.nokada@] I should write `the address of the node and the ordinal number
    | |   0127 [decoux@mo lo] Well, I've said one more stupidity, sorry :-(
    | |   0130 [nobu.nokada@] rb_svar() searches a dynamic variable whose id is in local_tbl,
    | |   0132 [nobu.nokada@] I might misunderstand, did you mean the issue like
    | |   0134 [decoux@mo lo] No, there is worst
    | |   + 0135 [decoux@mo lo] and with this ?
    | |   | 0137 [decoux@mo lo] and the same for FLIP3 :-(
    | |   | 0139 [nobu.nokada@] Making flip variables static causes a problem with threads.
    | |   | 0141 [decoux@mo lo] Yes, and they can only be managed with a special table (like local_tbl)
    | |   + 0138 [matz@ru y- a] ...aagghh,  let us re-compile code chunks each time, and abandon
    | |     + 0140 [decoux@mo lo] Not really sure, but I think that it's not used in lib/*
    | |     + 0142 [nobu.nokada@] ...
    | |       + 0143 [decoux@mo lo] Not yet completely look at it (I prefer wait), but if I'm right you
    | |       | 0147 [nobu.nokada@] If there were too many, 10,000 local variables, the index may
    | |       | 0148 [decoux@mo lo] Well, I really want to see the def with 10 000 local variables :-)
    | |       + 0155 [nobu.nokada@] ...
    | + 0097 [decoux@mo lo] OK, I've seen the problem (I think)
    |   0098 [nobu.nokada@] [ruby-core:00090] means CVS head, not 00053.  It is merged both
    + 0181 [nobu.nokada@] Tried.

yyparse() and friends >> rubyparse() or rbparse()...
0059 [sean@ru y- a] Would it be possible to add '-p ruby' to the bison command line args
0060 [matz@ru y- a] I think plain yacc does not accept '-p'.  Many users compiled Ruby
+ 0061 [sean@ru y- a] All -p does is add a few #defines for build time at the top of the
| 0063 [matz@ru y- a] We already have those #defines in intern.h, so do you mean you want to
| 0064 [sean@ru y- a] Hmm... let me look at the code.  Looks like this is even easier to
| 0066 [sean@ru y- a] Err... the previous patch didn't break ruby, but didn't fix my
| 0068 [matz@ru y- a] Merged (for 1.7).  Thank you.  Wait little bit to be committed.
+ 0062 [nobu.nokada@] BSD origin and SUSv2 yacc's also accept, but older SystemV-like

The warns-a-thon continues...
0067 [sean@ru y- a] I'm feeling left out in this race to clobber warnings!!!  Attached are
+ 0069 [matz@ru y- a] I've merged some of them.  But *I hate ((a = f())), so that I didn't
| + 0081 [sean@ru y- a] Alright.  I like running with -Wall.
| | 0083 [nobu.nokada@] Certainly.
| | 0087 [sean@ru y- a] Yes.  ctype.h still needs to be included.  I'm a very BSD UNIX centric
| + 0088 [eban@os ri .] How about #if ... #endif?
|   0089 [matz@ru y- a] It should have.  Can you commit the fix?  Thank you.
|   0091 [eban@os ri .] Sure. Done.
+ 0070 [eban@os ri .] Don't change all mechanically.
  + 0071 [sean@ru y- a] I looked over these for a few minutes and couldn't see any harm in,
  | + 0072 [sean@ru y- a] ...
  | | + 0075 [nobu.nokada@] These "cleanup"s may not work for all compilers.  If you really
  | | | 0082 [sean@ru y- a] Either (()) or ((a) != 0) are pretty superficial and only matter in
  | | + 0079 [m.rokos@sh c] Sean, others,
  | + 0073 [decoux@mo lo] pigeon% cat a.c
  + 0074 [nobu.nokada@] `%lc' means wide char, shouldn't it use cast?
    0076 [eban@os ri .] You're right.
    + 0080 [nobu.nokada@] It seems better than u2.argc.
    + 0085 [matz@ru y- a] or change argc's type to int.

[Fix] Long Fmt #2
0077 [m.rokos@sh c] I just commited LongFmt#1 patch
0078 [m.rokos@sh c] I just spotted that there is already 1 patch about it.

rb_hash_has_key() and friends non-static...
0086 [sean@ru y- a] ...
0117 [sean@ru y- a] At the moment I'm writing an appendix Beginning Ruby Programming
+ 0118 [vjoel@PA H. ] and rb_mod_lt and the like, please, please, pretty please?
+ 0119 [nobu.nokada@] The name "ruby_hash.h" doesn't seem so good, for me.
  0120 [sean@ru y- a] How about just "hash.h" ?  It does seem like overkill to have "ruby_"
  + 0122 [nobu.nokada@] How about other data structures, all headers like "array.h",
  | 0128 [sean@ru y- a] Documentation primarily and ease of use of the API.  intern.h would
  | 0133 [nobu.nokada@] Basically I guess it's good.
  + 0124 [chris@da kr ] How about file system name conflicts? -> with ruby_ you atleast can

lib/complex.rb runtime warning...
0102 [sean@ru y- a] While using ruby-gnuplot I noticed that lib/complex.rb tosses up a

exception while ruby_connect() (Re: Possible Bug in Ruby?)
0114 [nobu.nokada@] ...
0115 [nobu.nokada@] ...
0116 [matz@ru y- a] This patch seems OK.  Commit it, please.

[Trivial] Gcc3.1 warning
0129 [m.rokos@sh c] Gcc 3.1 warns badly when compiling with -Wall.
0131 [matz@ru y- a] Thank you.  Go ahead and commit.
0136 [m.rokos@sh c] Not at all!

Another implementation of Bignum
0144 [dmitry.antip] I'm working on a new implementation of Bignum, which is based on
+ 0145 [decoux@mo lo] I've not understood : the core of ruby is modified ?
+ 0146 [matz@ru y- a] I am.  I even consider about merging it into 1.7 if it is drop-in

valgrind and ruby (long)
0149 [pate@ey er a] development work on Ruby.  Take everything I say with a grain of salt.
0150 [decoux@mo lo] Be carefull with this, if you really want to see if ruby has memory leak

Re: Another implementation of Bignum [tarball attached]
0151 [dmitry.antip] ...
0152 [matz@ru y- a] This is round-up difference.  Ruby (and Python) use floor.  GMP
0160 [matz@ru y- a] One more note: this kind of enhancement will never be merged to the
0162 [chr_news@gm ] Thanks!
0163 [dmitry.antip] Yes (for now, shifts by n a naive multiplication/division by 2^n :-()

Hardcoded magic numbers
0153 [dmitry.antip] IMHO this is not clean to have magic limits inside the interpreter.
0154 [decoux@mo lo] It's best if you look at the source of 1.7
0156 [dmitry.antip] I do (RUBY_VERSION "1.7.2", RUBY_RELEASE_DATE "2002-06-04"
0157 [decoux@mo lo] Well, here what I've

ruby-mode.el - zmacs regions friendly
0158 [edsin@sw s. ] ...
0159 [matz@ru y- a] This breaks ruby-mode on plain Emacs.  What does these "_" mean?
0164 [edsin@sw s. ] ...

Re: Another implementation of Bignum [I'm working with 1.7.2]
0161 [dmitry.antip] development version (the lastest CVS trunk).

Re: Another implementation of Bignum [patch agains CVS trunk]
0165 [dmitry.antip] ...

Bignum bug
0166 [chr_news@gm ] the changes 1.43-1.44 and back in
0167 [matz@ru y- a] You get the same result from Python too.
0168 [chr_news@gm ] Which version are you using? With Python 2.2 (cygwin
0170 [matz@ru y- a] I was using Python 2.1.3.
0173 [chr_news@gm ] ``Googleing around'' I found

[Request] to make 'warn_print' public
0169 [m.rokos@sh c] do you think that could be possibe to make 'warn_print' function
0171 [decoux@mo lo] Why you don't use rb_warn(), rb_warning(), ... ?
0172 [m.rokos@sh c] I need to make my own implementation of ..._warn and _warning...

Improving Ruby's garbage collector for interactive apps
0174 [mattbee@so p] I'd like to try to take this problem in hand and alter Ruby's garbage
0177 [matz@ru y- a] Yes and yes.  Generational mark and sweep algorithm was done before,
0178 [mattbee@so p] Which algorithm in particular, and how was the barrier implemented?  Did you
0179 [matz@ru y- a] It's based on linked generations, and the barrier was implemented by
+ 0180 [vjoel@PA H. ] My experience with Boehm GC was that it was (apparently) incompatible
+ 0182 [ekarttun@cs ] Gwydion Dylan (www.gwydiondylan.org) uses the Boehm GC, but I don't
+ 0183 [mattbee@so p] Sure; though there's no reason two different GC routines couldn't be used on
  0185 [mattbee@so p] PS If anyone in the UK wants to see this problem in action, go into your

lib/pstore.rb patch...
0175 [sean@ru y- a] ...
0176 [matz@ru y- a] I'd change in a different manner, but point taken anyway.

0184 [decoux@mo lo] I've had some free times to look at this.
0226 [matz@ru y- a] Merged.  Thank you, and sorry for being late.

Steps to get multiple interpreters per process...
0186 [sean@ru y- a] Can someone chart out what would need to happen to get multiple ruby
0187 [matz@ru y- a] We have to list all global variables and pack everything into a
+ 0188 [sean@ru y- a] Makes sense.  What I don't fully understand (I've been staring at this
| 0191 [chris@da kr ] The YACC parser can be made re-entrant by using Bison and the directive
| 0192 [decoux@mo lo] How do you do it ?
| 0193 [chris@da kr ] I store all things that are related to a execution instance in a
| 0194 [decoux@mo lo] OK, this mean modify all extensions written in C, right ?
| 0195 [chris@da kr ] Sure, it can be done with a define. You just stumble upon the issue
+ 0189 [matt@li ke .] I imagine there might also be issues with Ruby stuff that touches the
  0190 [matz@ru y- a] process-wise states are often ignored by multiple interpreter

[Fix] nil#to_f missing
0196 [m.rokos@sh c] nil#to_f is not stated in define_method.
+ 0197 [matz@ru y- a] Yes.  But I ask you to leave "default" in rb_Integer() switch.
+ 0198 [nobu.nokada@] Why return the Float itself without calling to_int?