<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV>What happens when you execute:</DIV>
<DIV>&nbsp;</DIV>
<DIV>true =&gt; lisaLeft.record;</DIV>
<DIV>&nbsp;</DIV>
<DIV>is that you assign “"the value of true to the object property 
lisaLeft.record, but because of the way the chuck operator is overloaded, this 
is converted to:</DIV>
<DIV>&nbsp;</DIV>
<DIV>lisaLeft.record(true);</DIV>
<DIV>&nbsp;</DIV>
<DIV>However if you do something like</DIV>
<DIV>&nbsp;</DIV>
<DIV>&lt;&lt;&lt;listLeft.record&gt;&gt;&gt;;</DIV>
<DIV>or &lt;&lt;&lt;startRecording&gt;&gt;&gt;;</DIV>
<DIV>&nbsp;</DIV>
<DIV>where “startRecording” has the value of the function you defined, then 
you’ll get the address of the function object itself. So, I imagine then if you 
simply execute</DIV>
<DIV>&nbsp;</DIV>
<DIV>startRecording;</DIV>
<DIV>&nbsp;</DIV>
<DIV>nothing should happen – its the same as executing </DIV>
<DIV>&nbsp;</DIV>
<DIV>24;</DIV>
<DIV>&nbsp;</DIV>
<DIV>- the parser just throws it away. If the function you defined had 
arguments, then executing</DIV>
<DIV>&nbsp;</DIV>
<DIV>startRecording;</DIV>
<DIV>&nbsp;</DIV>
<DIV>would give you a compilation error because it expected arguments and didn’t 
get any.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-- Rich</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV 
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV style="FONT: 10pt tahoma">
<DIV><FONT size=3 face=Calibri></FONT>&nbsp;</DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=stefan.blixt@gmail.com 
href="mailto:stefan.blixt@gmail.com">Stefan Blixt</A> </DIV>
<DIV><B>Sent:</B> Friday, September 19, 2014 5:21 PM</DIV>
<DIV><B>To:</B> <A title=chuck-users@lists.cs.princeton.edu 
href="mailto:chuck-users@lists.cs.princeton.edu">ChucK Users Mailing List</A> 
</DIV>
<DIV><B>Subject:</B> [chuck-users] Forgetting parenthesis in function calls 
yields noerror</DIV></DIV></DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV 
style='FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline'>
<DIV dir=ltr>Hello list! 
<DIV>&nbsp;</DIV>
<DIV>I just spent a little time scratching my head over these little 
functions:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>fun void startRecording() {</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>&lt;&lt;&lt; "Record! ", index 
&gt;&gt;&gt;;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>true =&gt; lisaLeft.record;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>true =&gt; lisaRight.record;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>}</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>fun void toggle() {</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>!active =&gt; active;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>paintActive();</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>if (active) {</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>startRecording;</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV><SPAN style="WHITE-SPACE: pre"></SPAN>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>Everything seemed to be in order, I added a lot of print statements, and 
could for the life of me figure out why the startRecording function wasn't 
executed from toggle(). There was no error message, everything seemed to be in 
order. Then I peered more closely and saw that I had forgotten to put 
parenthesis in the function call:</DIV>
<DIV>&nbsp;</DIV>
<DIV>startRecording();</DIV>
<DIV>&nbsp;</DIV>
<DIV>After that everything started working. My question is: shouldn't a function 
name all by itself result in an error of some kind?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Stefan Blixt</DIV>
<DIV>&nbsp;</DIV>-- <BR>Release me, insect, or I will destroy the Cosmos! 
</DIV></DIV>
<P>
<HR>
_______________________________________________<BR>chuck-users mailing 
list<BR>chuck-users@lists.cs.princeton.edu<BR>https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<BR></DIV></DIV></DIV></BODY></HTML>