Propeller Tool - Why is \ an invalid character when specifying an OBJ name
Chuck Rice
Posts: 210
Every time Parallax updates the Propeller tool, my compiles start failing. The problem is that I have added objects to the propeller library and they do not get copied forward. I do this because it is the only way to have common objects that I can share between all my projects. I just installed 1.2 and I am scurrying around rebuilding all my project just so I can find all missing objects.
Based on the principle of least astonishment, I thought that I could put a folder in my propeller library called MYLIB and another one called OBEX, and I would put all my non-parallax objects in these libs. Then I could specify the object as:
but alas, it astonished me again. it tells me that "\" is an invalid character. Couldn't you make the "\" work?
Just a suggestion.
Based on the principle of least astonishment, I thought that I could put a folder in my propeller library called MYLIB and another one called OBEX, and I would put all my non-parallax objects in these libs. Then I could specify the object as:
OBJ terminal : "OBEX\PC_Text" globals : "MYLIB\globals"
but alas, it astonished me again. it tells me that "\" is an invalid character. Couldn't you make the "\" work?
Just a suggestion.
Comments
cd $compiler_dir
for i in /home/brad/spinlibs/*.spin ; do ln -s $i . ; done
and I'm away again.
It would be *really* nice to have an additional configurable directory or better still, a search path.. but alas..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pull my finger!
Just adding another path to search would be a good start but I cannot see any reason the full path could not be specified in the object filename descriptor string.
It is very intentional to not support file paths in file strings (like OBJ block and FILE directive) because it would ultimately result in many broken projects when moved to another machine, especially when the Archive feature is used for distributing objects (like on the object exchange).· Keeping the path out of the "hard-coded" source code, and adding a multi-path library feature would best solve this in both cases; normal compiling would still work, the paths would be carried over from version to version on the same machine, and archived projects would continue to function properly, regardless of the myriad of paths that the original files could have been pulled from.
I'm sorry we have not implemented this already, but it should be included soon.
Take care,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.
I agree wholeheartedly that absolute path specifications must be kept out of the OBJ strings. User-defined paths will be a most welcome addition, alleviating the necessity for specifying them in the source code.
But what this still doesn't fix is not having libraries organized by topics, subtopics, etc. My development library is a mess: one directory with a bunch of Spin files. What we need is what Chuck asked for at the head of this thread: relative paths in the OBJ strings. This would allow libraries to be organized hierarchically into topics like "Math", "Sensors", "Signals", etc. — rather like the ObEx is organized. This is not a non-portable feature, either, since the location of each main library would still be given by the path. And when an archive is unpacked, this hierarchy can still be maintained by creating and populating the requisite subdirectories.
It may be tempting to think that this could be accomplished with the path specs alone, i.e. "c:\spin\mylib", "c:\spin\mylib\math", "c:\spin\mylib\math\trig", "c:\spin\mylib\sensors". But it should be obvious how awkward this would quickly become.
As to notation, please just say "no" to the backslash. A forward slash or double colon "::" (a la Perl) would be preferable and more OS-agnostic. At least we could pretend we weren't using Windows.
Thanks,
Phil
But we ARE using Windows and that is the convention. To switch to a non-Windows convention would be counter intuitive.
-Phil
Well, Phil, for the first time EVER, I just can't get on board with you on this one!
However, every one IS entitled and the truth is, we'll all do whatever the thing needs us to do!
Double-colon and similar is just non-intuitive, but if anyone wants to support double-colon as another synonym for filename separator then that's fine by me - My principle is don't force any single standard, accept as many standards as is possible, then everyone's happy no matter what direction they're coming from.
-Phil