• Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

AltME groups: search

Help · search scripts · search articles · search mailing list

results summary

worldhits
r4wp212
r3wp1716
total:1928

results window for this page: [start: 901 end: 1000]

world-name: r3wp

Group: RAMBO ... The REBOL bug and enhancement database [web-public]
Anton:
4-May-2007
foreach [style obj] svv/vid-styles [print mold to-lit-path reduce 
[style in obj 'color]]
Anton:
4-May-2007
foreach [style obj] svv/vid-styles [print mold to-lit-path new-line/all 
reduce [style in obj 'color] off]
Oldes:
4-May-2007
foreach [style obj] new-line/all svv/vid-styles off [print mold to-lit-path 
reduce [style in obj 'color]]
Oldes:
4-May-2007
and why you use [style in obj 'color]?  this will works as well: 
foreach [style obj] svv/vid-styles [print mold to-lit-path reduce 
[style 'color]]
Oldes:
4-May-2007
foreach [style obj] svv/vid-styles [print mold to-lit-path reduce 
[style get in obj 'color]]
Anton:
4-May-2007
This is the reduction:
>> to-lit-path first new-line/all [word] on
== '
word
Anton:
4-May-2007
I think it is an error, since I am molding a lit-path which can't 
be loaded back, because of the newline between the ' and the first 
word.
Anton:
10-May-2007
TO-PATH is affected the same way.
Anton:
10-May-2007
TO-SET-PATH is also affected.
Anton:
10-May-2007
and you can move the word into other series datatypes like path, 
then back to a block and see the new-line has followed it.
Anton:
22-May-2007
Copy/part can't use a path! as its RANGE argument

>> path: 'svvc/color
== svvc/color

>> copy/part path back tail path
** Script Error: Invalid /part count: color
** Near: copy/part path back tail path
Anton:
22-May-2007
This is interesting because a path is a series, supposedly very similar 
to a block.
Oldes:
10-Jun-2007
There is a bug in decode-url:
>> probe decode-url http://test/path/target?text/something
make object! [
    user: none
    pass: none
    host: "test"
    port-id: none
    path: "path/target?text/"
    target: "something"
]

the target should be: target?text/something
Oldes:
10-Jun-2007
the bug is in the URL-parser of course... there should not be ? char 
in path-chars
Oldes:
13-Jun-2007
never mind, you can delete it, I already have a solution... anyway... 
it would be nice to replace the clean-path function with the Anton's 
simple-clean-path
Henrik:
16-Jul-2007
DocKimbel, #4288 looks to me like it inserts a molded object into 
the path.
Dockimbel:
16-Jul-2007
Yes, it returns the object source and the point is is this useful 
to anyone ? I was hoping the behaviour of :b in a path! could be 
changed to something more useful, like acting as a pass-thru to /c, 
so that, in the ticket example, a/:b/c would results in %path/target.
Henrik:
16-Jul-2007
slipping objects into a path...
Henrik:
16-Jul-2007
>> a: %path
== %path
>> b: context [c: %target]
>> a/:b/c
== %path/c: %target%0A/c
>> a/(:b/c)
== %path/target
Group: Core ... Discuss core issues [web-public]
Graham:
5-Oct-2005
I wonder if there can be some refinement to 'read so that when it 
reads a directory, it returns the full path for each file rather 
than just the file name.
Volker:
6-Oct-2005
hmm, i see its a path. so [pad n ###.##] would work without quotes 
:)
Volker:
6-Oct-2005
its path -> is issue
Anton:
16-Oct-2005
Louis, in Core or View ? In View, you can read/write to the public 
cache.

This is VIEW-ROOT (the directory you selected during install, by 
default it is in a windows user profile directory).

When you click on an app from a rebsite, it is saved (by READ-THRU, 
PATH-THRU) into the public cache before running.
So, if it is your app, say at 
http://yoursite.com/app.r
then it could save prefs files to
path-thru http://yoursite.com/app-prefs.r
eg.
	save path-thru http://yoursite.com/app-prefs.r[my prefs data]
Anton:
16-Oct-2005
In Core, I define some of those useful functions from View (VIEW-ROOT, 
PATH-THRU etc..) in the user.r to allow the same functionality.
BrianH:
30-Oct-2005
While reviewing the action! functions, I noticed the path action. 
The doc comment says "Path selection.". The parameters aren't typed. 
Does anyone know what this action does, and how to use it? Or whether 
it can be called directly at all?
Volker:
30-Oct-2005
path seems to be a "clear find". Do not know about uses.
OneTom:
30-Oct-2005
and fucks it up somehow, because if i change the unset!  to something, 
the path still stays in a strange state
Volker:
30-Oct-2005
!> a: [b 1 c 2 d 3]
== [b 1 c 2 d 3]
!> path a 'c
!> a
== [b 1 c]
!> length? a
== 6
!> a/4: 12
== 12
!> a
== [b 1 c 12 d 3]
Volker:
30-Oct-2005
Its a good idea to know about it. Seems its possible to path action! 
to protocol. at least i made a 'find in a  protocol once and got 
all the refinements.
Volker:
30-Oct-2005
to path -> to pass ..
BrianH:
30-Oct-2005
At this point, I can't imagine what the path action! would be good 
for. Perhaps it is part of the object! internals?
Volker:
30-Oct-2005
Cant have a use, else i had heard of it :) Practical use: it blocks 
mold. Recursive data, Code-obfuscation?
!> a: context[b: 1 c: 2]  path a 'b  ?? a
a: make object! [
    b: end
    c: 2
]
BrianH:
30-Oct-2005
I'm going to copy my path question to RT Q&A.
Gabriele:
31-Oct-2005
path is internal, and should probably not be exposed. my guess is 
that it has to do with path evaluation.
BrianH:
31-Oct-2005
I mean, it says "Path selection." right in the doc comment so that's 
a good guess :) But how does it help with path selection? How is 
it used? Just for implementing set-path assignment?
BrianH:
31-Oct-2005
For that matter, what types implement the path action?
Gregg:
5-Nov-2005
Adding things like this to path notation hides a lot of compuational 
complexity. Sometimes that's a very good thing, and sometimes it's 
not. And consider what should happen in the case that "my-block/[2 
3]" refers to a two-dimensional array, or a block of name value pairs; 
what should the result be? Something like that fits very well in 
a dialect where the power is leveraged, and the domain is tightly 
constrained. That's where we get power and safety combined.
Terry:
12-Nov-2005
rebol []

theTOC: ask "Table of contents (seperate with <p></p> tags): "
theHeader: ask "Header: "
theNumOfBars: ask "Number of chart bars: "
outputPath: ask "Save path (with trailing / ie: c:/): " 


getTemplate: read http://o7o.org/files/aflax/examples/barchart/barchart.html

getSWF: read/binary http://o7o.org/files/aflax/examples/barchart/aflax.swf

replace/all getTemplate "$TOC" theTOC
replace/all getTemplate "$theHeader" theHeader
replace/all getTemplate "$numOfBars" theNumofBars

write to-rebol-file join outputPath "barExample.html" getTemplate
write/binary to-rebol-file join outputPath "aflax.swf" getSWF
browse to-rebol-file join outputpath "barExample.html"
Volker:
28-Nov-2005
No good ways. You can build a path and do that.
Henrik:
28-Nov-2005
you lost me :-) but it's ok, I'll try something with build-path...
Geomol:
28-Nov-2005
You can do this:

do to-path reduce ['do-a-function either condition ['ref][none]] 
<argument>
but if it's less clumpsy, you deside!
BrianH:
29-Nov-2005
; Try this way, no reduce or to-path...

do either condition ['do-a-function/ref] [:do-a-function] <argument>
Graham:
30-Nov-2005
works with "path" ..
Gordon:
8-Dec-2005
Nevermind.  
It turns out that if you use
FireName: to-file request-file/file "/C/Program Files/"
that it will split the path and name at the space.
OTOH if you use

Filename: to-file request-file/file "/C/Program Files/*" (note character 
after the path)

that this will work.  The character after the path can be any character.
MichaelB:
13-Dec-2005
can somebody give me a quick rule, why the pick-path notation evaluates 
it's picked value and pick does not (and first...) (as it should 
be a shorthand for pick)
as in:
bl: [] 
append bl func [a][print a]
bl/1 "hello" ;evaluates the function
pick bl 1 "hello" 
first bl "hello"  ; both do not

I have to do an extra 'do - I'm just curious for a reason ?!
Geomol:
13-Dec-2005
The explanation might be, that it should be possible to get the function 
without evaluating it. You can do that with PICK or FIRST:
f: pick bl 1
f: first bl

Now if bl/1 worked the same way, you always had to add DO to get 
it evaluated. So my guess is, Carl desided, that wouldn't be too 
smart, and I agree. It's the same with objects. To call a method 
(a function) within an object, you just write:
o/some-func

No DO is needed in front of that. So using path notation to get to 
a function within a block or an object will evaluate the function.
MichaelB:
14-Dec-2005
Thanks for the answers. Maybe this should be noted somewhere especially 
- when I was searching for it, the only thing I found is in the documentation 
in the examples for unnamed functions. There only the path notation 
was used to extract and evaluate the functions immediately.

I agree that this evaluation is good to have and on purpose, just 
a bit too hidden for my taste (one again has to have quite some undestanding 
how Rebol works to have a resonable model for these things or a big 
memory) - as some other things in Rebol.
Ladislav:
15-Dec-2005
any notes on this?:

>> trim/tail/with "0100" "0"
** Script Error: Invalid path value: with
** Near: trim/tail/with "0100" "0"
Robert:
7-Jan-2006
question concerning 'get: First, why doesn't get support something 
like "get my-object/user-data"? Next, how to get a path word?
Henrik:
7-Jan-2006
path word? such as

in my-object 'user-data

?
Henrik:
24-Jan-2006
does anyone know what PATH is good for?
Anton:
25-Jan-2006
Henrik, PATH is a function used internally by rebol but probably 
accidentally exposed globally.
Anton:
30-Jan-2006
The first of the two examples above shows how to use path notation 
to select and change values in a block.

The second of the two examples above shows how to use a "throwaway" 
context to store new words in, then to reference these words from 
inside a block.
Both examples are showing how to use blocks instead of objects.

One of the advantages of objects is the convenient path syntax to 
get to a value. Hopefully, the above examples show how this can be 
done with blocks.
Henrik:
31-Jan-2006
then I have a function that asks for a specific relation by diving 
down a path with a block like: [customers 1234 invoices 45 articles 
15] to find customer 1234 who has invoice 45 which holds article 
15

then there is a function to add and remove relations
MichaelB:
3-Feb-2006
this might be something dangerous:

write %test.r "hello"
path: what-dir
remove back tail path
write %test.r "hello" ; this fails


problem is: what-dir returns directly system/script/path what seams 
to be used in order to resolve relative file values

I just recognized it using the request-dir from didec which was in 
the rebgui distro -038 (he's doing this in the request-dir function 
in the line with


if all [not empty? path slash = last path][remove back tail path] 


so question is whether this is a bug and belongs to rambo, is ok 
(I don't think so) or what else ?

might also be that didec changed this in a later version (script 
was dated 2003 and maybe at this time 'what-dir had a different behavior), 
but this doesn't matter regarding what 'what-dir returns
MichaelB:
3-Feb-2006
yes that's what I mean, nothing wrong with rebol, but who guesses 
that this returns a really vulnerable path
DideC:
6-Feb-2006
MichaelB: about the path problem in request-dir, it's a bug in the 
code.


The simple solution is to patch this line (in request-dir func at 
the end of the script :
	if not all [keep path] [path: any [where what-dir]]
like this :
	if not all [keep path] [path: copy any [where what-dir]]
DideC:
6-Feb-2006
the 'path word is local to ctx-req-dir context and the Rebol path 
must not be changed by it. It's up to the "user code" to change it 
if he wants to.
DideC:
6-Feb-2006
But I agree that Rebol should check if path is "complete" (trailing 
"/") before using it in read/save/load/... functions
Henrik:
9-Feb-2006
consider it a flimsy prototype. requires list-view.r to be in the 
same path as the script
Pekr:
9-Feb-2006
Henrik - wrong link to list-view on the above reblog.html .... /reblog/ 
in the path should not be there ...
Anton:
11-Feb-2006
Graham, anamonitor can examine custom objects, not just the system 
object. You just need to type in a word/path which refers to the 
interesting object.
JaimeVargas:
23-Feb-2006
If you download the src code the paths is user-path/orca/trunk/orca/tests/
Gabriele:
8-May-2006
i think there are issues with ftp as a url path is not guaranteed 
to match the file system path
Sunanda:
8-May-2006
A URL path is _supposed_ to map to the file system path _if_ the 
scheme is ftp://
/
 has no assumed hierachical meaning in other URL schemes.
Hence the confusion at times.

I think REBOL is playing safe in not assuming the mapping. And, given 
how badly many FTP clients are written, that is probably for the 
best.
Henrik:
22-May-2006
Why can't I find paths in a loadable block?

>> t: [x/y]
== [x/y]
>> type? first t
== path!
>> find t 'x/y
== none
>> find t to-path 'x/y
== none
BrianH:
23-May-2006
Paths are structures like blocks. Find doesn't do structure analysis 
on block types like that - it just tries to determine if the exact 
same path is there, not another that resembles it.
Anton:
30-May-2006
You can also use the above patch to only create the path like this:
Anton:
31-May-2006
Sorry, that wasn't very clear..  Use my code snippet above just to 
create the path.
	port: make port! ftp-spec  ; only path, no target

 port/state/flags: port/state/flags or system/standard/port-flags/open-new
	port/handler/open port
	close port
; now try to open/direct ... etc..
JaimeVargas:
14-Jun-2006
Humm. I give up. Has somebody found a solution to the path capture 
problem?

#!/usr/local/bin/rebol -sq
REBOL []
print first system/options/args
JaimeVargas:
14-Jun-2006
What I need is to be able to capture the full path of the first arg 
passed to such script.
JaimeVargas:
14-Jun-2006
The reason is that the script is no of the same path of /usr/local/bin 
the script fails to find the file.
Ingo:
14-Jun-2006
Hi Jaime,
I think you're looking for this

system/script/path
Volker:
14-Jun-2006
IIRC the shell-dir is somewhere there. Or try system/options/script/parent/path.
JaimeVargas:
14-Jun-2006
Thx, Ingo and Volker, what I was looking for is SYSTEM/OPTIONS/PATH
Oldes:
17-Jun-2006
read-thru-to: func[url target /local data loc-path][
	either exists? target [read/binary target][
		loc-path: first split-path target
		if not exists? loc-path [make-dir/deep loc-path]
		write/binary target data: read/binary url
	]
	data
]
Anton:
17-Jun-2006
Oldes, Volker, I put into my rebol/core  user.r  file:
	view-root: dirize clean-path system/options/home/../view
	user-prefs: context [debug: none] ; fake user-prefs
	vbug: func [msg [block! any-string!] /local dbg][
	    if not dbg: user-prefs/debug [exit]
	    msg: head insert remold msg "view "
	    either file? dbg [write/append dbg msg] [print msg]
	]

along with the source to these functions:
	path-thru
	exists-thru?
	read-thru
	load-thru
	read-net
Gregg:
15-Jul-2006
; Does this work for you Graham?

REBOL []

; GET-ENV is a standard REBOL function now

; environment variable APIs
; msvcrt.dll
; getenv _putenv _environ
; char *getenv( const char *varname );
; int _putenv( const char *envstring );

lib:  load/library %msvcrt.dll

get-env: make routine! [
	varname [string!]
	return: [string!]
] lib "getenv"

put-env: make routine! [
	env-string [string!]
	return:    [integer!]
] lib "_putenv"

remove-env-var: func [name [string!]] [put-env join name "="]

env-var-exists?: func [name [string!]] [
	either "^@" = get-env name [false][true]
]

tz-set: make routine! [
	return:    [integer!]
] lib "_tzset"

print get-env "path"
print get-env "lib"
print get-env "temp"
print get-env "test"

if 0 <> put-env "test=blah" [
	print "error writing environment variable"
]
print get-env "test"
remove-env-var "test"
print mold get-env "test"

print get-env "TZ"
tz-set

free lib

halt
Anton:
6-Sep-2006
Using a path like that is not safe if you want to pop a function. 
It will call the function. To avoid that use either FIRST or PICK 
my-list 1
Anton:
6-Sep-2006
So you get that weird looking error message when using path notation.
Henrik:
21-Sep-2006
what's the easiest equivalent to:

>> set to-path [a b c] 7 ; doesn't work
Rebolek:
21-Sep-2006
Certainly not the most elegant sollution:
set-path: func [pth val /local rslt][
	rslt: copy []
	head insert/dup head rslt [in get] -1 + length? pth

 repeat i length? pth [append rslt to block! form to path! reduce 
 ['pth i]]
	set do bind rslt 'pth val 
]
Rebolek:
21-Sep-2006
>> a: context [b: context [c: 0]]
>> a/b/c
== 0
>> set-path [a b c] 7
== 7
>> a/b/c
== 7
Ladislav:
21-Sep-2006
do reduce [to set-path! [a b c] 7]
Henrik:
21-Sep-2006
do reduce bind [to set-path! [a b c] 7] 'a does not seem to work
Ladislav:
21-Sep-2006
do reduce bind [to set-path! [a b c] 7] 'a does not seem to work

 - right, that is not supposed to do anything meaningful, it simply 
 keeps the context the word 'a had
Ladislav:
21-Sep-2006
>> a: context [b: context [c: 0]]
>> do reduce [to set-path! [a b c] 7]
== 7
>> a/b/c
== 7
Henrik:
21-Sep-2006
load mold reduce [to set-path! ... ] seemed to work
Henrik:
21-Sep-2006
rel-obj: make object! []

add-relation: func [path-block [block!] /local p v w] [
  p: to-block 'rel-obj
  parse path-block [
    any [
      [set w word! (
        unless all [

          find either object? do to-path p [first do to-path p][[]] w
          insert tail p w
        ] [

          do load mold reduce [to set-path! p make do to-path p reduce [to-set-word 
          w none]]
        ]
      ]
   ]
]

I'm not sure it's enough...
Henrik:
21-Sep-2006
I'm rewriting my relations engine, if you remember that one.


I need to traverse rel-obj via paths, so I store the path as words 
in a block. This is in order to maintain the current position in 
a deep object.


The input can be any arbitrary path of words and values. If the values 
or words don't exist, they will be created on the fly. That's what 
I use 'p for.
Group: Syllable ... The free desktop and server operating system family [web-public]
Kaj:
7-May-2010
No, it's additional. We've long planned the graphical Linux to force 
a migration path for Syllable Desktop
Group: !REBOL3-OLD1 ... [web-public]
BrianH:
1-Sep-2006
Right, otherwise you are adding a comparison nd a path decode to 
every conjoin/reduce call.
Volker:
1-Sep-2006
mybe allow datatypes too, join-as url![ "http://server/"rel-path]
Maxim:
12-Feb-2007
but this tricky word usage usually breaks in situations like path 
notation
Geomol:
12-Feb-2007
My suggestion is close to Ladislav's ++ function above and is something 
like:

>> inc: func [x] [either word? x [set x 1 + get x] [x + 1]]


But as Maxim point out, there are ploblems with paths. But what is 
the path representing? A block or an object or what? If it's in an 
object, it'll work this way:

>> o: make object! [a: 0]
>> inc in o 'a

It's harder to deal with values inside blocks.
BrianH:
12-Feb-2007
; INC/DEC with regular arguments, must use lit-word! or lit-path! 
directly to get side effects:
increment: func [
    [catch] x "Value to increase"
    y [integer!] "Amount to increase by"
    /local t
] [
    throw-on-error [
        if path? :x [
            x: in do copy/part :x back tail :x last :x
        ]
        t: either word? :x [do :x] [:x]
        case [
            series? :t (t: skip :t y)
            number? :t (t: t + y)
        ]
        either word? :x [set/any x :t] [:t]
    ]
]
inc: func [[catch] x] [increment :x 1]
dec: func [[catch] x] [increment :x -1]
decrement: func [
    [catch] x "Value to decrease"
    y [integer!] "Amount to decrease by"
] [increment :x negate y]
BrianH:
12-Feb-2007
Ladislav, I prefer the latter, but that's because I'm used to REBOL 
evaluation semantics and like metaprogramming. If you are incrementing 
a word returned from a function, other than in the most common case 
of the IN function for path access already covered by the code, you 
have to put the call to the function in a paren for it to evaluate 
properly. The latter functions will at least always behave the way 
you would expect REBOL to behave - no magic evaluation, pass-by-name 
for side effects, etc.


I think the lit-word argument form is a little awkward for anything 
other than interactive use, like HELP and SOURCE.
BrianH:
12-Feb-2007
Sorry, I just realized that was a confusing answer (to anyone other 
than Ladislav :). To clarify:


By call-by-name, I meant passing a word or path value to the function, 
rather than passing the value it refers to. If you have 'a formal 
arguments then call-by-name is implicit - if you have regular formal 
arguments then you must explicitly express call-by-name by writing 
the 'a as the actual argument, at the time of the call.


When I was talking about having to put function calls in parens, 
I meant any function calls or expressions that return the values 
that would then be passed to the INC/DEC function in their first 
argument. The first version of the functions, with the 'a argument, 
would need to put any word or path generating expression in parentheses 
for it to work properly. The second version of the functions would 
not require such a hack - you could use normal REBOL evaluation patterns.


One of the normal REBOL evaluation patterns is that call-by-name 
is explicit for all functions, except interactive functions used 
for documentation like HELP and SOURCE. This is why I prefer the 
latter functions above, the ones with normal formal arguments: Their 
behavior is more REBOL-like.
Geomol:
13-Feb-2007
There might be options to solve the path situation:
inc some/object/some/'value
inc some/object/some/('value)
or maybe
inc '(some/object/some/value)
Just suggestions.

If you think, "inc a" should change a, then think about these, that 
we have today:
negate a
- a ; unary minus
abs a

Also many math functions, like:
exp a
log-e a
etc.

Why don't all those change a?
BrianH:
13-Feb-2007
I already solved the path situation. Read the code.
901 / 192812345...89[10] 1112...1617181920