Just a note on filenames. I'm not really happy with the
"filename as string" concept. However for the moment Felix is using
strings as filenames instead of an abstract type or whatever.

Directory::mk_absolute_filename

can be used to get an absolute filename from a relative one, but this
really isn't good enough for comparisons. I dont think it handles names 
like

        fred/../joe/./max

but it probably should.

My general concept here is that filename consist of a "device" 
or filesystem identifier which is a platform native prefix and which
never takes part in any computations (except prefixing :)

Then you have a list of path components, a final basename
and extension. The relative path bit is in a platform agnostic format
so is a bit easier to manipulate than simple string.

A sub-theory of this theory is that programs should always use
a prefix and a string in UNIX format, even on Windows.
The string is translated magically. SO when you read a filename
somewhere you have to translate it to unix format, work with that.
The system translates back as require on actual file accesses.

However this model ignores two very important factors.

1. i18n.

Yes, Linux is sane, it uses UTF8. But other OS including Windows don't,
they use UTF16 instead. Unicode is better than the old code pages crap
but it still has a lot to answer for!

2. Weird devices. Like

        http://localhost:1234/

There's some sense in saying a filename "should" be a URI.
So you "should" say

        file:filename ...

all the time. This actually subsumes point (1), since the rules for 
i18N/unicode are well specified.


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to