That is pretty much the standard for path separators. So is the name Path
instead of PATHS, I agree that PATHS would be clearer, but to fix it, you
would need a time machine and access to Bell Labs in the 70s (possibly
earlier)
On Wed, 8 Jul 2020, 09:58 nop head, nop.head@gmail.com wrote:
Actually, yes you can put several paths in OPENSCADPATH. It should have
been called OPENSCADPATHS!
The separator is ; on Windows and : on Linux. Mac is probably the same as
Linux.
On Wed, 8 Jul 2020 at 14:35, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:
On Wed, Jul 08, 2020 at 02:25:29PM +0100, nop head wrote:
I think OPENSCADPATH is intended to point to a folder of libraries, not
a
single library.
I don't know about the MAC and I don't know about OpenSCAD's
implementation, but guessing from the name: In classical Unix, a path
is a list of directories where the objects of interest might be found.
How to specify the second entry in the list (separated by a space?
Colon? Comma?) depends on the implementation.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233
**
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
However if you do point it directly to several libraries I think you could
get conflicts between filenames. So I think it is still better to point it
to a folder of libraries, or several folders of libraries, and always
prefix the include with the library name.
On Wed, 8 Jul 2020 at 15:07, A. Craig West acraigwest@gmail.com wrote:
That is pretty much the standard for path separators. So is the name Path
instead of PATHS, I agree that PATHS would be clearer, but to fix it, you
would need a time machine and access to Bell Labs in the 70s (possibly
earlier)
On Wed, 8 Jul 2020, 09:58 nop head, nop.head@gmail.com wrote:
Actually, yes you can put several paths in OPENSCADPATH. It should have
been called OPENSCADPATHS!
The separator is ; on Windows and : on Linux. Mac is probably the same as
Linux.
On Wed, 8 Jul 2020 at 14:35, Rogier Wolff R.E.Wolff@bitwizard.nl wrote:
On Wed, Jul 08, 2020 at 02:25:29PM +0100, nop head wrote:
I think OPENSCADPATH is intended to point to a folder of libraries,
not a
single library.
I don't know about the MAC and I don't know about OpenSCAD's
implementation, but guessing from the name: In classical Unix, a path
is a list of directories where the objects of interest might be found.
How to specify the second entry in the list (separated by a space?
Colon? Comma?) depends on the implementation.
Roger.
--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ **
+31-15-2049110 **
** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233
**
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 2020-07-08 16:15, nop head wrote:
However if you do point it directly to several libraries I think you
could get conflicts between filenames. So I think it is still better
to point it to a folder of libraries, or several folders of libraries,
and always prefix the include with the library name.
That is obviously the correct approach, consistent with other systems.
Also, you can add new libraries without changing the OPENSCADPATH
variable this way.
Carsten Arnholm
Before you send code to others you write a document?? That's not a good
strategy for being able to share code easily. If I post a snippet to the
forum I shouldn't have to write a document to explain how to use the code.
I understand that your approach makes sense for you as the dotSCAD developer
given that you aren't using other libraries. Though as a library developer
myself I actually do sometimes run code based on other libraries. (I also
have installed several different sweep.scad files from difference sources,
including dotSCAD and list-comprehension-demos.) I suppose it depends on
your intent. Are you writing the library just for your own use and just
incidentally making it available online? Or is your intent to write a
library for others to use? If you're just writing it for yourself, then of
course you should do what makes sense to you. But if your intent is to
distribute the library for broad use, I think it's worth thinking a bit
about the bigger picture and how your users will use it, and what makes
sense for them rather than what makes sense for you.
Broadly speaking about any library, instead of every piece of code coming
with a document, the library should come with an installation document
that explains the one official correct way to install and reference the
library. The current dotSCAD instructions suggest that you might put src on
the openscad path or maybe not and then prefix everything with dotSCAD/src.
Instead a library should specify THE CORRECT way it is to be done rather
than suggesting that users kind of figure something out independently. The
method of installation should presume that the user has and uses other
libraries as well, and your library should coexist with other libraries that
include files with the same name. Suggesting that the dotSCAD src directory
be on the openscad path really doesn't make sense for anybody except the
dotSCAD developer and is hostile to coexistence with other libraries. (And
it could really confuse users who don't really understand what is going on
but who try to install two libs.) With one official way to use the code,
all the examples and all the dotSCAD code should be written to look the
same. So if you really prefer "use<dotSCAD/src/sweep.scad>" then so be it.
You write that every time, in every example. When you or anybody posts an
example to the forum it says "use <dotSCAD/src/...>". The current situation
where there's one system for the library developer and another system for
everybody else and the examples are all written for the developer rather
than for the user---it kind of doesn't make sense. Who is supposed to use
those examples? Users or the developer? It's a nuisance that any time I
want to run one of your examples I have to modify it first. Or I have to
stick it into your src directory.
You're right that my earlier suggestion still creates incompatibilities.
The most portable way to install dotSCAD right now means writing the clumsy
full statements "use<dotSCAD/src/...", since that is how the library
comes packaged. Another observation: if I see some code that says
"use<dotSCad/src/sweep.scad>" then a quick google search for dotSCAD
takes me right to your library so it's easy to figure out how to get the
code, even if it got separated from use instructions. If I see "use
<sweep.scad>" and do a search for that then dotSCAD is not even on the first
page of hits. It's not even among the first 5 pages of hits. But some
other sweep.scad files turn up. The ambiguity of "sweep.scad" is not a good
thing.
Also please note that I'm not trying to attack your library but rather
making a suggestion for improvement. It is better for OpenSCAD if libraries
are used in a consistent way, and in a way that as much as possible,
prevents them from conflicting with each other. Yes, people can have
different ways of managing libraries, but this is not a good idea. There
should be a standard way of doing it to minimize confusion and complication
of using libraries. In other languages you don't see each user devising
their own library management scheme, with different strategies for where the
libraries are installed, how to set up the path, and how to include the
libraries in their code!
caterpillar wrote
adrianv wrote
Personally I think the approach dotSCAD uses is a little broken. If you
do
like he suggests and you install two libs that both provide sweep.scad
you'll not be sure which one you're using. If you provide code to
someone
else they won't know which of many sweep.scad files were intended.
That's because I'm developing dotSCAD out of the libraries folder of
OpenSCAD. Setting OPENSCADPATH is convenient for me. I don't have to
tell
myself I'm using dotSCAD when I'm developing dotSCAD.
People can have different ways to manage their libraries when using
OpenSCAD.
Coping everything from dotSCAD/src into a libraries/dotSCAD and use <dotSCAD/sweep.scad>; also cause errors when you send your code to
someone
because he prefers to put the dotSCAD repo in the libraries folder of
OpenSCAD.
What users should do is reading OpenSCAD User Manual/Libraries carefully
and deciding how to manage their libraries. Before you send code to
others,
write a document for it.
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@.openscad
--
Sent from: http://forum.openscad.org/
On 8 Jul 2020 at 4:59, caterpillar wrote:
Are you using Windows? If that's your case, you should SET PATH=/Users/dpa/Documents/OpenSCAD/libraries/dotSCAD/src in your cmd.
Will this append the path to the PATH variable? I have always added it to the
current contents of PATH using Notepad++. If it appends, Great!
I hesitate to just try it.
On 7/8/2020 6:57 AM, nop head wrote:
Actually, yes you can put several paths in OPENSCADPATH. It should
have been called OPENSCADPATHS!
No. The word "path" is overloaded: it refers both to the set of nodes
that one walks to traverse the directory tree to reach a particular
file, and it refers to the set of directories that one walks to to find
a desired file, a /search path/. It's used here (and in other
UNIX-derived contexts) in that latter sense.
On 8 Jul 2020 at 9:13, lar3ry@sasktel.net wrote:
On 8 Jul 2020 at 4:59, caterpillar wrote:
Are you using Windows? If that's your case, you should SET PATH=/Users/dpa/Documents/OpenSCAD/libraries/dotSCAD/src in your cmd.
Will this append the path to the PATH variable? I have always added it to the
current contents of PATH using Notepad++. If it appends, Great!
I hesitate to just try it.
Never mind. Just tried it, after making sure I could revert to my current PATH
settings.
No, it does not append.
Oh, and as far as I know the PATH environmental variable is only for finding
executables.
You might make
adrianv wrote
Before you send code to others you write a document?? That's not a good
strategy for being able to share code easily. If I post a snippet to the
forum I shouldn't have to write a document to explain how to use the code.
I understand that your approach makes sense for you as the dotSCAD
developer
given that you aren't using other libraries. Though as a library
developer
myself I actually do sometimes run code based on other libraries.
You might misunderstand my points. As I said before, Setting OPENSCADPATH
is convenient for me.
I never rule out other libraries. I just said that people can have different
ways to manage their libraries when using OpenSCAD. The internal
implementation of dotSCAD supports this (always use a relative path to use
other modules/functions).
That's why users can set OPENSCADPATH, copy src or just put all repo into
the libraries folder.
Sent from: http://forum.openscad.org/
adrianv wrote
There
should be a standard way of doing it to minimize confusion and
complication
of using libraries. In other languages you don't see each user devising
their own library management scheme, with different strategies for where
the
libraries are installed, how to set up the path, and how to include the
libraries in their code!
It is another story. For now, OpenSCAD itself doesn't have proper namespace
management. The so-called standard way is first heard by me. Actually, I can
see other languages that users devise their own library management scheme.
For example, JavaScript before ES6.
ES6 took the experience from those users devising their own library
management scheme and came up with the standard module system.
That's why I think users should decide their own way to manage their
libraries. If OpenSCAD will come up with its own namespace management, it
will know what users really want.
Sent from: http://forum.openscad.org/