Re: [basex-talk] Generating consecutive integers in a for loop

2015-10-22 Thread Rob Stapper
Hi Ron, Maybe the attached codes-nippet is useful to you. It is an example of stateful programming, which isn't compliant with the functional programming concept but, in some cases, can be very useful. Hopes it helps, Rob Stapper PS. put the module-file in a subdirectory: "counter", in your

Re: [basex-talk] Generating consecutive integers in a for loop

2015-10-22 Thread Ron Katriel
Thanks all! I went with the solution suggested by Christian. It is simple, efficient, and solves my problem (starting at 1 is fine). The GFLWOR approach is nice, except that I have two nested for loops so it produces two counts instead of one (and there is no straightforward way to combine

Re: [basex-talk] Generating consecutive integers in a for loop

2015-10-22 Thread Marc van Grootel
Hi, Wouldn't clj-ds [1] be of any help in this? It has support for transients.I believe that Exist uses this somewhere in their code not sure where. I think it makes use of these Atomic* objects under the hood but providing a "functional" facade. btw I'm not speaking from experience with this