|
|
Up |
|
|
  |
Author: Anton ErtlAnton Ertl Date: Aug 5, 2008 10:19
This is the third RfD on this topic. The second one was in July
2007. You find the updated text further down.
The main point of contention was about the prefix syntax. I solved it
by removing the prefix stuff.
Changes:
3rd RfD:
The main way to specify source-directory-relative filenames is now F",
not prefixes. Removed prefixes from proposal, but discuss them in the
Remarks section.
2nd RfD:
Added INCLUDE-NAME-ABS.
Added Sections "Which prefix?", "What if there is no currently
including file?", "Isn't specifying "/" as directory separator too
OS-specific?"
Replaced many mentions of "./" with "prefix".
Minor rewrites to make some prose clearer.
Problem:
Summary: How do I refer to another file that is distributed with the
Forth file at hand, in the presence of directories?
|
| Show full article (6.99Kb) |
|
| | 9 Comments |
|
  |
Author: Aleksej SaushevAleksej Saushev Date: Aug 5, 2008 11:56
> If there is ever a Forth 200x system for an OS that has a different
> directory syntax (e.g., VMS), the Forth system can translate the
> filename with the slashes into the native directory syntax (I guess
> that the POSIX layer for such OSs does the same).
What a naive statement.
How does one map filename with slashes into your syntax?
For instance, consider file with name "LL/SC" into subdirectory
"Lock/Wait Freedom", how do I refer to it given your syntax?
F" Lock/Wait Freedom/LL/SC"?
--
CE3OH...
|
| |
|
| | no comments |
|
  |
Author: jackojacko Date: Aug 5, 2008 12:31
> This is the third RfD on this topic. The second one was in July
> 2007. You find the updated text further down.
>
> The main point of contention was about the prefix syntax. I solved it
> by removing the prefix stuff.
Any simplification appriciated.
> Changes:
>
> 3rd RfD:
>
> The main way to specify source-directory-relative filenames is now F",
> not prefixes. Removed prefixes from proposal, but discuss them in the
> Remarks section.
Maybe I will add F" in the next release.
|
| Show full article (9.10Kb) |
| no comments |
|
  |
Author: Bernd PaysanBernd Paysan Date: Aug 6, 2008 01:32
Aleksej Saushev wrote:
>> If there is ever a Forth 200x system for an OS that has a different
>> directory syntax (e.g., VMS), the Forth system can translate the
>> filename with the slashes into the native directory syntax (I guess
>> that the POSIX layer for such OSs does the same).
>
> What a naive statement.
>
> How does one map filename with slashes into your syntax?
>
> For instance, consider file with name "LL/SC" into subdirectory
> "Lock/Wait Freedom", how do I refer to it given your syntax?
> F" Lock/Wait Freedom/LL/SC"?
There's no '/' allowed in VMS files:
"1. 2.1 - Character Set Support
|
| Show full article (1.51Kb) |
| no comments |
|
  |
Author: Anton ErtlAnton Ertl Date: Aug 6, 2008 03:49
jacko gmail.com> writes:
>Maybe I will add F" in the next release.
I would recommend waiting until the CfV is out. Until then the
proposal may still change.
- anton
|
| |
| no comments |
|
  |
Author: Anton ErtlAnton Ertl Date: Aug 6, 2008 04:31
>> If there is ever a Forth 200x system for an OS that has a different
>> directory syntax (e.g., VMS), the Forth system can translate the
>> filename with the slashes into the native directory syntax (I guess
>> that the POSIX layer for such OSs does the same).
>
>What a naive statement.
>
>How does one map filename with slashes into your syntax?
That's up to the system implementor to decide.
>For instance, consider file with name "LL/SC" into subdirectory
>"Lock/Wait Freedom", how do I refer to it given your syntax?
>F" Lock/Wait Freedom/LL/SC"?
If you want to write a portable Forth program, you won't use slashes
in the file name, because then it won't work on most OSs.
|
| Show full article (1.80Kb) |
| no comments |
|
  |
Author: Albert van der HorstAlbert van der Horst Date: Aug 6, 2008 10:25
>
>
>Why not use a CD word for this purpose?
>
>While a word for changing the current working directory may have its
>uses in Forth, it is usually not a good idea to change the working
>directory for loading code. Apart from the usual nesting/unnesting
>complications, the user usually sets the working directory to some
>directory on purpose, because that's where he is working; the program
>or library directory is usually not where he is working. If the user
>passes a data file name to the included file, he expects it to be
>interpreted in the context of his working directory, not the program's
>directory.
I agree it is not a good idea to use CD to load code.
But I contend that it is a good idea to use CD to load and run code.
|
| Show full article (1.37Kb) |
| no comments |
|
  |
Author: Aleksej SaushevAleksej Saushev Date: Aug 6, 2008 13:53
Bernd Paysan writes:
> Aleksej Saushev wrote:
>
>>> If there is ever a Forth 200x system for an OS that has a different
>>> directory syntax (e.g., VMS), the Forth system can translate the
>>> filename with the slashes into the native directory syntax (I guess
>>> that the POSIX layer for such OSs does the same).
>>
>> What a naive statement.
>>
>> How does one map filename with slashes into your syntax?
>>
>> For instance, consider file with name "LL/SC" into subdirectory
>> "Lock/Wait Freedom", how do I refer to it given your syntax?
>> F" Lock/Wait Freedom/LL/SC"?
>
> There's no '/' allowed in VMS files:
|
| Show full article (0.90Kb) |
| no comments |
|
  |
Author: Bruce McFarlingBruce McFarling Date: Aug 6, 2008 22:08
On Aug 5, 3:31 pm, jacko gmail.com> wrote:
> In general I would prefer a URL syntax. But F" has advantages,
> although why you would need another word to get the absolute one when
> F" would place the absolute one on the stack is another matter.
Anytime there is a parsing word, sooner or later someone will want a
non-parsing version. Commonly that non-parsing version already exists
as a factor ... but if the name is not specified, then the name used
for the non-parsing factor will vary from one implementation to
another.
|
| |
| no comments |
|
  |
|
|
  |
Author: Guido DraheimGuido Draheim Date: Sep 10, 2008 19:53
Anton Ertl schrieb:
> This is the third RfD on this topic. The second one was in July
> 2007. You find the updated text further down.
>
> The main point of contention was about the prefix syntax. I solved it
> by removing the prefix stuff.
> [...]
>
> F" lib1/lib.fs" required
> F" data.txt" r/o open-file
> S\" ./funny\"filename" include-name-abs r/o open-file
>
|
| Show full article (1.09Kb) |
| no comments |
|
|