[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Its Me

3/30/2006 9:12:00 PM

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

Thanks.


4 Answers

Eric Hodel

3/30/2006 9:40:00 PM

0

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.se...
This implementation is HODEL-HASH-9600 compliant

http://trackmap.rob...




Logan Capaldo

3/30/2006 10:01:00 PM

0


On Mar 30, 2006, at 4:39 PM, Eric Hodel wrote:

> 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.se...
> This implementation is HODEL-HASH-9600 compliant
>
> http://trackmap.rob...
>
>
>

In fact it's very similiar to dot (.). You wouldn't expect to be able
to redefine that, would you?



Its Me

3/30/2006 10:53:00 PM

0

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...
>
> On Mar 30, 2006, at 4:39 PM, Eric Hodel wrote:
>
>> 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.se...
>> This implementation is HODEL-HASH-9600 compliant
>>
>> http://trackmap.rob...
>>
>>
>>
>
> In fact it's very similiar to dot (.). You wouldn't expect to be able to
> redefine that, would you?
>
>
>


Logan Capaldo

3/31/2006 3:02:00 AM

0


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


>
> "Logan Capaldo" <logancapaldo@gmail.com> wrote in message
> news:C73E3A75-34E0-4EF4-AA46-B79D84F7C4EC@gmail.com...
>>
>> On Mar 30, 2006, at 4:39 PM, Eric Hodel wrote:
>>
>>> 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.se...
>>> This implementation is HODEL-HASH-9600 compliant
>>>
>>> http://trackmap.rob...
>>>
>>>
>>>
>>
>> In fact it's very similiar to dot (.). You wouldn't expect to be
>> able to
>> redefine that, would you?
>>
>>
>>
>
>
>