World: r3wp
[Core] Discuss core issues
older newer | first last |
Anton 19-Feb-2007 [7225] | Sorry, my first comment above "resumes from most FTP sites" should be "HTTP sites". I've not widely tested it with FTP, only with a few FTP files Graham was using for his EMR project. |
Robert 19-Feb-2007 [7226] | Ok, so it's for HTTP download? That's good! :-) |
Oldes 19-Feb-2007 [7227] | What would be the best way how to delete for example last 100 lines from really large file? |
Robert 19-Feb-2007 [7228] | PATH: Looks like a simplyfied find & copy combination to me. >> ? path USAGE: PATH value selector DESCRIPTION: Path selection. PATH is an action value. ARGUMENTS: value -- (Type: any) selector -- (Type: any) >> a: [1 2 3 4 5] == [1 2 3 4 5] >> path a 3 >> a == [1 2] >> path a 3 >> a == [1 2] >> a == [1 2] >> head? a == true >> head a == [1 2] >> a == [1 2] >> tail a == [] >> a == [1 2] >> a: [1 a 2 b 3 c 4 d 5 e] == [1 a 2 b 3 c 4 d 5 e] >> path a 'd >> a == [1 a 2 b 3 c 4 d] >> a: [1 a 2 b 3 d c 4 d 5 e] == [1 a 2 b 3 d c 4 d 5 e] >> path a 'd >> a == [1 a 2 b 3 d] >> a: [1 a 2 b 3 d c 4 d 5 e] == [1 a 2 b 3 d c 4 d 5 e] >> path a 't ** Script Error: Invalid path value: t ** Near: path a 't >> a: [1 a 2 b 3 [d] c 4 d 5 e] == [1 a 2 b 3 [d] c 4 d 5 e] >> path a 'd >> a == [1 a 2 b 3 [d] c 4 d] >> path a [d] >> a == [1 a 2 b 3 [d]] >> a: [1 a 2 b 3 [d] c: 4 d 5 e] == [1 a 2 b 3 [d] c: 4 d 5 e] >> path a to-set-word 'c >> a == [1 a 2 b 3 [d] c:] >> |
Oldes 19-Feb-2007 [7229x3] | I don't thing it's correct behaviour: >> a: [1 2 3 4 5] == [1 2 3 4 5] >> path a 3 >> a == [1 2] >> a/3 >> a/4 == 4 >> a/5 == 5 >> length? a == 5 >> a == [1 2] |
>> type? a/3 == unset! | |
I think it just corrupts the block somehow | |
Izkata 19-Feb-2007 [7232] | Huh. Looks like it's marking the end of the block without actually removing elements, so that they're still accessible if really needed. >> A: [a b c d e] == [a b c d e] >> path A 3 >> ? A A is a block of value: [a b] >> A/2 == b >> A/3 >> A/4 == d >> mold A == "[a b]" >> back tail A == [e] >> back back tail A == [d e] >> back back back tail A == [] >> back back back back tail A == [b] I can see myself using this... And I think I'd actually had a problem a while back where it would have been helpful. |
CharlesS 19-Feb-2007 [7233x4] | Im iterating over a lines in a file , with this line in a foreach body |
if find tempLine "//Database " <> none [ print "Here" print line ] | |
but the print line is printing [ true; ] instead of the actual line ? | |
oh hmm, im splitting by lines with this -> lines: parse (read to-file rejoin [ moduleName ".php" ]) "^/" , but it seems to be splitting by spaces ? | |
Steeve 19-Feb-2007 [7237] | parse/all |
CharlesS 19-Feb-2007 [7238x2] | that works, but the find function doesnt seem to be working, the two lines it returns for matching //Database are var $new_schema = true; and case 'ACL': return true; --- |
those are the only two lines that have true in them | |
Steeve 19-Feb-2007 [7240x3] | use braquets |
if (find tempLine "//Database ") <> none [ print "Here" print line ] | |
and remove (<> none), it's useless | |
CharlesS 19-Feb-2007 [7243] | argh , cant wrap my head around these damn precendence rules |
Steeve 19-Feb-2007 [7244] | if find tempLine "//Database " [ print "Here" print line ] |
CharlesS 19-Feb-2007 [7245] | can you explain why the brackets work ? |
Steeve 19-Feb-2007 [7246x3] | because "//Database " <> none is first evaluated |
return always true | |
so, in realty , you do a find templine true | |
CharlesS 19-Feb-2007 [7249] | and why is that evaluated first, I thought things were left to right ? YOu know where in the manual i can re-read this ? |
Steeve 19-Feb-2007 [7250x4] | no |
all op! are evaluated first | |
i don't no for the manual | |
*know | |
CharlesS 19-Feb-2007 [7254] | thx for your help -- the manual desperately needs a search function |
Brock 20-Feb-2007 [7255x3] | CharlesS, if you changed the equation to; |
if none <> find tempLine "//Databases" [...] this would also work. | |
the find in this case would be evaluated first, prior to the op!. Unfortunately I don't know where I read this but I know i've seen lots of code where the equation portion of the condition is followed by the condition itself ie, if 2 = 5-3 [do this]. It's backwards to what you would expect, but follows with the right to left evaluation that occures. | |
Gabriele 20-Feb-2007 [7258] | PATH is just not supposed to be used :) it is there by mistake afaik. |
Rebolek 20-Feb-2007 [7259] | it's there so we've got something to fiddle with and don't ask about new releases too much ;) |
Gabriele 20-Feb-2007 [7260] | ;) |
Pekr 20-Feb-2007 [7261] | I wonder what is 2.7 good for, as R3 official release is at DevCon, and it is less than 3 months? ;-) |
Gabriele 20-Feb-2007 [7262] | i guess people won't start using r3 in production that soon. |
Rebolek 20-Feb-2007 [7263] | Pekr it's official preview and not release |
Pekr 20-Feb-2007 [7264] | how comes? Official alpha was supposed to be out 3/4 year ago :-) |
Rebolek 20-Feb-2007 [7265] | maybe R3 is little bit delayed because 3D Realms addopted it as a main programming language for Duke Nukem Forever? ;P |
Maxim 20-Feb-2007 [7266] | I think R3 is not really delayed... I think the plan has simply changed, and this time Carl is finally working at delivering what he promised at devcon 2004. He might have realised that its a little bit more work to make something so open... you can't hide the ugly things, so I'm pretty sure he is doing a lot of cleaning up... and we have been hearing about the fact that this time, view isnt' being left behind... |
Pekr 20-Feb-2007 [7267x2] | Rebolek :-))) |
Maxim - hopefully you are right! | |
Rebolek 20-Feb-2007 [7269] | I'm OK with R3 release date, but just couldn't resist to make that dukenukem joke :) |
Pekr 20-Feb-2007 [7270] | rebpro does not contain core stuff? so no decode-cgi for e.g.? |
Maxim 20-Feb-2007 [7271x2] | you mean rebol/view pro? |
or some sdk build? | |
Pekr 20-Feb-2007 [7273x2] | no, rebpro I placed on server .... as I needed library access, but this time it does not contain decode-cgi, uh, I will have to generate my own rebol.exe with features I want? |
I vote once again for pad function! | |
older newer | first last |