« first day (3577 days earlier)      last day (203 days later) » 

6:47 AM
"return block; // or use it somewhere else and rebRelease it"

Does this mean I do NOT have to rebRelease this block when I return it even though it was a result of using a rebValue?
 
@iArnold Yes. Once you rebRelease a value, the data is gone. If you return the value as the result from a native, the evaluator will read the data and then rebRelease it itself.
 
In my case this would be that changing
rebElide("append", block, rebText(row[i]));
into
rebElide("append", block, rebT(row[i]));
fixes things?
@HostileForksaysdonttrustSE Great! Thanks.
(The confusing part for me is the message is using the word 'handle' too, but this just refers to the internal handle for the variable used, not one of the handle things I happened to use.)
 
@iArnold Yes. I think HANDLE! should probably be C-POINTER! (or something like that) in these cases.
But "handle" in computer programming is a very generic term. It's an abstract category of "ways to refer to things". So pointers are a kind of handle, but if you are tracking things in an array you could use the index into that array as a "handle" too.
 
Especially for my case, the last message I had printed before the ending of the script was "DB handle closed!" So now it said: "DB handle closed! handle not rebReleased(), not legal ATM"
 
Under linux, there's actually information in the debug: sanitize build that will point you at the line that allocated the handle that was leaked. You can also find out with valgrind r3 on a non-sanitizer build.
 
6:58 AM
That puts one on the wrong leg as we say in Holland. :-)
 
We can automatically free these handles...with some risk. The risk is that people will make too many of them and not realize they are using up handles.
 
@HostileForksaysdonttrustSE Do not think that will be worth the effort/trouble and the risk. The programmer on this level should be (made) aware of this issue and fix things.
The problem is fixed now!
 
7:13 AM
@iArnold Good to hear. In any case, hopefully you see that the API is actually (as APIs go for bridging languages with C) rather painless...relatively speaking.
 
@HostileForksaysdonttrustSE Yes. It takes a little to get it. Must use it a lot more to really grasp it, but I have a starters level now.
I will experiment now with returning the appropriate types. And document one thing and another, create an improved README.md perhaps add a few more functions from the API, test some more. Use it myself and maybe it can be added to the official repo (before the new era dawns).
 
 
3 hours later…
10:49 AM
How to rebrelease an integer
 
 
1 hour later…
12:11 PM
And for DATETIME only date part will be collected.
 
12:25 PM
Updated the repository with the latest (working) version again. It is workable for me like this. If any additional wishes are around, let it be heared.
 
1:13 PM
Strange, I have a DATETIME and in the mySQL db its value is shown as 2020-08-16 13:54:11 but in my retrieved block! it is 16-Aug-2020 that is a Rebol format if I am not wrong. But it is added as the C value from row[i].
 
 
4 hours later…
5:19 PM
Also my rebBlank() should be rebReleased.
 
5:40 PM
       if (not row[i])
        {
            rebElide("append", block, rebBlank());
        }
I don't think that is possible, oh wait it is possible.. think out of the box.
And it is! It is possible. Nailed it again.
All those tiny little baby-alligator steps add up!
 
 
2 hours later…
7:24 PM
@iArnold You can also just say rebElide("append", block, "_");.
 
 
2 hours later…
9:00 PM
Yes, I used a blank = rebBlank();
Need some tricks for getting the date + time right next.
I'll sleep on it.
 
9:18 PM
@iArnold Note there is no rebDate() or rebTime() constructor. You use rebValue("make date! [", ..., "]") and other INTEGER!-based ways of creating them.
 

« first day (3577 days earlier)      last day (203 days later) »