[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Is this old style Ruby?
From:       Florian Gross <flgr () ccan ! de>
Date:       2005-02-15 16:59:56
Message-ID: 37eo1mF5aoopsU1 () individual ! net
[Download RAW message or body]

Austin Ziegler wrote:

> The difference between :: and . is that :: is used to access constants
> or methods and . is used exclusively to access methods. For fun, try
> doing:
> 
>   "foo"::length

And you can not use :: for accessing methods that start with an 
uppercase letter:

irb(main):001:0> def Xing(); end; self::Xing
TypeError: main is not a class/module

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic