[MacRuby-devel] [MacRuby] #197: A removed, or undefined, pure Objective-C method should raise a NoMethodError when called.

2009-01-06 Thread MacRuby
#197: A removed, or undefined, pure Objective-C method should raise a
NoMethodError when called.
-+--
 Reporter:  eloy.de.en...@…  |   Owner:  lsansone...@…
 Type:  enhancement  |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 Currently when removing a pure Objective-C method a warning is raised.

 However, it would be more Ruby-ish if remove_method and undef_method would
 replace the methods with a stub method which raises a NoMethodError.

 This way the user will still get a sensible error message when the
 application crashes, but will not constantly be warned when removing
 methods.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Warnings about removing methods

2009-01-06 Thread Eloy Duran
I have discussed this with Laurent and will post the results here for  
completeness.


The problem with the objc runtime is that if a method were to be  
removed and is called from the objc runtime,
it would lead to seg faults. Therefor the warning is raised, so people  
don't have to look through stack traces. Fair enough.


However, that's not what a Ruby user, like myself, would expect.
So a solution we have discussed would be to change the behaviour of  
remove_method / undef_method
on pure objc classes. It would remove the method and replace it with a  
stub which raises a NoMethodError.
So the application would still crash, as expected, but with a sensible  
message.


Some objc methods would probably still need the current warning, but  
only for methods like in Ruby Object#object_id and #__send__ etc.


http://www.macruby.org/trac/ticket/197

Cheers,
Eloy

On Jan 5, 2009, at 1:09 PM, Vincent Isambart wrote:

Is there a good reason why MacRuby would need to warn the user  
about the hazzards of removing methods?

Example:
/Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
site_ruby/mocha/class_method.rb:50: warning: removing pure  
Objective-C method `__stubba__require__stubba__' may cause serious  
problem


If you read well the error message it warns for removing a *pure  
Objective-C* method. It does not warn for methods defined in normal  
Ruby.
If my memory serves me right, removing a method is not supported by  
the Objective-C runtime. There is a work around to do it, by MacRuby  
is probably one of the rare applications to do it so it may cause  
problems.


___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Warnings about removing methods

2009-01-06 Thread Matt Mower
On Tue, Jan 6, 2009 at 9:55 AM, Eloy Duran  wrote:
> on pure objc classes. It would remove the method and replace it with a
> stub which raises a NoMethodError.

This may be a naive question but.. would it not be more appropriate to
trigger the method_missing functionality?

m/

-- 
Matt Mower :: http://matt.blogs.it/
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Warnings about removing methods

2009-01-06 Thread Eloy Duran

Yes, that might be a better option.
In my naivety, I mentioned this to Laurent as well, but it got lost in  
the discussion a bit.


So Laurent, any input?

Eloy

On Jan 6, 2009, at 11:17 AM, Matt Mower wrote:

On Tue, Jan 6, 2009 at 9:55 AM, Eloy Duran   
wrote:
on pure objc classes. It would remove the method and replace it  
with a

stub which raises a NoMethodError.


This may be a naive question but.. would it not be more appropriate to
trigger the method_missing functionality?

m/

--
Matt Mower :: http://matt.blogs.it/
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #198: Bug in class constant lookup.

2009-01-06 Thread MacRuby
#198: Bug in class constant lookup.
-+--
 Reporter:  eloy.de.en...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 MacRuby finds namespaced classes when it shouldn't:

 {{{
 module Namespace
   class Foo
   end
 end

 p Foo # => Namespace::Foo
 }}}

 Added test case to known_bugs.rb in r777

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #199: Calling super from #respond_to? causes SystemStackError

2009-01-06 Thread MacRuby
#199: Calling super from #respond_to? causes SystemStackError
-+--
 Reporter:  eloy.de.en...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 The following code results in a stack level too deep problem.
 I have added this as a test case to known_bugs.rb in r778.

 {{{
 class Foo
   def respond_to?(method, hidden = false)
 super
   end
 end

 Foo.new.respond_to?(:object_id)
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Introduction

2009-01-06 Thread Giampiero De Ciantis
Hi everyone,

I am new to the mailing list. Looking forward to watching MacRuby
evolve. Would love to help somehow.

-Gp
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #198: Bug in class constant lookup.

2009-01-06 Thread MacRuby
#198: Bug in class constant lookup.
-+--
 Reporter:  eloy.de.en...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--

Comment(by vincent.isamb...@…):

 Duplicate of #182

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #182: The constant lookup in MacRuby does not behave correctly

2009-01-06 Thread MacRuby
#182: The constant lookup in MacRuby does not behave correctly
+---
 Reporter:  vincent.isamb...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:   
Component:  MacRuby |Keywords:   
+---

Comment(by eloy.de.en...@…):

 Added failing test in r777

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #198: Bug in class constant lookup.

2009-01-06 Thread MacRuby
#198: Bug in class constant lookup.
-+--
 Reporter:  eloy.de.en...@…  |Owner:  lsansone...@…
 Type:  defect   |   Status:  closed   
 Priority:  blocker  |Milestone:   
Component:  MacRuby  |   Resolution:  duplicate
 Keywords:   |  
-+--
Changes (by eloy.de.en...@…):

  * status:  new => closed
  * resolution:  => duplicate


-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel