MCAD version

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

MCAD version

kintel
Administrator
Hi,

In the upcoming (no release date set) OpenSCAD release, I'd like to tie in MCAD so that people can expect it to be there.
The basic plan is to bundle MCAD in the binary releases (zip files etc.) and package MCAD as a separate package for the Linux packages.
An update mechanism for platforms without a built-in package manager might happen in the future, but for now, bundling should be OK.

For this to work smoothly, I'd like to see a way of querying MCAD for its version, in a way which makes it easy to require a minimum version or to program for different versions.
I'd like to have something similar for OpenSCAD itself.

The naive solution is to supply a variable or function in MCAD which returns the version number as an integer/float.

Comments?

 -Marius

PS. I submitted a pull request a few weeks bacl: https://github.com/SolidCode/MCAD/pull/1
Reply | Threaded
Open this post in threaded view
|

Re: MCAD version

William Adams
that versioning approach seems reasonable.  You mean something like
 
MCAD_Version = 2.0;
 
You'll also have to have a mechanism for detecting if the variable even exists though won't you?  Meaning, if I'm running 'down level' from this change, then the variable won't actually exist.  Of course it will show up as a compiler warning/error.
 
I don't know if you could add:  if (MCAD_Version == endef)...
 
That would be most ideal, and not only for this particular variable.
 
If not, then I think going with this approach forward would be good.
 
-- William

===============================
- Shaping clay is easier than digging it out of the ground.


http://internationalwilliam.spaces.msn.com/

 
> From: [hidden email]

> Date: Thu, 29 Sep 2011 04:27:13 +0200
> To: [hidden email]
> Subject: [OpenSCAD] MCAD version
>
> Hi,
>
> In the upcoming (no release date set) OpenSCAD release, I'd like to tie in MCAD so that people can expect it to be there.
> The basic plan is to bundle MCAD in the binary releases (zip files etc.) and package MCAD as a separate package for the Linux packages.
> An update mechanism for platforms without a built-in package manager might happen in the future, but for now, bundling should be OK.
>
> For this to work smoothly, I'd like to see a way of querying MCAD for its version, in a way which makes it easy to require a minimum version or to program for different versions.
> I'd like to have something similar for OpenSCAD itself.
>
> The naive solution is to supply a variable or function in MCAD which returns the version number as an integer/float.
>
> Comments?
>
> -Marius
>
> PS. I submitted a pull request a few weeks bacl: https://github.com/SolidCode/MCAD/pull/1
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
Reply | Threaded
Open this post in threaded view
|

Re: MCAD version

chrysn
In reply to this post by kintel
On Thu, Sep 29, 2011 at 04:27:13AM +0200, Marius Kintel wrote:
> For this to work smoothly, I'd like to see a way of querying MCAD for
> its version, in a way which makes it easy to require a minimum version
> or to program for different versions.
>
> The naive solution is to supply a variable or function in MCAD which
> returns the version number as an integer/float.

some platforms use lists for versioning as floats don't scale to finer
grained version control. given that the "use" import doesn't import
variables, what about

 use <MCAD.scad>;
 
 mcad_require_version([2, 0]);

? thus, every library is free to use whatever versioning scheme it
likes, and the changes required in openscad are minimal.

an error() or assert() function would be helpful; otherwise, modules
couldn't do anything but display a warning using echo.

explanation of the error function: if, in the course of evaluation, any
error(msg) call is evaluated, no object tree should be rendered, all
further evaluation should be stopped, the message displayed, and a
visual indicator shown in the status bar (no popups please). command
line execution of such a script should yield a distinct exit status.

regards
chrysn

--
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom

signature.asc (836 bytes) Download Attachment