[Openmcl-devel] executable problem
stassats at gmail.com
Tue Dec 27 16:20:00 UTC 2011
"Haris Bogdanovich" <fbogdanovic at xnet.hr> writes:
> I created a program for creating sudoku problems
> in html table and it works as expected when top level function
> is called from Emacs, always creates a new table.
> I created executable program with:
> (save-application "c:/sudoku.exe" :toplevel-function #'start :prepend-kernel t)
> and when called sudoku.exe it always returns the same table,
> like the #'start function is called once upon creation and that's it.
> So I made a test program like this:
> (defun start ()
> (print (random 10)))
> When called from Emacs it works ok.
> I created executable with:
> (save-application "c:/test.exe" :toplevel-function #'start :prepend-kernel t)
> and when called from dos prompt it always returns the same number
> again like function #'statrt is called once upon creation of executable.
> Where is the problem ?
You need to initialize the random state each time.
(setf *random-state* (make-random-state))
With best regards, Stas.
More information about the Openmcl-devel