World: r3wp
[Core] Discuss core issues
older newer | first last |
Ladislav 9-Apr-2007 [7461] | yes, that is a good suggestion, putting it in |
Henrik 9-Apr-2007 [7462] | >> series? [] == true >> trim [] ** Script Error: Cannot use trim on block! value ** Near: trim [] >> ? trim USAGE: TRIM series /head /tail /auto /lines /all /with str ... Is this not kind of inconsistent? |
Ladislav 9-Apr-2007 [7463x3] | check http://www.fm.tul.cz/~ladislav/rebol/build.rplease to see whether the doc strings are better now |
>> help trim USAGE: TRIM series /head /tail /auto /lines /all /with str DESCRIPTION: Removes whitespace from a string. Default removes from head and tail. TRIM is an action value. | |
so the only "inconsistency" is the argument name, as I see it | |
Henrik 9-Apr-2007 [7466x2] | don't you get a list of arguments with accepted datatypes? |
ARGUMENTS: series -- (Type: series port) | |
Ladislav 9-Apr-2007 [7468] | ah, sorry, it does not check whether the argument is an ANY-STRING! or a PORT! , but instead it allows SERIES! |
Gregg 10-Apr-2007 [7469] | I've brought this up before as well, but it looks like it will be there for R3, according to the recent blog on it. |
Henrik 12-Apr-2007 [7470] | I noticed this: >> to-url [http b c] == http://b/c >> to-url [http b 125] ** Script Error: Invalid argument: 125 ** Where: to-url ** Near: to url! :value Couldn't it be useful to have 125 accepted as a port number since it's the first integer in the block? |
Maxim 12-Apr-2007 [7471] | why isn't 125 valid anyways? http://b/125 is a valid url AFAIK no? |
Henrik 12-Apr-2007 [7472] | yes it is. I half-expect Gabriele or Ladislav to come back with an answer like "no, because if we allowed that, the Internet would explode" or something :-) |
Sunanda 12-Apr-2007 [7473] | Yes it is - completely valid as a URL. |
Henrik 12-Apr-2007 [7474] | I came up with my own: >> to-url [http a 125] == http://a:125 or == http://a/125 so probably not a good idea to autmatically assume it's a port number. |
Izkata 12-Apr-2007 [7475] | (hopefully) quick question - I know you can use prin "^(page)" (or prin "^L") to clear the current terminal window - is there something just as simple to clear just the current line? Or move the cursor back to the beginning of the line? |
Sunanda 12-Apr-2007 [7476] | prin cr |
btiffin 12-Apr-2007 [7477] | Sunanda; You should have mentioned loading the Terminal User Interface and all the funky VT100 escape sequences and the... Just kidding :) |
Sunanda 12-Apr-2007 [7478] | I' not that evil .... not yet, anyway :-) |
Gabriele 12-Apr-2007 [7479x2] | Henrik: actually, I guess you're the first to discover that :) |
it's funny that it doesn't form integers though. maybe there's some reason for it. | |
Henrik 12-Apr-2007 [7481] | gabriele, it doesn't eat tuples either (IP addresses) |
Gabriele 12-Apr-2007 [7482] | i guess the implementation is somewhat unfinished. i wonder if it was done for some reason... |
Henrik 12-Apr-2007 [7483] | worth RAMBO'ing? |
Gabriele 12-Apr-2007 [7484] | i'm asking Carl (though he seem to be away this week) |
Henrik 12-Apr-2007 [7485] | stupid question: how do you form a readable error message from an error object, such as it appears in the console? |
Sunanda 12-Apr-2007 [7486] | Hope this is not a stupid answer...... xx: disarm try [0 / 0] probe xx check out xx, and see what bits you want to print......You'll need to translate the 400 into "math error" ...Not sure about that bit....Can you find anything in the system object for that? |
Henrik 12-Apr-2007 [7487x2] | hmm... I don't know. I thought there was a simple method to convert such an error object into a console style error. |
I get an error in Rugby: make object! [ code: 302 type: 'script id: 'no-arg arg1: none arg2: 'obj-a arg3: none near: [request-sync/action [] func [obj-a obj-b][ all [ obj-a obj-b insert probe obj-a/results probe obj-b/results unique/skip obj-a/results 3 obj-b/results: obj-a/results ] ]] where: 'safe-exec ] which I'm not sure how to read | |
Sunanda 12-Apr-2007 [7489] | Compare do with probe xx: disarm try [do] Both get you a 302/no-arg message. Just the console message is chattier. You can of course print out a terser form using the parts of the disarmed error object: print ["error: " xx/id "near" xx/where] Is that what you mean? |
Graham 12-Apr-2007 [7490] | doesn't it mean you didn't supply the argument obj-a ? |
Maxim 12-Apr-2007 [7491x2] | I Henrik is wonder if there is a call to transform the error object into the "official" error Message. AFAIK there is no such official stub... maybe someone knows this func? after 8 years I still have not come across this. |
my god... I must be tired.... that message should start with: "I Think Henrik is wondering if" | |
btiffin 12-Apr-2007 [7493] | Hi, I saw a pretty good error parser in Cyphre's rebsite vconsole.r script a long time ago... The code is copyright 2001 Cyphre but if you ask nice I'll bet he shares it, then again maybe not. So please ask. Check REBOL/Public/Sites/Cyphre/vconsole.r from the Viewtop. |
Anton 12-Apr-2007 [7494] | Henrik, I would use this function from Gabriele: http://anton.wildit.net.au/rebol/freezer/form-error.r |
Izkata 12-Apr-2007 [7495] | Sunanda - Thanks! |
Henrik 13-Apr-2007 [7496x2] | graham and maxim are both right. I don't know what the error message really means and was hoping to clear that up by translating it to a standard console message. |
trying form-error.r gives: none is missing its obj-a argument OK. :-) It would mean that the function I'm passing directly is missing an argument. I was confused by the none! part. | |
Rebolek 13-Apr-2007 [7498] | Can anybody explain to me, why this thorws 'false even if the page exists? thanks. >> exists? http://www.aving.co.kr/newproduct/default.asp?p1=newproduct&mode=read&table_id=English&num=79 connecting to: www.aving.co.kr == false |
Graham 13-Apr-2007 [7499] | >> exists? http://www.aving.co.kr/newproduct/default.asp?p1=newproduct&mode=read&table_id=English&num=79 URL Parse: none none www.aving.co.kr none newproduct/ default.asp?p1=newproduct&mode=read&table_id=English&num=79 Net-log: ["Opening" "tcp" "for" "HTTP"] connecting to: www.aving.co.kr Net-log: {HEAD /newproduct/default.asp?p1=newproduct&mode=read&table_id=English&num=79 HTTP/1.0 Accept: */* Connection: close User-Agent: REBOL View 1.3.2.3.1 Host: www.aving.co.kr } Net-log: "HTTP/1.1 500 Internal Server Error" == false >> |
Oldes 13-Apr-2007 [7500x2] | using trace/net - Net-log: "HTTP/1.1 500 Internal Server Error" that's what the page returns |
ech... too late | |
Graham 13-Apr-2007 [7502] | hehe |
Oldes 13-Apr-2007 [7503x3] | it returs 500 response even to my Firefox, but it's displayed anyway.. interesting. |
it's goog vay how to hide content from bots:) | |
(a good way) | |
Rebolek 13-Apr-2007 [7506] | so is there another way how to check if URL is valid? |
Graham 13-Apr-2007 [7507x2] | read it ? |
no .. don't know | |
Sunanda 13-Apr-2007 [7509] | You might be able to fiddle with the http scheme for this condition..... If you do this: zz: open http://www.aving.co.kr probe zz find mold zz "response-actions:" You'll see there is a tale of acceptable reponse codes. So (just an idea) patch that to include 500, and then check if the in-buffer field has any <html> content |
Oldes 13-Apr-2007 [7510] | but that doesn't mean it's valid... the content of the buffer after 500 response is usualy the message that there was an error on the server and that you can contact admins |
older newer | first last |