1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

20 commits

Author SHA1 Message Date
matz
ab6b478615 * commit miss; and tcltklib fix too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-10-02 06:02:17 +00:00
matz
f0221db462 * re.c (rb_reg_expr_str): need to process backslashes properly.
* object.c (rb_any_to_a): declare Object#to_a to be obsolete.

* object.c (rb_Array): do not convert nil into [] automagically.

* object.c (rb_Integer): use "to_int" instead of
  "to_i". [experimental]

* object.c (nil_to_f): new method.

* object.c (rb_Integer): Symbols and nil should cause error.

* object.c (rb_Float): nil should cause error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-28 14:42:46 +00:00
nagai
4cb164ee2a * tkfont.rb: Fix bugs on TkFont.init_widget_font for Tk8.x.
* tkafter.rb: Add self to 1st argument of interval- and loop-proc
    TkAfter#current_interval returns an interval (sleep) time value
    TkAfter#current_args returns an array of arguments
    TkAfter#return_value returns a return value of last loop-proc
      e.g.
         TkAfter.new(
           proc{|obj| 500 - obj.current_interval}, 10,
           [proc{|obj| p obj.current_args}, 'proc', 1],
           proc{|obj| p obj.current_args; ['return', 2]},
           [proc{|obj|
              p obj.return_value
              p ['proc', obj.current_args[0].call(obj.return_value[1],
                                                  obj.current_args[1])]},
            proc{|*args| args[0] + args[1]}, 1],
           proc{p ['proc', 4]} ).start(100)

* tk*.rb: Allow to use Symbols for parameters.
    Allow new notation of constructor (also allow old notation).
      e.g.
        TkFrame.new('classname'=>'User'){|base|
          pack
          f = TkFrame.new(base, :classname=>'ButtonFrame').pack
          TkButton.new(
             :parent     => f,
             :text       => 'Quit',
             :command    => proc{exit}
          ).pack(
             :fill => :x,
             :pady => 2
          )
        }

* tkcanvas.rb: (TkcItem) Add 'coords' parameter to the canvas item
    constructor (for new notation of constructor).
      e.g.
        c = TkCanvas.new.pack
        l = TkcLine.new(c, :coords=>[[0,0], [100,100]])

* tcltklib.c: New 'mainloop' and 'mainloop_watchdog'.
    The priority of their event-loop can be controlled.
    They accept an optional argument.
    If it false, they don't exit although the root widget is destroyed.
    This function is sometimes useful, if it is used with 'restart'.
    'mainloop' can't treat Thread#join/value in a callback routine.
    (e.g. TkButton.new(:command=>proc{p Thread.new{button.invoke}.value}) )
    'mainloop_watchdog' can treat them, but watchdog thread is always running
    (so, a little heavier than 'mainloop').
    If the purpose of using Thread#join/value is to do something under some
    safe-level, please use Proc object.
    (e.g. :command=>proc{$SAFE=1;proc{$SAFE=2;button.invoke}.call;p $SAFE})

* tk.rb: Support functions of new 'mainloop' and 'mainloop_watchdog'.

* tk.rb: (Tk.restart) Add 'app-name' paramater and 'use' parameter.
    'app-name' specifies the name and the resource class of the
    application. If 'app-name' is specified to 'xxx', the application
    class on the resource database is set to 'Xxx' and the application
    name is changed by the same rule of Tk.appname method.  'use'
    specifies the main window for embedding the root widget instead of
    generating a new window.

* tk.rb: Add new parameter 'widgetname' to the widget constructor to
    support effective use of Resource Database.  For example, the
    resource 'Xxx*quit.text: QUIT' can set the text of the button
    generated by the following code.
      e.g.
        Tk.restart('Xxx')
        TkButton.new(nil, 'widgetname'=>'quit', 'command'=>proc{exit}).pack
        Tk.mainloop

* tk.rb: TkOption::get always returns a tainted string.
    Add TkOption::new_proc_class.
    It generates a class to import procedures defined on the resource
    database. For example, there is a following resource file.
      ----< resource-test >------------
      *CMD.foo: {|*args| p [$SAFE, :foo, args]}
      *CMD.XXX.bar: {|*args| p [$SAFE, :bar, args]}
      *Button.command: ruby {p self; p $SAFE; TkOption::CMD::XXX.bar(1,2,3)}
      ---------------------------------
    The following code is a sample of use of the resource file.
      e.g.
        require 'tk'
        TkOption.readfile 'resource-test'
        p TkOption.new_proc_class(:CMD, [:foo], 1)
        p TkOption.new_proc_class(:XXX, [:bar], 2, false, TkOption::CMD)
        TkButton.new(:text=>'test').pack
        Tk.mainloop


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-04 07:03:33 +00:00
matz
d497898c23 * eval.c (cvar_cbase): utility function to find innermost non
singleton cbase.

* eval.c (is_defined): adopt new cvar behavior.

* eval.c (rb_eval): ditto.

* eval.c (assign): ditto.

* class.c (rb_mod_clone): should not call rb_obj_clone(), since
  Module does not provide "allocate".

* class.c (rb_singleton_class): should crate new singleton class
  if obj is a class or module and attached object is different,
  which means metaclass of singleton class is sought.

* time.c (time_s_alloc): now follows allocation framework.

* eval.c (rb_eval): should initialize outer class variables from
  methods in singleton class definitions.

* eval.c (assign): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-03-08 07:03:09 +00:00
matz
e88d2cec1f * eval.c (rb_mod_include): load modules in argument order.
* st.c (st_init_table_with_size): num_bins should be prime numbers
  (no decrement).

* st.c (rehash): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-02-28 06:53:33 +00:00
matz
4f38c453b4 * eval.c (is_defined): defined?(Foo::Baz) should check constants
only, no methods.

* eval.c (is_defined): should not dump core on defined?(a::b)
  where a is not a class nor a module.

* object.c (Init_Object): remove dup and clone from TrueClass,
  FalseClass, and NilClass.

* array.c (rb_ary_fill): Array#fill takes block to get the value to
  fill.

* string.c (rb_str_to_i): to_i(0) auto-detects base radix.

* array.c (rb_ary_initialize): fill by the block evaluation value
  if block is given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-01-28 08:44:45 +00:00
matz
2e2786ccab * re.c (Init_Regexp): to_s to be alias to inspect.
* parse.y (yylex): should support 'keyword='.

* ruby.c (proc_options): should not adjust argc/argv if -e option
  is supplied.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-09-05 06:54:57 +00:00
matz
b60a365763 * eval.c (rb_mod_define_method): should have clear method cache.
* eval.c (rb_mod_define_method): should have raised exception for
  type error.

* ruby.h: changed "extern INLINE" to "static inline".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2001-03-27 07:10:58 +00:00
matz
f54418b71f matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-11-27 09:23:38 +00:00
matz
f32c76a266 matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-08-02 04:54:21 +00:00
matz
d3a6170010 matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-08-01 09:25:37 +00:00
matz
8b1de0b1ad 2000-05-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-05-24 04:34:26 +00:00
matz
fedf48986d 2000-05-01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-05-01 09:42:38 +00:00
matz
4a67017698 2000-04-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-04-10 05:57:37 +00:00
matz
7194267b3b 2000-04-10
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-04-10 05:48:43 +00:00
matz
5c13dd59db 2000-03-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-03-17 08:58:21 +00:00
matz
dde62bcd2e 2000-01-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-01-17 08:37:53 +00:00
matz
de71615260 20000105
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2000-01-05 04:41:21 +00:00
matz
a1b57d0add 1.4.1 to be
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1999-08-24 08:21:56 +00:00
matz
0a64817fb8 remove marshal/gtk/kconv
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1999-08-13 05:37:52 +00:00