From: Josh J. <jun...@gm...> - 2009-08-09 14:00:41
|
Thanks for the comment here and on my blog. I am surprised to see that this is still showing up as int x = 0; I thought I had gone back and repaired that item already? Anyhow, this is supposed to be a comparison to java code...in the example the Python code is missing. I will go back and update. Thanks Josh Juneau jun...@gm... http://jj-blogger.blogspot.com Twitter ID: javajuneau On Sun, Aug 9, 2009 at 6:19 AM, william ratcliff <wil...@gm... > wrote: > Also, in the intro, there is a mistake where you write: > > int x = 0; > > where I believe you meant to just write: > > x=0 > > Cheers, > William > (btw. is there a maximum recursion depth in jython?) > > > On Sun, Aug 9, 2009 at 5:58 AM, Sylvain Leroux <sl...@wa...> wrote: > >> Hi, >> >> Great work on /the/ Jython book! Not sure this is the official place to >> discuss it but: >> >> 1) >> >> http://jythonpodcast.hostjava.net/jythonbook/chapter18.html#google-app-engine >> : >> ----- >> I understand the usage of a JythonObjectFactory as the preferred way to >> access a Jython class from Java. But, in the listing of >> JythonServletFacade, I don't understand why we should create a /new/ >> instance of that class for every request: >> > protected void doGet(HttpServletRequest request, HttpServletResponse >> response) >> > [...] >> > JythonServletInterface jythonServlet = (JythonServletInterface) >> factory.createObject(JythonServletInterface.class, pyServletName); >> > jythonServlet.doGet(request, response); >> > ... >> > protected void doPost(HttpServletRequest request, >> HttpServletResponse response) >> > [...] >> > JythonServletInterface jythonServlet = (JythonServletInterface) >> factory.createObject(JythonServletInterface.class, pyServletName); >> > jythonServlet.doPost(request, response); >> > } >> >> >> 2) >> >> http://jythonpodcast.hostjava.net/jythonbook/chapter12.html#jython-implementation-using-the-java-entity-classes >> ----- >> Nothing to do with ORM mapping or Java Entity. But, in the sample code >> "HockeyRoster.py", the function makeSelection makes is a recursive call >> to itself: >> > def makeSelection(): >> > [...] >> > if selection not in validOptions: >> > print "Not a valid option, please try again\n" >> > makeSelection() >> > else: >> > # do something useful >> Does Jython/Python handle gracefully tail call recursion - as it appears >> to be here? Or could it leads to a stack overflow if the user feeds the >> program with invalid inputs? Of course, this in not a problem with the >> sample program, but the reader - especially with functional language >> background - could be tempted to generalize this anti-pattern. >> >> >> Hope this helps, >> Sylvain. >> >> >> >> -- >> Website: http://www.chicoree.fr >> >> >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > |