r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

RobertS
13-Sep-2007
[843x3]
the path is just word1/word2 and then is just word1/word/word3

Only word1 ever binds to a value
word1/word2/word3 ; guy can't even type ...
The path! that my 'pword func returns responds as expected to 'do
Chris
13-Sep-2007
[846]
Iin your example (again, if I understand correctly), 'do (or default 
behaviour) resolves each stage in the path.  So, with a given path 
-- t2/f/b -- it'll go t2/f == 't1-- but this is just a word, not 
the value associated with the word.

It's equivalent to this:
val: 't1
val/b
RobertS
13-Sep-2007
[847]
But is any valid deep path only the forst word has to have  a value 
associated with it.
  e.g. 
     block/tag1/tag2/tag3
Chris
13-Sep-2007
[848]
Only if you're evaluating with 'do.
RobertS
13-Sep-2007
[849]
Even if I am doing
   result: constructedPath
Chris
13-Sep-2007
[850]
That's sort of the same as evaluating with 'do.
RobertS
13-Sep-2007
[851]
What should the behavior of 'join and 'append' and 'insert be when 
passed a path and a word?
Chris
13-Sep-2007
[852]
What I'm getting at is there are limitations in the default handling 
of paths.  But paths are series and you can evaluate them however 
you want to.
RobertS
13-Sep-2007
[853x2]
Yes, get first path is a godsend
Here is what Carl has said:

Of course, not to discourage anyone, but we're going to be careful 
and choosy about what becomes part of R3. We've got our standards. 
We still value small, fast, and smart. REBOL is about getting great 
advantage and leverage from a well-designed tool, not about becoming 
yet another bloated and hard-to-manage computer language.
Chris
13-Sep-2007
[855]
join foo/bar 'ton -- will try and evaluate foo/bar then append 'ton
join 'foo/bar 'ton -- will give you 'foo/bar/ton
RobertS
13-Sep-2007
[856]
That is great but also of no help if a word is holding the path
   'foo/bar
I was hoping the solution was in
   to-lit-word
Chris
13-Sep-2007
[857]
path: 'foo/bar
join path 'ton ; ??
RobertS
13-Sep-2007
[858]
fails with 
  ** Script Error: Cannot use path on word! value
Chris
13-Sep-2007
[859]
Hmm, works here.
RobertS
13-Sep-2007
[860x2]
to-path reduce[path 'word]   ; works OK but what a klunk
Only if the blocks are literaly embedded.
Could you try with the example
  t1
  t2
Chris
13-Sep-2007
[862]
join to-path 't2 't1
RobertS
13-Sep-2007
[863x3]
no, in the example that I posted above :-)
>> t1: [a "one" b "two" c "three"]

>> t2: [f t1]
'f has no value so it is just like a functor
I am not askeing to be able to just use
   t2/f/a
with no further ado
I must build the path
   newPath: to-path reduce [ t2/f  'a]

is a pain ( and only because of how to-path is implemented;  to-lit-path 
is no more help as far as I can see at this hour
Chris
13-Sep-2007
[866x2]
I'm not sure why -- newPath: join 't2/f 'a -- doesn't work...
Hold on, -- join to-path t2/f 'a --??
RobertS
13-Sep-2007
[868x2]
That just caused Rebol 2.6.3 to blow away
I did not send teh missuve to Microsoft that I was proffered
the missive
Chris
13-Sep-2007
[870]
It works on 2.6.2 (Mac) 2.7.5 (Win)
RobertS
13-Sep-2007
[871x2]
let me fire up Rebo/View again
but how will this help me where I have a WORD that is holding that 
initial, partial, path ?
Chris
13-Sep-2007
[873x2]
join to-path do path 'a
path: 't2/f
do join to-path do path 'a
RobertS
13-Sep-2007
[875x2]
;same error
>> t1: [a "one"]
== [a "one"]
>> t2: [f t1]
== [f t1]
>> pp: join 't2/f 'a
== t2/f/a
>> do pp
** Script Error: Cannot use path on word! value
** Where: halt-view
** Near: t2/f/a
>>
2.6.3 just ditched me again with that one ...
Chris
13-Sep-2007
[877]
This is the limitation of evaluating paths.  'do does not evalute 
't1 when it is returned from 't2/f
RobertS
13-Sep-2007
[878x2]
I think 2.6.3 does not want 'path used as a word ;-)
so do you think that   
   to-path reduce [ my-path  'my-next-refinement]
the best that I can do?
Chris
13-Sep-2007
[880]
If your interpreter chokes on 'join, then I guess so...
RobertS
13-Sep-2007
[881x4]
I could try just Rebol/Core and see if that make a difference

It is not very often that Rebol blows out on me ... I can't remember 
when last before I started looking at my functor issues
That's 3 times tonight with only 2 teeny blocks and 2 paths  and 
no do against any file and nothing added to user.r
ah-ha !
Works fine in Rebol/Core  ! 

path: 't2/f
do join to-path do path 'a
Nope.

Back to View and this time Rebol did not blow out of the water .... 

Is there a dump.log that I can look at see what these fatal errors 
have been ?
Chris
13-Sep-2007
[885]
Not sure.  Try working with -- trace on
RobertS
13-Sep-2007
[886]
>> t1: [a "one"]
== [a "one"]
>> t2: [f t1]
== [f t1]
>> path: 't2/f
== t2/f
>> do join to-path do path 'a
== "one"
; thanks CHRIS
Chris
13-Sep-2007
[887]
Hey, if it works : )
RobertS
13-Sep-2007
[888]
I would not have stumbled on the 
   do path
any too soon, I fear ... ;-)
Chris
13-Sep-2007
[889]
It's not the most intuitive move, for sure.
RobertS
13-Sep-2007
[890x3]
I am adding 
   augpath: func [{augment path with a word}
to my armory
Now to find out what typo of mine is able to blow 2.6.3 outa the 
wadder
augpath: func [{ augment a PATH with a WORD }path 'word] [
      return join to-path reduce[path] :word]
; augpath t2/f a