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 19 of 20 Topic 3988 of 4053
Post > Topic >>

Re: Directories Redux

by m_l_g3 <m_l_g3@[EMAIL PROTECTED] > Apr 14, 2008 at 08:35 AM

[long discussion: we need some word(s) that would allow people
to portably specify that some source file to be INCLUDED
comes from a library, or that its path is relative to the path
of the current file]


On Apr 12, 7:34 am, Bruce McFarling <agil...@[EMAIL PROTECTED]
> wrote:
> On Apr 11, 2:19 pm, m_l_g3 <m_l...@[EMAIL PROTECTED]
> wrote:
>
> > INFORMATIVE  we must allow the no-op implementation like
> > : ANCHORED ;
>
> Why?
>
> If it does not translate from a relative file reference to an absolute
> file reference, it is better that it not exist in the dictionary than
> that it exists but does not perform the semantics of ANCHORED.


Why do you require that the paths returned from [LIB-]ANCHODED
are namely *absolute*?

IMO, it is enough to know that the file will be found in the right
directory.
Anyway, a portable program will have no way to distunguish between
absolute and relative (because it will not know under which OS, if
any,
it is running).
By the way, "%SRCDIR%/aux/foo.fth" is not really absolute.


> ANCHORED ( ca1 u1 -- ca2 u2 )
> Translate the relative file reference in the string referred by
>     ( ca1 u2 )
> into an absolute file reference.

> If executed from within a file script, the reference is relative to
> the location of that file script within the file system. If executed
> from the command line, the reference is relative to an implementation-
> defined location in the file system.

> The relative file reference consists of a file name and optional
> subdirectory prefix. Any subdirectory name in the subdirectory prefix
> concludes with the the subdirectory separator ``/''. The format of the
> absolute file reference is the implementation-defined format for use
> with the standard word INCLUDED.

> The absolute file reference returned by ANCHORED may be over-written
> by the next invocation of ANCHORED or LIB-ANCHORED.

My understanding of this text is:
relative = relative to the path of the current file
absolute = not relative to the path of the current file, but whatever
the system imlementor likes.

The text
> The format of the
> absolute file reference is the implementation-defined format for use
> with the standard word INCLUDED.
indicates that it the "absolute" file reference format is defined not
even by OS, but by the Forth system.

Therefore, "absolute" may in fact be relative to a location
chosen by the implementor, for example, relative to
the installation diretory.


In addition, INCLUDE may already have some built-in logic. For
example, it may consider all file references as relative to the
location of the current file. (IOW, INCLUDE already does what ANCHORED
is for). IMO, in this case it is acceptable to allow a no-op ANCHORED.


> it is better that it not exist in the dictionary than
> that it exists but does not perform the semantics of ANCHORED.

The mentioned semantics is built into INCLUDED.
ANCHORED may be a no-op.

(yes, loading from the current directory will be a problem... at
least, without WRK-ANCHORED)




 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:58:10 CDT 2008.