nimble-dev / nimble

The base NIMBLE package for R
http://R-nimble.org
BSD 3-Clause "New" or "Revised" License
156 stars 23 forks source link

can't use `nimCat` with nimbleList #1485

Open paciorek opened 2 months ago

paciorek commented 2 months ago
mynf <- nimbleFunction(
    setup = function() {
        myList <- nimbleList(x = double())
    },
    run = function() {
        ll <- myList$new()
        ll$x = 3.0
        z = 5.0
        nimCat("z: ", z, "; x: ", ll$x, "\n")
    }
)

rmynf <- mynf()
cmynf <- compileNimble(rmynf, showCompilerOutput=TRUE)

One can of course work around this by setting a temporary variable equal to ll$x and cat/printing that.