first question as titled. otherwise, what''s their relationship?? i had confuse about it. and what''s the building package and class (do need to "require", like java.lang.* in Java )? how do i know it? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby Nudy
2007-Sep-18 17:43 UTC
Re: Why Ruby has 2 APIs(Ruby Core API&Ruby Standard API)??
I mean "require" no need, just like java.lang.* in Java On Sep 19, 1:27 am, Ruby Nudy <mis.jerr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> first question as titled. > > otherwise, what''s their relationship?? i had confuse about it. > > and what''s the building package and class (do need to "require", like > java.lang.* in Java )? how do i know it?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hugh Sasse
2007-Sep-18 18:06 UTC
Re: Why Ruby has 2 APIs(Ruby Core API&Ruby Standard API)??
On Tue, 18 Sep 2007, Ruby Nudy wrote:> > I mean > > "require" no need, just like > java.lang.* in Java > > On Sep 19, 1:27 am, Ruby Nudy <mis.jerr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > first question as titled. > > > > otherwise, what''s their relationship?? i had confuse about it.Classes and modules in the core are available without doing require. Classes and modules in the standard library are brought in with require, but there is not a one-to-one mapping like in Java. You can require a file that defines 3 modules and 2 classes, for example.> > > > and what''s the building package and class (do need to "require", like > > java.lang.* in Java )? how do i know it?You need to read the documentation for each library that you use, to know it. If you are coming from java there are resources for people taking that route, including a book. I have not read this book: http://www.pragmaticprogrammer.com/title/fr_j2r/ Search google: ruby for java It turns up many pages. Hope this helps, Hugh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby Nudy
2007-Sep-18 18:25 UTC
Re: Why Ruby has 2 APIs(Ruby Core API&Ruby Standard API)??
huh?? for example, "PP", i can find this package in both APIs. but need "require", so i still confuse. >"< arr = ["apple", "orange", "watermelon"] pp arr #=> hello.rb:4: undefined method `pp'' for main:Object (NoMethodError) require "pp" arr = ["apple", "orange", "watermelon"] pp arr #=>["apple", "orange", "watermelon"] On Sep 19, 2:06 am, Hugh Sasse <h...-C9usXPTk/FFaa/9Udqfwiw@public.gmane.org> wrote:> On Tue, 18 Sep 2007, Ruby Nudy wrote: > > > I mean > > > "require" no need, just like > > java.lang.* in Java > > > On Sep 19, 1:27 am, Ruby Nudy <mis.jerr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > first question as titled. > > > > otherwise, what''s their relationship?? i had confuse about it. > > Classes and modules in the core are available without doing require. > Classes and modules in the standard library are brought in with require, > but there is not a one-to-one mapping like in Java. You can require a > file that defines 3 modules and 2 classes, for example. > > > > > > and what''s the building package and class (do need to "require", like > > > java.lang.* in Java )? how do i know it? > > You need to read the documentation for each library that you use, to know it. > > If you are coming from java there are resources for people taking that > route, including a book. I have not read this book: > > http://www.pragmaticprogrammer.com/title/fr_j2r/ > > Search google: ruby for java > It turns up many pages. > > Hope this helps, > Hugh--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---