Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Why NameError ??

Reply
Thread Tools

Why NameError ??

 
 
Kyung won Cheon
Guest
Posts: n/a
 
      08-25-2008
module M1
class A
end
end

module M2
class A
end
p A # M2::A
class B
p A # M2::A
end
end

module M3
include M1
p A # M1::A
class B
p A # NameError (M3::B::A)
end
end

##############
# Help Me^^
##############
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Sandro Paganotti
Guest
Posts: n/a
 
      08-25-2008
[Note: parts of this message were removed to make it a legal post.]

it seems that the interpreter search for a 'A' class nested inside B ... I
don't know why..

On Mon, Aug 25, 2008 at 8:54 AM, Kyung won Cheon <(E-Mail Removed)>wrote:

> module M1
> class A
> end
> end
>
> module M2
> class A
> end
> p A # M2::A
> class B
> p A # M2::A
> end
> end
>
> module M3
> include M1
> p A # M1::A
> class B
> p A # NameError (M3::B::A)
> end
> end
>
> ##############
> # Help Me^^
> ##############
> --
> Posted via http://www.ruby-forum.com/.
>
>



--
Go outside! The graphics are amazing!

 
Reply With Quote
 
 
 
 
Robert Dober
Guest
Posts: n/a
 
      08-25-2008
On Mon, Aug 25, 2008 at 10:54 AM, Kyung won Cheon <(E-Mail Removed)> wrote:
constants are not included, only methods
HTH
Robert

--
http://ruby-smalltalk.blogspot.com/

There's no one thing that's true. It's all true.
--
Ernest Hemingway

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie NameError problem MartinRinehart@gmail.com Python 10 12-13-2007 08:55 AM
nameerror upon calling function seancron Python 1 09-01-2007 04:46 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
NameError GMTaglia Python 2 10-05-2004 08:27 PM



Advertisments