This will result in "1.0" (e.g.) if all goes well, or #f if the info.rkt could not be found, or an exception if it is found but version isnβt defined in it.
if i understand (?) the advantage of your solution, and i only use version number to display as info (not critical in code), and as my releases are spaced by months generally, the actual solution should be enough to have version number , not hard coded in text string but retrieved from info.rkt file.
thank.
The advantage of @benknoble's solution is that, for some ways of building an executable, the info.rkt file might not actually be present at runtime. Doing the lookup at compile time makes that work seamlessly.
Another caveat is that, if you have a multi-collection package, the packageinfo.rkt file is not part of any collection. (In a single-collection package, the package info.rkt file is also a collection info.rkt file.) The APIs are there to find such a file, too, it just has to be done differently.
This all reminds me that I've wished for something like PLaneT's (this-package-version) for non-PLaneT packages, particularly to use as the #:version argument to @title{}. To be useful, it should probably allow providing a package name or a module path to look up, since documentation is often in a different package with an irrelevant version number.
thank you for the explanation. I think it could take sense in one of two release of my Scheme+ and SRFI-105 because at some point i will made a lot of the job from Scheme+ to SRFI-105 reader and i will melt the 2 projects (collection/package) in a single one (package with perheaps 2 collections) and the 2 info.rkt will be only one (and only one common version number at this time) but will be in a place in the package at an upper level than the collection place where info.rkt files are now.
note about API doc: i had read the doc before posting but can not figure out how to make the code, some examples like this would be useful for user to understand the APIs