Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: Directories...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 20 Topic 3988 of 4053
Post > Topic >>

Re: Directories Redux

by Jonah Thomas <jethomas5@[EMAIL PROTECTED] > Apr 6, 2008 at 01:05 PM

anton@[EMAIL PROTECTED]
 (Anton Ertl) wrote:
> Bruce McFarling <agila61@[EMAIL PROTECTED]
> writes:

> >As far as I recall, the Directories proposal foundered on the
> >question of what should be the prefix.
> 
> >If "name.fs" is in the current working
> >directory, and in "./name.fs", "./" is conventionally a no-op, then
> >how can "./" change the meaning from cwd to the current source
> >directory?
> >
> >How about: no prefix?
> 
> First of all, relative file names are not necessarily relative to the
> current working directory (cwd).  Indeed, since a Forth source file
> should usually work without being dependent on the cwd, making
> relative file names written in the source file refer to the cwd is a
> bad idea; it does not help well-written programs, and makes
> programmers adopt bad programming practices (like making the source
> file dependent on a specific cwd).
 
> >SF" ..." returns a string anchored in the directory of the source
> >file
> 
> That's certainly an approach that would avoid the whole prefix issue
> completely.  Another advantage is that it would do the anchoring at
> the right place (in the file where the string sits, rather than in the
> file where the string is used).
> 
> In the current proposal I propose F" ..." with the meaning you assign
> to SF" ...".  IIRC there was no feedback on that.
> 
> One disadvantage of F" (or SF") is that most Forth programmers seem to
> prefer INCLUDE and REQUIRE over INCLUDED and REQUIRED, standards be
> damned.  So they probably won't write
> 
> F" name.fs" required
> 
> OTOH, I think it is likely that they won't write
> 
> require %inc%/name.fs
> 
> either (which is even one character longer), so we might just as well
> forget about the prefix variant and just go with F" only.  What do you
> all think?
> 
> >LF" ..." returns a string that refers to a file anchored in the
> >current library directory.
> 
> I don't think that having only one library directory is practical.
> But we could have a library path (or a general path that includes the
> library path), and LF" (or P" or whatever the word is called) would
> produce the absolute name of the first match in the path; a library
> would have its own distinctively named subdirectory in one of the
> directories in the path; the distinctive name should avoid collisions.

Just as a possibility, if each library was in a virtual file system, you
could arrange them in some consistent way that could be independent of
operating systems etc, and if you can access the file that holds the
virtual file system then everything from there ought to just work. At
least you get to decide how it works, and it can be independent of OS
etc. Would that help clear up this thicket?

Or is it important to use libraries to set a precedent that helps solve
the problem more generally?




 20 Posts in Topic:
Directories Redux
Bruce McFarling <agila  2008-04-05 19:00:00 
Re: Directories Redux
anton@[EMAIL PROTECTED]   2008-04-06 14:34:53 
Re: Directories Redux
Jonah Thomas <jethomas  2008-04-06 13:05:02 
Re: Directories Redux
Bruce McFarling <agila  2008-04-06 11:53:00 
Re: Directories Redux
Bruce McFarling <agila  2008-04-06 12:06:04 
Re: Directories Redux
m_l_g3 <m_l_g3@[EMAIL   2008-04-09 14:37:22 
Re: Directories Redux
anton@[EMAIL PROTECTED]   2008-04-10 19:06:56 
Re: Directories Redux
Bruce McFarling <agila  2008-04-09 15:21:11 
Re: Directories Redux
m_l_g3 <m_l_g3@[EMAIL   2008-04-09 16:16:00 
Re: Directories Redux
Bruce McFarling <agila  2008-04-09 22:08:00 
Re: Directories Redux
Bruce McFarling <agila  2008-04-10 19:39:57 
Re: Directories Redux
m_l_g3 <m_l_g3@[EMAIL   2008-04-11 04:43:45 
Re: Directories Redux
Bruce McFarling <agila  2008-04-11 09:28:57 
Re: Directories Redux
m_l_g3 <m_l_g3@[EMAIL   2008-04-11 10:49:13 
Re: Directories Redux
m_l_g3 <m_l_g3@[EMAIL   2008-04-11 11:19:53 
Re: Directories Redux
Bruce McFarling <agila  2008-04-11 20:34:02 
Re: Directories Redux
Bruce McFarling <agila  2008-04-12 07:18:01 
Re: Directories Redux
Bruce McFarling <agila  2008-04-12 10:56:41 
Re: Directories Redux
m_l_g3 <m_l_g3@[EMAIL   2008-04-14 08:35:17 
Re: Directories Redux
Bruce McFarling <agila  2008-04-14 12:46:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 7:52:37 CDT 2008.