Why is this invalid syntax?

18 views
Skip to first unread message

Marshall Lucas

unread,
May 7, 2012, 7:41:28 PM5/7/12
to ope...@googlegroups.com
OBJ->method()

Why must I call the method as:

OBJ->method

without the ()?  I'm allowed to use them on a function:

x = OBJ->function()

Just curious about this one as it drives me insane because I have a natural tendency toward always supplying the () for a method call.  I'm slowly learning not to do it.

Marshall

Martin Phillips

unread,
May 8, 2012, 5:58:17 AM5/8/12
to ope...@googlegroups.com

Hi Marshall,

 

Brackets would imply that it is a function that returns a value.

 

 

Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

--
You received this message because you are subscribed to the Google Groups "OpenQM" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/openqm/-/yrku2_pFytsJ.
To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openqm?hl=en-GB.

Marshall Lucas

unread,
May 8, 2012, 9:21:07 PM5/8/12
to ope...@googlegroups.com
But by that same line of thought:

OBJ->method(arg1)

would imply that it is a function but of course it doesn't, being an rvalue makes it a function, not the ().  

lvalue = OBJ->rvalue()

however:

OBJ->method() 

is simply a call to a method without supplying any arguments and not being able to use them seems a bit inconsistent when you can use them on a get (function) method.  

That's just my $0.0002 worth (not even 2 cents).

:)

Marshall

To unsubscribe from this group, send email to openqm+unsubscribe@googlegroups.com.

Martin Phillips

unread,
May 9, 2012, 12:44:23 PM5/9/12
to ope...@googlegroups.com

Hi Marshall,

 

To save further discussion on this topic, we have made a change to allow use of empty brackets on a method subroutine reference. This will be in release 3.0-2 (no date set yet).

 

 

Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton NN4 6DB, England
+44 (0)1604-709200

 

 

 

From: ope...@googlegroups.com [mailto:ope...@googlegroups.com] On Behalf Of Marshall Lucas
Sent: 08 May 2012 00:41
To: ope...@googlegroups.com
Subject: Why is this invalid syntax?

 

OBJ->method()

--

You received this message because you are subscribed to the Google Groups "OpenQM" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/openqm/-/yrku2_pFytsJ.
To post to this group, send an email to ope...@googlegroups.com.

To unsubscribe from this group, send email to openqm+un...@googlegroups.com.

Marshall Lucas

unread,
May 9, 2012, 12:58:36 PM5/9/12
to ope...@googlegroups.com
Wow!  Cool, didn't really expect it this time.  But thank you so much.  I feel quite priviledged now!
 
:)
 
Marshall

To unsubscribe from this group, send email to openqm+unsubscribe@googlegroups.com.

Dick Thiot

unread,
May 10, 2012, 8:52:32 AM5/10/12
to ope...@googlegroups.com
Martin and company are really quite amazing.  I was just reading another thread about what it takes TL to make a change to D3 and it is a vastly different attitude.  Thank you Martin.

Dick

To view this discussion on the web, visit https://groups.google.com/d/msg/openqm/-/nDpi1d6fzGYJ.

To post to this group, send an email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openqm+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages