> From: bill lam
> Sent: Tuesday, 1 June 2010 11:47
>
> Втр, 01 Июн 2010, Sherlock Ric писал(а):
> > One solution would be to add jpathsep to the base library for J6 as a
> cover for jhostpath?
>
> Inside
> jpathsep=: '/'&(I.@(e.&'/\')@]})
>
> the replacement of '/' by '/' itself seem redundant.
>
> '/'&(I.@(e.&'\')@]}) or '/'&(I.@(=&'\')@]})
>
> seem sufficient.
Yes but jhostpath on Windows is:
'\'&(I.@(e.&'/\')@]})
The issue I'm trying to solve is as follows:
* In J6 on Windows PATHSEP_j_ used to be defined as '\'
* A number of utilities (jhostpath, getpath_j_, pathname) defined themselves
in terms of PATHSEP_j_.
* So when working with a path it was common to ensure that the path in
question was using PATHSEP_j_ first by using jhostpath or jpath.
* There is currently no single verb shipped in both J6 and J7 that will
ensure a path conforms to the conventions of its respective version (except
jpath but that has side effects for path starting with '~').
* This means it is currently cumbersome to write code intended to work on
both J6 and J7 (version detection is required or the use of jpath).
My original suggestion was to add jpathsep to J6 base library as a cover for
jhostpath. Another option is to retain jhostpath in J7 but as a cover for
jpathsep.
The advantages of the first option as I see it are:
* It will disappear overtime (new code/versions of the base library won't be
burdened with "compatibility code").
* jhostname sounds like it is dependent on the host but wouldn't be for
option two.
In fact it might be worthwhile retaining jhostname in J7 defined as:
jhostname=: ('\/'{~5= 9!:12 '') & (I.@(e.&'/\')@] })
for situations when a host dependent path is required.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm