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 <sl20@wanadoo.fr> 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
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users