The simple-random Module#

Common Dylan provides a simple facility for generating sequences of pseudo-random integers via the simple-random module.

Instances of the sealed class <random> generate pseudo-random integers. Given an instance of <random>, the function random will return a pseudo-random integer.

<random> Instantiable Sealed Class#

The class of random number generators.

Superclasses:

<object>

Init-Keywords:
  • seed – An instance of <integer>. Default value: computed to be random.

Discussion:

The class of random number generators.

The seed value from which to start the sequence of integers. Default value: computed to be random.

random Function#

Returns a pseudorandomly generated number greater than or equal to zero and less than a specified value.

Signature:

random upperbound #key random => random-integer

Parameters:
  • upperbound – An instance of <integer>.

  • random (#key) – An instance of <random>.

Values:
  • random-integer – An instance of <integer>.

Discussion:

Returns a pseudorandomly generated number greater than or equal to zero and less than upperbound.