[REBOL] Re: Rebol Enhancement Proposal - Embedding spaces in path! datatypes
From: joel:neely:fedex at: 10-May-2001 9:20
Hi, Petr and Andrew,
Petr Krenzelok wrote:
> Andrew Martin wrote:
>
> > Normal path! datatypes look like this:
> > word/sub-word/sub-sub-word
> > Currently Rebol doesn't understand strings in a path.
> > I'm proposing that
> > Rebol should return things using a string as a path...
> > Opinions? Problems?
>
> requested already for several times, proposed to [feedback--rebol--com]
> .... and I don't remember if there was any answer from RT folks or
> not, but me too would see it helpfull. So, RT - are there any
> technical problems?
>
> even more crazy datatypes path examples: :-)
>
> some-path/(evaluate code here)/sub-path ....
>
This last example is something I suggested quite a while back,
without
getting any response. It would do several nice things to clear up
some present referential-transparency-breakage situations.
For example:
>> now
== 10-May-2001/9:16:46-5:00
>> now/time
== 9:16:49
>> now/time/hour
** Script Error: now has no refinement called hour
** Where: halt-view
** Near: now/time/hour
>> foo: now/time
== 9:16:57
>> foo/hour
== 9
where NOW/TIME returns a TIME! value which has an /HOUR component.
However NOW/TIME/HOUR is interepted as asking NOW to apply two
refinements named /TIME *and* /HOUR. A nice usage of the paren!
type as a segment in a path would be
(now/time)/hour
which would avoid the need for another variable (e.g. FOO above)
just to get at the components of the function result.
-jn-