Kas,<br><br>1 => foo;<br><br>this is sane, but this isn't:<br><br>1 => foo => bar;<br><br>foo(1) is the same as 1 => foo<br><br>foo => bar is the same as bar(foo)<br><br>however, I was suggesting that I could assign the object/function foo to reference bar this way:<br>
<br>foo @=> bar;<br><br>which means this:<br><br>1 => bar;<br><br>would now return 3 because bar is now a reference to the same function foo is a reference to.<br><br>see what I mean?<br><br><br><br>additionally, given<br>
<br>fun fun int bing(int b)<br>{<br>   fun void funk(int i) { return b+i; }<br>   return funk;<br>}<br><br>this:<br><br><<< 4 => bing(5) >>>;<br><br>should print "9" in my weird world.  I'm not sure that this actually is going to work this way, i'm just suggesting that we could get a lot of interesting things if functions were objects.  I might be lynched for saying this, but JavaScript works this way.  It's a lot easier with a dynamically typed language in which variables are always just references to other things (like they are in Chuck with objects, but not with primitives).<br>
<br>I don't think we're going to get away with this without adding some sort of keyword to Chuck.  "function" is already taken as a keyword, according to the documentation, even though nothing using it has been implemented as far as I know.  Perhaps we can add a function type that extends object.  <br>
<br>-Mike<br><br><br><div class="gmail_quote">2010/1/6 Kassen <span dir="ltr"><<a href="mailto:signal.automatique@gmail.com">signal.automatique@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Mike;<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">What about this:<br><br></blockquote><div><br></div><div>
Well;</div><div><br></div>
<div>fun int foo( int arg)</div><div>  {</div><div>  return 3;</div><div>  } </div><div><br></div><div>fun void bar( int arg)</div><div>  {</div><div>  <<<"boring">>>;</div><div>  }</div><div>
<br>
</div><div>//overload</div><div>fun void bar ( fun arg)</div><div>  {</div><div>  <<<"fun">>>;</div><div>  }</div><div><br></div><div>1 => foo => bar;</div><div><br></div><div>Would that print "fun" or "boring"? That last line is a case where we refer to the function without parentheses yet still expect it to be called and to return under current syntax.</div>

<div><br></div><div>Yours,</div><div>Kas.</div></div>
<br>_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://michaelclemow.com">http://michaelclemow.com</a><br><a href="http://semiotech.org">http://semiotech.org</a><br><br>