Forum: Ruby Isn't :: a method? How to define?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fe57662c550fb3cce44c398ddf2dd706?d=identicon&s=25 itsme213 (Guest)
on 2006-03-30 23:16
(Received via mailing list)
SyntaxError: compile error
(irb):2: syntax error
def ::(x)

Thanks.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 Eric Hodel (Guest)
on 2006-03-30 23:43
(Received via mailing list)
On Mar 30, 2006, at 1:13 PM, itsme213 wrote:

> SyntaxError: compile error
> (irb):2: syntax error
> def ::(x)

It isn't a method, its syntax.

--
Eric Hodel - drbrain@segment7.net - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-03-31 00:02
(Received via mailing list)
On Mar 30, 2006, at 4:39 PM, Eric Hodel wrote:

> This implementation is HODEL-HASH-9600 compliant
>
> http://trackmap.robotcoop.com
>
>
>

In fact it's very similiar to dot (.). You wouldn't expect to be able
to redefine that, would you?
Fe57662c550fb3cce44c398ddf2dd706?d=identicon&s=25 itsme213 (Guest)
on 2006-03-31 00:56
(Received via mailing list)
Ah. So it's short for const_get? Maybe I can still use it.


"Logan Capaldo" <logancapaldo@gmail.com> wrote in message
news:C73E3A75-34E0-4EF4-AA46-B79D84F7C4EC@gmail.com...
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-03-31 05:02
(Received via mailing list)
On Mar 30, 2006, at 5:53 PM, itsme213 wrote:

> Ah. So it's short for const_get? Maybe I can still use it.
>

It's not exactly short for const_get either:

class A
   def self.class_meth
         puts "hi"
   end
   A_CONST  = 7
end

A::class_meth
puts A::A_CONST

hi
7


In fact its const_get or perform method, dpeneding whether or not the
constant exists
This topic is locked and can not be replied to.