home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d3xx
/
d385
/
xlispstat.lha
/
XLispStat
/
lisp.lzh
/
XLisp-Stat
/
Functions
/
randomgen.lsp
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Lisp/Scheme
|
1990-10-11
|
192 b
|
10 lines
; book pp.102-103
(defun make-generator (a m x0)
(let ((x x0))
#'(lambda ()
(setf x (rem (* a x) m))
(/ x m))))
(def g (make-generator (^ 7. 5) (- (^ 2. 31) 1) 12345))