tag:blogger.com,1999:blog-741750605858169835.post3088999342864988138..comments2024-01-24T14:53:02.919+00:00Comments on Stephen Colebourne's blog: FCM prototype availableStephen Colebournehttp://www.blogger.com/profile/01454237967846880639noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-741750605858169835.post-11447558405823256842008-03-10T09:02:43.000+00:002008-03-10T09:02:43.000+00:00I'm still getting verify errors for the simple...I'm still getting verify errors for the simplest programs.<br /><br />public class Test5 {<br /> interface Block {<br /> int invoke();<br /> }<br /><br /> public static void main(String[] args) throws Exception {<br /> Integer j;<br /> Block[] a = new Block[10];<br /> for (int i = 0; i<10; i++) {<br /> j = i;<br /> a[i] = j#intValue();<br /> }<br /> for (int i = 0; i<10; i++) {<br /> if (i != a[i].invoke()) throw new AssertionError(a[i].invoke());<br /> }<br /> }<br />}Neal Gafterhttp://www.javac.info/noreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-17135439547180871602008-02-26T12:44:49.000+00:002008-02-26T12:44:49.000+00:00You can't get a function pointer in C/C++ by u...You can't get a function pointer in C/C++ by using the address-of (&) operator. You simply mention its name. For instance:<br /><br />/* Declare the type of pointers to functions with the signature "int main(int argc, char* argv[])" */<br />typedef int (*FPMAIN) (int argc, char *argv[]);<br />/* Declare a variable that can get a function reference" */<br />FPMAIN fpmain;<br />/* Assign the reference to the "main" function to the "fpmain" variable */<br />fpmain = main; // there's no "&" operator here.<br />/* Call the "main" function using its reference - C syntax */<br />char *argv[] = {"argument 1", "argument 2"};<br />(*fpmain) (10, argv);<br />/* Call the "main" function using its reference - alternative C++ syntax */<br />fpmain (10, argv);<br /><br />I prefer using the # operator instead of the & operator to get function references - if you are inspired by C/C++, don't be mislead by the "&" operator.Edson Watanabenoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-45061337454020000932008-02-25T16:25:52.000+00:002008-02-25T16:25:52.000+00:00Gregory: This proposal is usable with the fork-joi...Gregory: This proposal is usable with the fork-join library as is. Oh - except that generics don't work properly yet, so you'll find things very limiting...Stephen Colebournenoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-72513043798188385102008-02-25T15:58:37.000+00:002008-02-25T15:58:37.000+00:00Are there any plans for an example library using F...Are there any plans for an example library using FCM? (i.e. something like the fork-join library with bgga http://www.javac.info/jsr166z/jsr166z/forkjoin/package-summary.html)Gregory Kickhttp://kickstyle.net/noreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-8774643673377102512008-02-25T10:36:19.000+00:002008-02-25T10:36:19.000+00:00kodeninja: Yes, currently only single method inter...kodeninja: Yes, currently only single method interfaces are supported. Do you want method/function types? Or Single abstract method classes?<br /><br />Remi: Thats good to hear!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-76889686609127826302008-02-25T10:30:50.000+00:002008-02-25T10:30:50.000+00:00Great,
as for me, i think i will be able to relea...Great, <br />as for me, i think i will be able to release an updated spec and prototype of the properties in one or two weeks.<br /><br />RémiRémi Foraxhttp://weblogs.java.net/blog/forax/noreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-56235975956310574762008-02-25T09:56:46.000+00:002008-02-25T09:56:46.000+00:00Hi Stephen!
Do inner methods only support single ...Hi Stephen!<br /><br />Do inner methods only support single method interfaces? Is this likely to change later?<br /><br />Thanks<br />kodeninjakodeninjanoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-85370251634318772872008-02-25T00:53:38.000+00:002008-02-25T00:53:38.000+00:00An updated version 2008-02-25 is now available wit...An updated version 2008-02-25 is now available with a few bug fixes.Stephen Colebournenoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-67293781663696308342008-02-24T18:44:43.000+00:002008-02-24T18:44:43.000+00:00How about using '\' ?How about using '\' ?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-75403283943534319102008-02-24T18:43:51.000+00:002008-02-24T18:43:51.000+00:00Semantics. The # is actually closer than &, af...Semantics. The # is actually closer than &, after pressing shift. Neither compares to the awesome that is . since that doesn't need two key to type.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-54367714263420364902008-02-24T16:52:37.000+00:002008-02-24T16:52:37.000+00:00i also liked the & symbol.i also liked the & symbol.ahmetnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-83499919664013695572008-02-24T16:47:54.000+00:002008-02-24T16:47:54.000+00:00That C syntax is very nice. I was looking for an a...That C syntax is very nice. I was looking for an alternative to # myself. Despite the use of it in Javadoc, I can't think of any other language in which the # is an actual operator. The & seems much more natural, and having it at the beginning of the expression is much more indicitive, imo, of the intention.Paul Benedictnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-43858661568167847962008-02-24T16:34:48.000+00:002008-02-24T16:34:48.000+00:00Cool, i will try testing the implementation. And h...Cool, i will try testing the implementation. And hey, JSR-310 needs some TLC too!ahmetnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-34834284252118068922008-02-24T16:21:46.000+00:002008-02-24T16:21:46.000+00:00Neal: All three items are on the 'not implemen...Neal: All three items are on the 'not implemented yet' list.<br /><br />88.70.83.241: Having used C very little, I don't find myself constrained by its syntax. Nevertheless, your syntax would probably be a valid alternative.Stephen Colebournenoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-646723517593411482008-02-24T11:34:10.000+00:002008-02-24T11:34:10.000+00:00Just a question:
have you considered another synta...Just a question:<br />have you considered another syntax for methods like what is already used in C or C++? Something like this one (looks more natural to me):<br /><br />ref = &JButton.setPressed;Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-90366072279970613672008-02-24T09:46:18.000+00:002008-02-24T09:46:18.000+00:00Great, good job.
I hope to be able to test it soon...Great, good job.<br />I hope to be able to test it soon.<br />I'll do the jtreg tests like I did for Remi's property implementation, and hope to have time to integrate the bound method reference with property.<br /><br />@Neal: Is it possible to have a link to the source code of BGGA prototype? It will be nice to integrate different language proposals together to see how they fit.<br /><br />Anyway, Let's play ;-)Frederic Simonhttp://freddy33.blogspot.com/noreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-68465403707242297122008-02-24T09:16:30.000+00:002008-02-24T09:16:30.000+00:00Stephen:
WRT the code falling off your fingers ni...Stephen:<br /><br />WRT the code falling off your fingers nicely, I guess you don't have a Mac with a UK keyboard then - # is not the easiest character to type ;-)<br /><br />Good to have prototypes of BGGA, CICE and FCM available though. Bug reports on their way shortly...<br /><br />Also, I'd really recommend looking into using jtreg for your tests (if you haven't already) - it's very useful.Mark Mahieuhttp://slm888.comnoreply@blogger.comtag:blogger.com,1999:blog-741750605858169835.post-60559166167774856642008-02-24T05:44:48.000+00:002008-02-24T05:44:48.000+00:00I'll send crashes and programs that don't ...I'll send crashes and programs that don't compile directly to you, but please help me out here: I could not figure out how to get exception transparency or completion transparency working. Also, the prototype does not appear to allow an inner method to access a non-final variable.Neal Gafterhttp://www.javac.info/noreply@blogger.com