Ncurses module inclusion question
lizzy:~% cat n
lizzy:~% ruby n 2> err
lizzy:~% cat err
n:12: undefined local variable or method `initscr' for main:Object (NameError)
Why does including Ncurses not have the same effect as including Math?
jos at catnook.com
Re: Ncurses module inclusion question
Its a weird quirky feature I don't really understand - but managed to
put together this: I have to guess that Ncurses is defining a 'normal'
module, whereas I know (from my book!) that the Math library used
(My program but based on "The Ruby Programming Language : ISBN-10:
0-596-51617-7 , O'Reilly, Page 248 onwards (esp: page 251 "Includable
puts "method1 called"
puts "method2 called"
method1 # this will work.
method2 #this will fail
Also note: if you do:
You'll see that Object hasn't really grown a new method at all - it's
all a big trick ;-)
Posted via http://www.ruby-forum.com/.
|All times are GMT. The time now is 10:54 PM.|
SEO by vBSEO ©2010, Crawlability, Inc.