OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-learn commits / ba0e4d0

Stub out privite functions
ba0e4d021946eabf187935f227a0951d6c47926b
by Linas Vepstas <linasvepstas@gmail.com> · 2025-11-04T08:50:48.000Z

Changed files (1) +11 -13

scm/common.scm +11 -13
……@@ -18,19 +18,17 @@
1818; ---------------------------------------------------------------------
1919
2020; get-count ATOM - return the raw observational count on ATOM.
21(define (cog-count ATOM)
22 (cog-value-ref (cog-value ATOM (Predicate "*-TruthValueKey-*")) 2))
23(define (cog-set-tv! ATOM VAL)
24 (cog-set-value! ATOM (Predicate "*-TruthValueKey-*") VAL))
25(define (cog-have-tv? ATOM)
21;(define (get-count ATOM)
22; (cog-value-ref (cog-value ATOM (Predicate "*-TruthValueKey-*")) 2))
23; (define (do-set-tv! ATOM VAL)
24; (cog-set-value! ATOM (Predicate "*-TruthValueKey-*") VAL))
25(define (do-have-tv? ATOM)
2626 (not (eq? #f (cog-value ATOM (Predicate "*-TruthValueKey-*")))))
27(define (cog-inc-count! ATOM CNT)
27(define (do-inc-count! ATOM CNT)
2828 (cog-inc-value! ATOM (Predicate "*-TruthValueKey-*") CNT 2))
2929
30(define-public (get-count ATOM) (cog-count ATOM))
31
3230; set-count ATOM CNT - Set the raw observational count on ATOM.
33(define (set-count ATOM CNT) (cog-set-tv! ATOM (FloatValue 1 0 CNT)))
31; (define (set-count ATOM CNT) (do-set-tv! ATOM (FloatValue 1 0 CNT)))
3432
3533; ---------------------------------------------------------------------
3634
……@@ -60,14 +58,14 @@
6058 ; so even if multiple thread increment, there will be only one
6159 ; fetch. It is not multi-process-safe, e.g. when multiple
6260 ; writers are using a networked CogStorageNode.
63 (if (not (cog-have-tv? atom))
61 (if (not (do-have-tv? atom))
6462 (begin
6563 (lock-mutex *-count-upgrade-mutex-*)
66 (if (not (cog-have-tv? atom))
64 (if (not (do-have-tv? atom))
6765 (fetch-atom atom))
68 (cog-inc-count! atom CNT)
66 (do-inc-count! atom CNT)
6967 (unlock-mutex *-count-upgrade-mutex-*))
70 (cog-inc-count! atom CNT))
68 (do-inc-count! atom CNT))
7169 )
7270
7371 (incr-one ATM) ; increment the count on ATM