Re: [Jolie-devel] Jolie code example in documentation
A service-oriented programming language.
Brought to you by:
fmontesi
From: Fabrizio M. <fam...@gm...> - 2013-10-22 14:34:08
|
Dear Matthias, thanks for your contribution! That example is indeed wrong, since variable paths cannot start with a dynamic lookup. What I mean is that global.(exam.studentId).(exam.examId) is not fine because the first variable name after the global keyword, which acts just as a keyword and is not a variable, i.e., (exam.studentId), is dynamic and Jolie does not allow for that. The reason is that otherwise many static analyses of code would become impossible. A way to fix the example could be to use something like: global.exams.(exam.studentId).(exam.examId) This way, the variable path would start with exams, which is static and therefore OK. I'm adding Claudio and Saverio in CC since they may be interested in following up. I'm attaching a modified version of server.ol that runs for me. I also had to change the usage of join, since it's a one-way operation and not a request-response as used in your zip. Let me know! @Saverio: we should update the website with the fixed version when we finish sorting this out. Cheers, Fabrizio. On Tue, Oct 22, 2013 at 11:07 AM, Matthias Dieter Wallnöfer <mwa...@ya...> wrote: > Dear Jolie devs, > > the documentation at > http://www.jolie-lang.org/?top_menu=documentation&sideMenuAction=basics/sessions > section "Multiple correlation variables" provides an example about exams, > students and professors. > > I would be glad to try it out but it seems incomplete (and also not > downloadable). I attempted to fix it up but now I am stuck. > > For instance the line: > > global.(exam.studentId).(exam.examId) << exam; > > yields to > > java.lang.ClassCastException: > jolie.lang.parse.ast.expression.VariableExpressionNode cannot be cast to > jolie.lang.parse.ast.expression.ConstantStringExpression > > I have no idea how to change that. > > Please find attached my WIP. It would be nice to have at least the server > side working. > > Regards, > Matthias Wallnöfer > > > ------------------------------------------------------------------------------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from > the latest Intel processors and coprocessors. See abstracts and register > > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk > _______________________________________________ > Jolie-devel mailing list > Jol...@li... > https://lists.sourceforge.net/lists/listinfo/jolie-devel > |