Re: [basex-talk] random:integer vs. random:seeded-integer

2014-08-19 Thread Amanda Galtman
Thanks, Christian! Cheers, Amanda > Date: Tue, 19 Aug 2014 16:04:17 +0200 > From: Christian Gr?n > To: Dirk Kirsten > Cc: BaseX > Subject: Re: [basex-talk] random:integer vs. random:seeded-integer > Message-ID: >3qwgfrpjz...@mail.gmail.com> > Content-Type: t

Re: [basex-talk] random:integer vs. random:seeded-integer

2014-08-19 Thread Christian GrĂ¼n
Hi Amanda, I have extended Dirk's pull request and added new error codes [1]; a new snapshot is available [2]. Best, Christian [1] http://docs.basex.org/wiki/Random_Module [2] http://files.basex.org/releases/latest/ On Mon, Aug 18, 2014 at 5:10 PM, Dirk Kirsten wrote: > Hello Amanda, > > I agr

Re: [basex-talk] random:integer vs. random:seeded-integer

2014-08-18 Thread Dirk Kirsten
Hello Amanda, I agree, this behaviour is inconsistent. I am not quite sure what is the best way to go here. Raising no error and simply returning 0 (as it is currently done for random:integer() if max is out of range) seems pretty dangerous to me, considering that randomness is often used for secu

[basex-talk] random:integer vs. random:seeded-integer

2014-08-18 Thread Amanda Galtman
Hi, Is it intentional that random:integer lets you use zero or a negative value for $max, but random:seeded-integer errors out in those cases? I know these are edge cases. I'm only flagging them because of the inconsistency between the two similar functions. (: Returns (0,0). :) (random:intege