OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-matrix commits / ee9f462

Get rid of annoying TODO in the moved code.
ee9f4621e02c05b3f8c631c1bb71b376efce637a
by Linas Vepstas <linasvepstas@gmail.com> · 2025-12-05T19:20:45.000Z

Changed files (1) +7 -9

opencog/matrix/random.scm +7 -9
……@@ -22,15 +22,13 @@
2222 (fluid-set! rand-state-fluid
2323 (seed->random-state (get-internal-real-time))))
2424
25 ; XXX FIXME -- this is a stunningly slow and sloppy random-string
26 ; generator. But whatever. I don't have the hours in the day to fix
27 ; everything.
28 (while (> str-length 0)
29 (set! str (string-append str (string (string-ref alphanumeric
30 (random alphlen (fluid-ref rand-state-fluid))))))
31 (set! str-length (- str-length 1))
32 )
33 str
25 ; Build random part by collecting chars into a list
26 (define rs (fluid-ref rand-state-fluid))
27 (let loop ((n str-length) (chars '()))
28 (if (zero? n)
29 (string-append str (list->string chars))
30 (loop (- n 1)
31 (cons (string-ref alphanumeric (random alphlen rs)) chars))))
3432)
3533
3634(define-public (random-node-name node-type random-length prefix)