[REBOL] HTTP basic auth - object? Re:(2)
Hi Porter: I wrote: >get_vals: func [] [ > make block! reduce [ > to-lit-word! protocol > username > password > hostaddr > filepath > ] >] Should be: get_vals: func [] [ make block! reduce [ to-lit-word protocol username password hostaddr filepath ] ] or get_vals: func [] [ make block! reduce [ to lit-word! protocol username password hostaddr filepath ] ] i.e. with dash and no exclamation mark, or with exclamation and no dash. ;- Elan >> [: - )]
[REBOL] [ENHANCEMENT] help patch
Hi Rebols, I once again started a little patching within the system, this time its the help function. Now it'll work within nested objects. Examples: >> a: make object! [ [ b: make object! [ [ c: func ["This is a/b/c" /d][ [either d [print "c/d is started"] [ [print "c is started"]] [ e: func ["This is a/e"][print "huhu"] [ f: 3 [ g: make object! [ [ h: "kjhkjh" [ i: 10.3 [ ] [ ] [] >> help a Object with fields: b : object >> help a/b Valid subpath "a/b" is: Object with fields: c : func "This is a/b/c" e : func "This is a/e" f : integer g : object >> help a/b/c Valid subpath "a/b/c" is function: This is a/b/c Arguments: Refinements: /d >> help a/b/c/d Valid subpath "a/b/c" is function: This is a/b/c Arguments: Refinements: /d >> help a/b/f Valid subpath "a/b/f" (called obj) obj is word of value: 3 >> help a/b/x Valid subpath "a/b" is: Object with fields: c : func "This is a/b/c" e : func "This is a/e" f : integer g : object And here comes the patched help ... help: func [ "Prints information about words and values." 'word [any-type!] /local value args item refmode types ][ if unset? get/any 'word [ print trim/auto { ^^-^^-^^-^^-The help function provides a simple way to get ^^-^^-^^-^^-information about words and values. To use it ^^-^^-^^-^^-supply a word or value as its argument: ^^-^^-^^-^^- ^^-^^-^^-^^-^^-help insert ^^-^^-^^-^^-In addition to help, these other words provide ^^-^^-^^-^^-information about the REBOL language: ^^-^^-^^-^^- ^^-^^-^^-^^-^^-about - for general info ^^-^^-^^-^^-^^-usage - for the command line arguments ^^-^^-^^-^^-^^-license - for the terms of user license ^^-^^-^^-^^-^^-source func - print source for given function ^^-^^-^^-^^- ^^-^^-^^-^^-For more information, see the user guides. ^^-^^-^^-} exit ] ; \/ \/ \/ start changes by iho if path? :word [ use [obj parts i j] [ i: 2 parts: parse mold :word "/" if error? try [obj: get to-word first parts] [ print ["Path:" :word "not found"] exit ] while [all [object? :obj i <= length? parts] ] [ either not error? try [obj: get in obj to-word pick parts i] [ i: i + 1 ] [ break ] ] pth: first parts for j 2 i - 1 1 [ append pth rejoin ["/" pick parts j ] ] prin rejoin [{Valid subpath "} pth] either function? :obj [ print {" is function:^^/} help obj ][ either object? :obj [ print {" is:^^/} help obj ] [ print {" (called obj)^^/} help obj ] ] exit ] ] if object? get :word [ use [wrd hlp] [ print "Object with fields:" foreach wrd next first get word [ either function? get in get word wrd [ print [wrd ": func" either string? hlp: first third get in get word wrd [ mold first parse/all hlp "^^/"][""]] ] [ print [wrd ": " type? get in get word wrd] ] ] exit ] ] ; /\ /\ /\ end changes by iho if not word? :word [ print [mold word "is" type? word] exit ] if not value? word [ print ["No information on" word "(word has no value)"] exit ] value: get word if not any-function? :value [ print [mold word "is" type? word "of value:" value] exit ] args: third :value refmode: false either string? pick args 1 [ print first args args: next args ] [ print "(undocumented)" ] if block? pick args 1 [ print "Attributes:" item: first args args: next args while [not tail? item] [ value: first item item: next item if any-word? value [ prin [" " value "-- "] if string? pick item 1 [prin first item item: next item] print "" ] ] ] if tail? args [exit] print "Arguments:" while [not tail? args] [ item: first args args: next args if (mold item) = "/local" [break] if all [refinement? item not refmode] [ print "Refinements:" refmode: true ] either refinement? item [ prin [" " mold item] if string? pick args 1 [prin [" --" first args] args: next args] print "" ] [ if any-word? item [ if refmode [prin ""] prin [" " item "-- "] types: if block? pick args 1 [args: next args first back args] if string? pick args 1 [prin first args args: next args] if types [prin rejoin [" (" types ")"]] print "" ] ]
[REBOL] HTTP basic auth - object? Re:
Hi Porter, Andrew already set a few things straight. A few more comments: When you do the following: >>a: b: 1 then the set-word! value b: attaches itself to the digit 1, returns its value, which is consumed by the set-word! a:. Subsequently both words evaluate to 1. This can be used to cascade assignments, when you want to intialize a few words to some initial value. Second rule: REBOL doesn't care about newlines. Newlines do not delimit an expression. a: b: 1 is equivalent to a: b: 1 In your http-object >http_object: make object! [ > ; Attributes. > protocol: 'http > username: > password: > hostaddr: > filepath: > pagedata: username: password: ... pagedata: all wait for something to attach to ... and it finally arrives: > > ; Member Functions. > get_vals: func [] [ > make block! [ > protocol > username > password > hostaddr > filepath > ] > ] So, get_vals: is set to the function func [] ..., whereupon get_vals returns the function, which then becomes the object for pagedata's attachment and so on, until all the hungry set-word! values, such as username etc. have attached themselves to the same function. Now, you go ahead and change everything: >objPage: make http_object [ > username: "webuser" > password: "letmein" > hostaddr: "127.0.0.1" > filepath: "mysite/default.htm" >] in objPage username has now been set to "webuser" and so on. That does not affect what happens in get_vals, because when you say: >> a: 1 b: 2 c: 3 == 3 >> make block! [a b c] == [a b c] make block! returns the words a, b, c in a block, they have not been dereferenced. You can now say: >> block: make block! [a b c] == [a b c] >> get first block == 1 >> get second block == 2 >> get third block == 3 and the function get demonstrates that a through c were bound, but not unbound or deferenced, when the block was made. We can however say: >> block: make block! reduce [a b c] == [1 2 3] or we can say >> reduce block: make block! [a b c] == [1 2 3] to create a block containing the values in place of the words. Accordingly you could write get_vals like this: get_vals: func [] [ make block! reduce [ protocol username password hostaddr filepath ] ] and now when you say: >> objPage/get_vals == [http "webuser" "letmein" "127.0.0.1" "mysite/default.htm"] you get something that is closer to your desired result. However, beware of the first entry, http, this should be 'http. What's going on here? In get_vals we reduce the block and the lit-word! 'http becomes reduced to a word as well. That's a problem, which we can solve by saying get_vals: func [] [ make block! reduce [ to-lit-word! protocol username password hostaddr filepath ] ] Now the result of the reduction is a value of type lit-word!: >> objPage/get_vals == ['http "webuser" "letmein" "127.0.0.1" "mysite/default.htm"] note the 'http or, if you prefer: > >print objPage/get_vals >> print objPage/get_vals http webuser letmein 127.0.0.1 mysite/default.htm Thought you may find these comments useful. ;- Elan >> [: - )]
[REBOL] HTTP basic auth - object? Re:
Hi, Porter. You wrote: > http_object: make object! [ Need a better name. How about Http_Scheme? > ; Attributes. > protocol: 'http Ok, so far, but: > username: > password: > hostaddr: > filepath: > pagedata: is a problem. These words are all set to 'get_vals. I'm sure you didn't mean that. What you really need is storage for each and idea of their usual type. > ; Member Functions. > get_vals: func [] [ > make block! [ > protocol > username > password > hostaddr > filepath > ] > ] 'get_vals doesn't do what you intend. Here's something just a little bit better: [ REBOL [] Scheme!: make object! [ scheme: word! user: string! pass: string! host: [tuple! url!] path: file! Block: function [Full_FileName][Block][ path: Full_FileName Block: make block! 10 append block to set-word! 'scheme append block to lit-word! scheme append block to set-word! 'user append block user append block to set-word! 'pass append block pass append block to set-word! 'host append block to string! host append block to set-word! 'path append block to string! path Block ] ] Scheme: Scheme! Scheme/scheme: 'http Scheme/user: "webuser" Scheme/pass: "letmein" Scheme/host: 127.0.0.1 Scheme/path: %mysite/default.htm Scheme/Block "mysite/default.htm" ] >> do %scheme.r Script: "Untitled" (none) == [scheme: 'http user: "webuser" pass: "letmein" host: "127.0.0.1" path: "mysite/default.htm"] I'm sure you'll be able to do the rest. :-) I hope that helps! Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Patches to REBOL 2.2.0 Re:(5)
Ladislav, (the one who is recovering from the fact that Append was faulty :-o) wrote: > Hi, after the recent discussion, isn't better to use the modified Append? > > ; A replacement Append function > Refined_Insert tail :series :value > series > ] That approach evaluates 'series, which is not desirable, if we're manipulating words/paths that are defined as functions. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Search Engine for Rebol Docs Re:
The "DO" and "GET" words have been added to the search engine. http://24.217.20.110/rebolsearch/rebol.htm enjoy! - Original Message - From: Dan Stevens To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Wednesday, January 26, 2000 10:49 AM Subject: Re: [REBOL] Search Engine for Rebol Docs Hey Paul, Really cool...a couple of us have tried it out and it's a great addition for the community. Some comments...First, I'm running Windows NT...some terms like "do" and "get" result in errors (possibly because they turn up to many results?). Also, when clicking on the tips, I get an error message, which then locks up my browser (Netscape 4.7). Even after killing my browser and re-opening, it is still locked up. I have to manually go into the task manager and kill a remaining open netscape.exe in order to run my browser again. I believe this problem is due to use of cascading style sheets, but I'm no expert (not even an amateur), so I'll let you track it down. FWIW, we duplicated the same problems on other machines in the office.Regards,Danp.s. you can share this message and a reply with the list if you think there would be added value. I figured I'd leave it to your discretion in case these comments are useless. At 08:45 AM 1/26/00 -0600, you wrote: Check out my search engine at http://24.217.20.110/rebolsearch/rebol.htm
[REBOL] odbc
Hi all, Can any one say when ODBC support will be available in Rebol ? as I understand it won't be available in the 'free' version, however I am interested to try it out when it is supported. Thanks Andrew --Andrew StopfordMacromedia Evangelisthttp://www.kimmuli.com
[REBOL] [REBOL] Updating a file as a port Re:(3)
Hi Jim, >Hi Elan, > >Gee, you really just need to open the file with /lines. The default is read >and write. ;-) > you may want to hint at that in the info returned by help open ;-) >> help open Opens a new port connection. Arguments: spec -- (file url port object block) Refinements: /binary -- Preserves contents exactly. /string -- Translates all line terminators. /direct -- Opens the port without buffering. /new -- Creates a file. (Need not already exist.) /read -- Read only. Disables write operations. /write -- Write only. Disables read operations. /wait -- Waits for data. /lines -- Handles data as lines. /with -- Specifies alternate line termination. end-of-line -- (char string) /allow -- Specifies the protection attributes when created. access -- (block) /mode -- Block of above refinements. args -- (block) /custom -- Allows special refinements. params -- (block) ;- Elan >> [: - )]
[REBOL] [REBOL] Updating a file as a port Re:(3)
Hi Jim, oops, guess I haven't quite outgrown C myself. At 03:32 PM 1/26/00 -0800, you wrote: >At 02:17 PM 1/26/00 -0800, you wrote: >>The /write refinement disables read operations! >> >> >>Solution: >> >>Use the /mode refinement with a block [lines read write] like this: > >Hi Elan, > >Gee, you really just need to open the file with /lines. The default is read >and write. ;-) > > - jim > > > > ;- Elan >> [: - )]
[REBOL] Search Engine for Rebol Docs Re:
Dan, Very good research. My site does use Cascading Style sheets which I didnt know resulted in the "lock up" problem. I will see what I can do to maybe change that. Also, the do and get messages are filtered via a "noise" file (attached). Since the search engine does free text querys it may return alot of garbage if I were to allow those queries. I am hoping to find a solution for the problem as it will also give an error if you try to search for some of the symbol characters such as "?". Obviously, that poses problems that are not easily resolved. I appreciate the input and will try to investigate what I can to make it better. - Original Message - From: Dan Stevens To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Wednesday, January 26, 2000 10:49 AM Subject: Re: [REBOL] Search Engine for Rebol Docs Hey Paul, Really cool...a couple of us have tried it out and it's a great addition for the community. Some comments...First, I'm running Windows NT...some terms like "do" and "get" result in errors (possibly because they turn up to many results?). Also, when clicking on the tips, I get an error message, which then locks up my browser (Netscape 4.7). Even after killing my browser and re-opening, it is still locked up. I have to manually go into the task manager and kill a remaining open netscape.exe in order to run my browser again. I believe this problem is due to use of cascading style sheets, but I'm no expert (not even an amateur), so I'll let you track it down. FWIW, we duplicated the same problems on other machines in the office.Regards,Danp.s. you can share this message and a reply with the list if you think there would be added value. I figured I'd leave it to your discretion in case these comments are useless. At 08:45 AM 1/26/00 -0600, you wrote: Check out my search engine at http://24.217.20.110/rebolsearch/rebol.htm noise.dat
[REBOL] [REBOL] Updating a file as a port Re:(2)
At 02:17 PM 1/26/00 -0800, you wrote: >The /write refinement disables read operations! > > >Solution: > >Use the /mode refinement with a block [lines read write] like this: Hi Elan, Gee, you really just need to open the file with /lines. The default is read and write. ;-) - jim
[REBOL] [REBOL] Updating a file as a port Re:
Hi Tim, 1. Your code causes an error, before it completes executing: >> fp: open/lines/write %test.txt >> forall fp ** Script Error: forall expected body argument of type: block. ** Where: forall fp 2. help open states that: >> help open Opens a new port connection. Arguments: spec -- (file url port object block) Refinements: /write -- Write only. Disables read operations. The /write refinement disables read operations! Solution: Use the /mode refinement with a block [lines read write] like this: >> print read %test.txt line one line two line three line five >> fp: open/mode %test.txt [lines read write] forall fp [ if found? find first fp "three" [ insert next fp "line four" ] ] == false >> update fp >> close fp >> print read %test.txt line one line two line three line four line five ;- Elan >> [: - )]
[REBOL] [REBOL] Updating a file as a port
Hello All: test file is test.txt contents are: line one line two line three line five ;The following code seeks to identify the third line and ;inset a line after it: fp: open/lines/write %test.txt forall fp [ if(find first fp "three") ; identify third line [ print first fp ; tell user it's been found insert fp "line four" ; insert? ] ] update fp ; "post" close fp ;;Two questions: ;; 1)the inserted line ist not being inserted. Why and How? ;; 2)What code can I insert so that rebol will not prompt ;; for permission. Thanks Tim
[REBOL] Re: Append Patch
It was asked: > I was having a look at your patched version of append. Could you explain to me the problem that the original version has?. I've tried numerous tests with both and have seen no difference in the behaviour. > Could you give me an example to help me understand? >> Refined_Find: to path! 'find == find >> head insert tail :Refined_Find 'match == find/match >> append :Refined_Find 'any ** Script Error: find expected series argument of type: series port bitset. ** Where: insert tail series :value >> :Refined_Find == find/match >> Andrew's_Append :Refined_Find 'any == find/match/any >> found? Refined_Find "abcde" "??c*" == true >> found? Refined_Find "abcde" "???z" == false >> first :Refined_Find == find >> second :Refined_Find == match >> third :Refined_Find == any >> pick :Refined_Find 2 == match The key part is in 'Andrew's_Append here: head Refined_Insert tail :series :value and here in REBOL's 'append: insert tail series :value Note that REBOL's append evaluates 'series, where mine doesn't. I hope that helps! Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Weird Re:
Ladislav wrote: > did anybody try the following: > > f: func [x] [get first first :f] > f 1 > > WARNING, any damages at your own risk! I tried it and got the damages! :-) I got this: REBOL caused an invalid page fault in module REBOL.EXE at 015f:0040ab5c. Registers: EAX=02cb CS=015f EIP=0040ab5c EFLGS=00010256 EBX=0068c534 SS=0167 ESP=0065fba4 EBP=0065fbe0 ECX=0005 DS=0167 ESI= FS=20e7 EDX= ES=0167 EDI=0071ac08 GS= Bytes at CS:EIP: 8b 40 0c 03 70 08 8b 43 0c 8b 40 08 80 78 10 19 Stack dump: 006720e4 0071f89c 0068c534 00403d27 0068c534 0065fc50 0065fc50 00686b88 00686b88 006b9a34 0071f89c 0071ac18 006720e4 0071abe8 0065fc2c I'm putting it through to [EMAIL PROTECTED] >> rebol/version == 2.2.0.3.1 Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] proxy-authorization
Greetings, I'm try to get rebol 2.2.0.3.1 to connect to a firewall proxy using basic authentication. I have the following settings: system/schemes/default/proxy host127.0.0.1;; Set to my proxy server port-id 81 ;; Set to 81 user"user" pass"password" typegeneric with identical settings under: system/schemes/http/proxy I am unable to get rebol to use the Proxy-Connection: or Proxy-Authoriztion: headers. I have setup the Proxy Server script by Sterling Newton and was able to connect through the proxy with MSIE. Here is a clip the debug code when it works: NEW CONNECTION = === connecting to: www.rebol.com {GET http://www.rebol.com/dictionary.html HTTP/1.0^M Accept: */*^M Accept-Language: en-us^M Accept-Encoding: gzip, deflate^M If-Modified-Since: Fri, 29 Oct 1999 00:38:15 GMT^M If-None-Match: "8db891-5bdd9-3818ec77"^M User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Window s 95; DigExt)^M Host: www.rebol.com^M Proxy-Connection: Keep-Alive^M Pragma: no-cache^M Proxy-Authorization: Basic xx=^M ^M } closing ports... 1 open When I type modified? http://user:[EMAIL PROTECTED] from another instance of rebol I get: connecting to: www.rebol.com ** User Error: Error. Target url: http://www.rebol.com/ could not be retrie ved. Server response: HTTP/1.0 407 Proxy Authentication Required. ** Where: modified? http://user:[EMAIL PROTECTED] : notice the missing Proxy-Connection: Keep-Alive^M Pragma: no-cache^M Proxy-Authorization: Basic xx=^M ^M The rebol proxy reports the following NEW CONNECTION = === connecting to: agfaweb {GET http://www.rebol.com/ HTTP/1.0^M Accept: */*^M User-Agent: REBOL 2.2.0.3.1^M Host: www.rebol.com^M ^M ^M } closing ports... 1 open THANKS for the help JH
[REBOL] Weird Re:
I tried it, and REBOL instantly crashed. What we old timers used to call "General Protection Faults" but seem to be referred to now as "error in page number ..." Actually, that could be a useful function! Hey, I may need REBOL to suddenly produce a page fault and crash, and now I have a handy function that does just that ... cool. You wouldn't have anything that can blow a monitor, do you? <8^) --- [EMAIL PROTECTED] wrote: > Hi, > > did anybody try the following: > > f: func [x] [get first first :f] > f 1 > > WARNING, any damages at your own risk! > > Ladislav > > = Steve ~runester~ Jarjoura "According to my calculations, that problem doesn't exist." __ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com
[REBOL] Polymorphic Re:(4)
Oops! Some errors during copying. The attachment needs a Title: "Polymorphic" and the registration of [Integer! Complex!] signature is: register 'minus [integer! complex!] [] [ make complex [ re: a - b/re im: b/im ] ] Ladislav
[REBOL] Polymorphic Re:(3)
#5 Polymorphic operators, only prefix notation supported :-( Let us look at the following: ; currently alpha stage, trying to improve it, it is attached do %polymorphic.r complex: make object! [ type: 'complex! re: im: 0 ] polymorphic [minus a b] register 'minus [complex! complex!] [] [ make complex [re: a/re - b/re im: a/im - b/im] ] mold minus make complex [re: 1 im: 0] make complex [re: 0.5 im: 0.5] == { make object! [ type: complex! re: 0.5 im: -0.5 ]} mold minus 1 make complex [re: im: 0,5] Polymorphic error, signature not found! register 'minus [integer! complex!] [] [ make complex [ re: a/re - b/re im: a/im - b/im ] ] mold minus 1 make complex [re: im: 0,5] == { make object! [ type: complex! re: 0.5 im: -0.5 ]} What do you think? polymorphic.r
[REBOL] REBOL crashes randomly with HTTP authentication Re:
On Wed, 26 Jan 2000, you wrote: > Hi, > > following discussions about username and passwords, I made some > experiments with REBOL 2.2.0.3.1, Windows NT and IIS 4. > > It appears that REBOL crashes randomly when length of username and > password (i.e. length? rejoin [username password]) is smaller than 11 > characters, no matter if the password is valid or not. > > Valid usernames and passwords for my test system are: > webuser,login ; longer than 10 characters > webuse2,log; 10 characters > > Here are the results, I use loop because the crashes are somewhat > random. Thanks, we will investigate this. -- Holger Kruse [EMAIL PROTECTED]
[REBOL] Updated my BEGINNERS GUIDE TO REBOL page
and changed the name to http://home.pacifier.com/~mcginty/rebol_cuddle.html by popular request. Still a work in progress. Thanks to those who wrote with advice. [EMAIL PROTECTED] for FREE ! http://www.CannabisMail.com Wanna advertise here ? http://www.CannabisMail.com/sponsor.htm
[REBOL] Re: Datatype hierarchy Re:
Hello [EMAIL PROTECTED]! On 26-Gen-00, you wrote: K> Is this it? I think so. Thanks! Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] Weird
Hi, did anybody try the following: f: func [x] [get first first :f] f 1 WARNING, any damages at your own risk! Ladislav
[REBOL] http:password\? Re:(4)
[EMAIL PROTECTED] wrote: > Holger Kruse > [EMAIL PROTECTED] Salutations Holger! Certainly think Rebol was thinking ahead when they hired the person with the best dial up networking program with the best features in the world,,, IMHO... While this thread has some off-topic character of the old spanish friends (amigans), does anyone know the whereabouts or contact info for Joe Torre? I would be pleased to get it. Maybe he is back in Atlanta? I can be emailed privately on this, but its a public begging on my part... Thanks, Steve Shireman
[REBOL] no Palm support Re:
At 08:51 AM 1/26/00 Francois wrote: >I just looked at the download page to see if there was any further >progress with the Psion implementation, somthing I have been waiting for, >for a long time now :) However I noticed that a Palm entry has been >removed? > >How is the Psion version comming along anyhow.. > >Francois Hey Francois, We're on hold with the Psion port while we work on View and then various Command/Server type modules. The Palm entry was removed as it will be quite some time before we can attempt a port to Palm (given only 36k, best case, of dynamic memory). The Psion platform is also limited in dynamic memory, but not near as much. UI issues are a bigger hurdle that will be further tackled in the future. If you have special insights into Psion development, email [EMAIL PROTECTED] and he'll explore your suggestions when his time frees up. Regards, dan
[REBOL] Search Engine for Rebol Docs Re:(2)
No the Meta tags would not matter in this case because I use Microsoft Index Server which does the indexing based on the wording and not Meta tag content. I believe it works very well. Thanks for the your support on this. It took some work to make it but it was fun. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 26, 2000 9:05 AM Subject: [REBOL] Search Engine for Rebol Docs Re: Very nice. Be sure to add it to the REBOL links on REBOL.ORG Say, if the REBOL docs included a META description, would that show as the abstract instead? *** REPLY SEPARATOR ***On 1/26/2000 at 8:45 AM [EMAIL PROTECTED] wrote: Check out my search engine at http://24.217.20.110/rebolsearch/rebol.htm
[REBOL] Search Engine for Rebol Docs Re:(3)
On 1/26/2000 at 8:12 AM [EMAIL PROTECTED] wrote: { I think that rebol would quickly become as popular as javascript if the average person could understand the user.html. } Jack Sealy just started a list for REBOL newbies, and posted the first part of a "square-one" tutorial. You might want to drop by and give him some encouragement or feedback. http://onelist.com/community/Rebol_New -Ted.
[REBOL] Search Engine for Rebol Docs Re:(2)
Hi Paul, your site looks great. I've been hoping for someone to make a simple tutorial for the rebol language. I've been studying it for sometime and just recently figured out how to send email with base64 attachments. I had to write my own because, I still don't completely understand the attach.r script. I, originally, had to save images in base64 from another program and then create a custom header and stuff. I finally learned that once you enbase a binary file, you just have to put the newline in every 70th. I think that rebol would quickly become as popular as javascript if the average person could understand the user.html. It seems to be written for college graduates. But, most people are'nt that well educated. ..timmy
[REBOL] Search Engine for Rebol Docs Re:
VERY NICE, PAUL! I for one find it exceptionally useful. Thanks! --Ralph Roberts -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: Wednesday, January 26, 2000 9:45 AMTo: [EMAIL PROTECTED]Subject: [REBOL] Search Engine for Rebol Docs Check out my search engine at http://24.217.20.110/rebolsearch/rebol.htm
[REBOL] HTTP basic auth - object?
OK - after all the progress made yesterday, being able to successfully read HTTP Basic Auth pages, I'm still not satisfied. I thought it might be nice to put together an 'object' to help manage this process. While I am able to do the following: files ["mysite/default.htm" "mysite/page2.htm"] foreach file files [ print read [ scheme: 'http user: "webuser" pass: "letmein" host: "127.0.0.1" path: file ] ] I thought it was kind of tedious to have to retype the whole read bracket every time. So I figured I would make an object - and store the "state" of the page I was interested in reading - and then use a readpage function against the object to retrieve the page. objSecurePage.r - REBOL [ Title: "Password Page Object" Date: 26-Jan-2000 Purpose: "A script to fetch web page(s) that use basic authentication" File: %objSecurePage.r Notes: { A Rebol Object to facilitate the reading of secure page contents. A secure page in this sense, is one which is protected by basic authentication. It can also be used to retrieve any page from a web server. } ] http_object: make object! [ ; Attributes. protocol: 'http username: password: hostaddr: filepath: pagedata: ; Member Functions. get_vals: func [] [ make block! [ protocol username password hostaddr filepath ] ] readpage: func [] [ pagedata: read [ scheme: protocol user: username pass: password host: hostaddr path: filepath ] ] ] objPage: make http_object [ username: "webuser" password: "letmein" hostaddr: "127.0.0.1" filepath: "mysite/default.htm" ] print objPage/get_vals objPage/readpage ;print objPage/pagedata - So - I create a base object - which has no values other than the fact that it's using the http protocol (scheme). It has two functions - one which returns the block of values, the other reads the page - and sets the member variable (attribute) to the contents of the page. However - upon execution I get the following error: - >> do %objSecurePage.r Script: "Password Page Object" (25-Jan-2000) http webuser letmein 127.0.0.1 mysite/default.htm ** Access Error: Invalid port spec: scheme protocol user username pass password host hostaddr path filepath. ** Where: pagedata: read [ scheme: protocol user: username pass: password host: hostaddr path: filepath ] >> - Why are the attributes of the object not evaluating? It seems to be attempting to use the literal word. I have tried using the following code in place of the read page routine - - readpage: func [] [ pagedata: read [ scheme: self/protocol user: self/username pass: self/password host: self/hostaddr path: self/filepath ] ] - But that results in an exception and the Rebol application crashes on my NT system. What am I not understanding about referencing member variables within an object? Thanks, Porter Woodward
[REBOL] Polymorphic Re:
Hi Ladislav, I did some investigation of the datatype test functions, such as NUMBER? and BLOCK? I found they always return a logic value, no matter what type of argument they have - even if it's UNSET! or ERROR! I put together a number of functions testing for what you called "predicate types". Here's an example from huh.r . This merely excludes the most numerous datatypes, so HUH can print out the names of all the blocks, strings, numbers etc, so that you can check whether some function is leaking into the global context (due to spelling error or whatever). data?: func [ {returns TRUE for all data types except unset, any-function and datatype} value [any-type!] ][ all [ value? 'value not any-function? :value not datatype? :value ] ] (Actually this is a streamlined version inspired by your post.) In these functions you have to use [any-type!] in the header so that the function will accept any value at all. Then it's important to check whether the argument has a value. Otherwise, if the argument is unset anything else you try to do with it will cause an error. Then it's a good idea to use the get-word form of the argument until you're sure it's not an ANY-FUNCTION! PAREN! SET-WORD! PATH! SET-PATH! - all these will produce errors too. Then finally, if you want to look at the argument with anything except another datatype test function, you have to be sure it's not an ERROR! Your NONZERO? could be done this way: nonzero?: func [ {returns TRUE if not zero, but belongs to a type that has zeros} value [any-type!] ][ all [ value? 'value any [; all the types that have zero values number? :value char? :value money? :value time? :value tuple? :value ] not zero? value ] ] I put it into a standard format, so that it will return true with the following function: type-tester?: func [ {Returns TRUE if VALUE is a datatype test function} value [any-type!] ][ all [ value? 'value any-function? :value find/only third :value reduce [any-type!] not find third :value lit-word! string? first third :value found? find first third :value "Returns TRUE" ] ] >> huh * type-tester? @@ action! action?any-block? any-function? any-string?any-type? any-word? binary?bitset?block? char? datatype? date? decimal? email? error? file? function? get-word? hash? integer? issue? list? lit-path? lit-word? logic? money? native?none? number?object? op?paren? path? port? refinement? series?set-path? set-word? string?tag? time? tuple? unset? url? word? @@ function! data? nonzero? not? type-tester? Catch you later, Eric You wrote: 3) Predicate Types vs. Pseudotypes Pseudotypes are something added for the sake of conciseness, I think.They can be simulated through Predicate Types as follows: num?: func [x [any-type!]] [ any [integer? x decimal? x] ] Predicate types are normally weak, as can be seen here from 1), but you can have predicate types like: nonzero?: func [x [any-type!]] [ all [number? x not zero? x] ] , which may be of some use. So, to finish this part: the Rebol typesystem is strong, the organic approach should take that into account together with the stress on the internal representation. Bye 4 now
[REBOL] Search Engine for Rebol Docs Re:
Very nice. Be sure to add it to the REBOL links on REBOL.ORG Say, if the REBOL docs included a META description, would that show as the abstract instead? *** REPLY SEPARATOR ***On 1/26/2000 at 8:45 AM [EMAIL PROTECTED] wrote: Check out my search engine at http://24.217.20.110/rebolsearch/rebol.htm
[REBOL] Search Engine for Rebol Docs
Check out my search engine at http://24.217.20.110/rebolsearch/rebol.htm
[REBOL] Polymorphic Re:
Hi Ladislav, Except - doesn't work the same as SUBTRACT unless it's used as an infix: >> bop - [3 2 1] [1 1 1] == [-3 -2 -1] I thought of providing special processing to switch SUBTRACT for - , but thought it would be more fun to use the operators as infixes. Catch you later, Eric You wrote: Nice try, but it is only a more complicated version of: bop: func [ {returns the results of operating on elements of b with those of bb - last element of bb will be reused if necessary} 'op [word!] "name of function to use" b [block!] bb /local r ][ op: get in system/words op r: copy [] if not block? bb [bb: reduce [bb]] while [not tail? b] [ append r op first b first bb b: next b if 1 < length? bb [bb: next bb] ] r ] >> bop / [4 2] 2 == [2 1] , which is a pure prefix matter ;-)
[REBOL] Patches to REBOL 2.2.0 Re:(4)
Hi, after the recent discussion, isn't better to use the modified Append? ; A replacement Append function ; uses a refined path for Insert and returns the series append: function [ {Appends a value to the tail of a series and returns the series.} series [series! port!] value /only {Appends a block value into a block series as a block} ][ Refined_Insert ][ Refined_Insert: to path! 'insert if only [head insert tail :Refined_Insert 'only] Refined_Insert tail :series :value series ] Ladislav AKA He, who is recovering from the fact that Append was faulty :-o Here's an upgraded %Patch.r. It incorporates all previous modifications, > plus it updates 'append (I'll bet you didn't think that was faulty, did you? > (-:), replaces 'for with Ladislav's corrected 'for, and fixes all the > 'to-[type] functions (Thanks, Eric!). It also makes its patch functions > disappear after they've been used. > > Andrew Martin > Off to the land of Nod... > ICQ: 26227169 > http://members.xoom.com/AndrewMartin/ > -><- > > >
[REBOL] REBOL crashes randomly with HTTP authentication Re:
Michal's investigation is consistent with the crashes I reported yesterday. In my testing, the userID and password were both 5 characters long, just failing to reach the safe combined length of 11 that Michal observed. What persistence! Thanks, Michal! -jn- [EMAIL PROTECTED] wrote: > > It appears that REBOL crashes randomly when length of username and > password (i.e. length? rejoin [username password]) is smaller than 11 > characters, no matter if the password is valid or not. >
[REBOL] Polymorphic Re:(2)
#3 Forward Polymorphic vs. Backward Polymorphic Well, the Solve code was meant only as an example of a more or less working approach. There is a use for something "more polymorphic" and "less polluting", IMHO. Glad to see the interesting discussion. About the C++ - like approach, where the operators are a part of the class definition: I think, it is not the best possible: 1) The basic types of the language (even in C++) are handled differently - if you want to find out everything about Integer!, you should look at the descriptions of the Core functions handling Integer! values. 2) The C++ approach is "backward polymorphic" in a sense, as opposed to "forward polymorphic" (the difference can be described as a difference between the first Solve wording and the second one). If I forget to define the division for the complex numbers, then there is no other way, than to rewrite the definition of Complex!, if it must contain all operators handling Complex! values. Are you sure, that you can tell all the operators needed for the complex values not only now, but in the future? #4 Types As you could have seen, when I tried the polymorphic approach, I had to adjust the type system accordingly (cf. Complex?). Was it Rebol-like? I think not. The difference is as follows: 1) Weak Type Checking vs. Strong Type Checking complex? make object! quaternion! [ re: im: jm: km: 0 ] the result is true, which may sometimes be not exactly the right thing. From that point of view I would call Complex? Weak Type Checking as opposed to Strong Type Checking used in Rebol. 2) Type vs. Internal representation: >> same? 1 1.0 == true >> type? 1 == integer! >> type? 1.0 == decimal! >> for i 1 10.0 1 [print i] ** Script Error: for expected end argument of type: integer. ** Where: for i 1 10 1 , so Rebol even for the same values distinguishes between their internal representation - Rebol natural types (not pseudotypes) are the names for the internal representation, not for the set of all possible values, otherwise could be Decimal? 1 True and the Integer! datatype could have been a subtype of the Decimal! datatype. 3) Predicate Types vs. Pseudotypes Pseudotypes are something added for the sake of conciseness, I think.They can be simulated through Predicate Types as follows: num?: func [x [any-type!]] [ any [integer? x decimal? x] ] Predicate types are normally weak, as can be seen here from 1), but you can have predicate types like: nonzero?: func [x [any-type!]] [ all [number? x not zero? x] ] , which may be of some use. So, to finish this part: the Rebol typesystem is strong, the organic approach should take that into account together with the stress on the internal representation. Bye 4 now
[REBOL] Find Words and multiple refinements passing
I wrote: > ...made a shorter and quicker version, which I call 'Find_Word. More later. Actually, I've decided to change the name to 'Find_Words. It's attached as well. It's loosely based on Eric's Huh.r. Of particular note is the way I've discovered on how to easily pass multiple refinements through to a function. Find_Words: function [Value [string!] /Match /Any /Last][Refined_Find Words Found][ Refined_Find: to path! 'find if Match [append :Refined_Find 'Match] if Any [append :Refined_Find 'Any] if Last [append :Refined_Find 'Last] Words: first system/words sort Words Found: make block! length? Words foreach Word Words [ if found? Refined_Find to string! Word Value [ append Found Word ] ] Found ] >> find_words/match/any "to-*" == [to-binary to-bitset to-block to-char to-date to-decimal to-email to-file to-get-word to-hash to-hex to-idate to-integer to -issu... Andrew Martin Sleep REBOL-ing... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><- Find Words.r
[REBOL] Patches to REBOL 2.2.0 Re:(3)
Here's an upgraded %Patch.r. It incorporates all previous modifications, plus it updates 'append (I'll bet you didn't think that was faulty, did you? (-:), replaces 'for with Ladislav's corrected 'for, and fixes all the 'to-[type] functions (Thanks, Eric!). It also makes its patch functions disappear after they've been used. Andrew Martin Off to the land of Nod... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><- Patch.r
[REBOL] Mailing List Manager Script
I need to add mailing list management to a Web site. While there are many Some-Other-Language scripts out there, I'd rather REBOL. Right now, the main requirements are announce-only and multiple lists with maybe one shared POP account. Of course later someone will want a moderated or discussion list as well, but announce-only has to be up next week. Haven't found anything on REBOL.COM or REBOL.ORG that won't require some work, and just thought I'd ask around before I got started. -Ted.
[REBOL] REBOL crashes randomly with HTTP authentication
Hi, following discussions about username and passwords, I made some experiments with REBOL 2.2.0.3.1, Windows NT and IIS 4. It appears that REBOL crashes randomly when length of username and password (i.e. length? rejoin [username password]) is smaller than 11 characters, no matter if the password is valid or not. Valid usernames and passwords for my test system are: webuser,login ; longer than 10 characters webuse2,log; 10 characters Here are the results, I use loop because the crashes are somewhat random. >> loop 10 [ error? try [ a: read [ scheme: 'http user: "webuser" pass: "login" host: >"localhost" path: "/" ] ] ] connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost == false No crash here. >> loop 10 [ error? try [ a: read [ scheme: 'http user: "webuser" pass: "logi" host: >"localhost" path: "/" ] ] ] connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost == true The user cannot read the page with invalid password, REBOL does not crash. >> loop 10 [ error? try [ a: read [ scheme: 'http user: "webuser" pass: "log" host: >"localhost" path: "/" ] ] ] connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost connecting to: localhost The user cannot read the page with invalid password, REBOL sometimes crashes and sometimes waits infinitely. >> loop 10 [ error? try [ a: read [ scheme: 'http user: "webuse2" pass: "log" host: >"localhost" path: "/" ] ] ] connecting to: localhost connecting to: localhost connecting to: localhost The user can read the page with valid password, but REBOL crashes. -- Michal Kracik
[REBOL] Re: HTTP username/password Re:(2)
Hello [EMAIL PROTECTED]! On 25-Gen-00, you wrote: w> Net-log: {GET /mysite/ HTTP/1.0 w> Accept: */* w> User-Agent: REBOL 2.2.0.3.1 w> Host: 127.0.0.1 w> Authorization: Basic d2VidXNlcjpsZXRtZWlu This is the right header. Look: >> to-string debase "d2VidXNlcjpsZXRtZWlu" == "webuser:letmein" w> So - I'd say the server is responding appropriately - but that w> REBOL isn't reacting to it correctly, and not handing it the w> username and password... It's more likely to be the opposite. REBOL is providing the correct information, but the server is still denying access (notice that the server's answer is "Access Denied", not "Authorization Required"; this means that the server got the username and the password but considered them to be invalid). Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] Re: Polymorphic
Hello [EMAIL PROTECTED]! On 25-Gen-00, you wrote: l> _subtract: :subtract l> subtract: func [ l>{Returns the second value subtracted from the first.} l>value1 [any-type!] l>value2 [any-type!] l> ] [ l>either all [complex? value1 complex? value2] [ l>make complex! [ l>re: value1/re - value2/re l>im: value1/im - value2/im l>] l>] [ l>_subtract value1 value2 l>] l> ] If the GC wasn't buggy, I'd suggest: use [orig-subtract] [ orig-subtract: :subtract subtract: func [ ... ] ] This way you don't pollute the global context and, more importantly, can extend this function many times. Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] When? Re:(2)
Hi Jim, Thanks for the progress report. (If QA get too tough remind them it is a beta!) Cheers Allen K - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 26, 2000 3:22 PM Subject: [REBOL] When? Re: > Hi Allen, > > Well, we're down to the last few bits ( Carl keeps asking us for things, > but he seems to be slowing down (-; ), the scribes are scribbling away > with their quill pens documenting all the features we keep adding, and of > course, the nasty boys ( QA ) need to finish their go at it as well before > we unleash it upon the world. It's not a real answer, but the best I can > do. The bottom line is that when Carl and Tom say it's ready, then it will > go... > > - jim > > > At 03:06 PM 1/26/00 +1000, you wrote: > > >I know I'm an impatient sod, (I always want to open my Christmas presents on > >Christmas eve) > >But, what is the current ETA for Rebol/view now? > > > >Cheers, > > > >Allen K > > > >um can I eat my easter eggs now too? ; ) > > >
[REBOL] Polymorphic Re:(2)
Actually, I'd like to have C++ overloaded functions in REBOL. Then adding complex numbers and integers in any combination become a snap! Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Patches to REBOL 2.2.0 Re:(2)
Ladislav wrote: > ...could you put in a For patch? Sure! Send the code for what's desired, and I'll glue it on the bottom, and make sure it all goes. I think I recall you mentioning this in an earlier email, but I can't find it, yet. :-( Eric wrote: > You can do Patch_to-func a lot more easily if you use the latest version of HUH (not yet available on rebol.org). I was trying to keep the code size small. :-) I've used your latest 'huh for inspiration, and made a shorter and quicker version, which I call 'Find_Word. More later. Andrew Martin Who's getting strange ideas about 'include functions... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Polymorphic Re:(2)
Nice try, but it is only a more complicated version of: bop: func [ {returns the results of operating on elements of b with those of bb - last element of bb will be reused if necessary} 'op [word!] "name of function to use" b [block!] bb /local r ][ op: get in system/words op r: copy [] if not block? bb [bb: reduce [bb]] while [not tail? b] [ append r op first b first bb b: next b if 1 < length? bb [bb: next bb] ] r ] >> bop / [4 2] 2 == [2 1] , which is a pure prefix matter ;-) > > Hi Ladislav, > > What do you think of this? It's sort of polymorphic, but it's not the > right approach to handle complex numbers. > > bop: func [ > {returns the results of operating on elements of b with those of bb - > last element of bb will be reused if necessary} > 'op [word!] "name of function to use" > b [block!] > bb > /local r - > ][ > op: get in system/words op > if op? :op [set '- :op] > r: copy [] > if not block? bb [bb: reduce [bb]] > while [not tail? b] [ > append r either :- [(first b) - (first bb)][op first b first bb] > b: next b > if 1 < length? bb [bb: next bb] > ] > r > ] > > >> bop * [$2.00 $1.53] 2 > == [$4.00 $3.06] > >> bop ** [2 3 4] [4 3 2] > == [16 27 16] > >> bop and [1 2 3 4 5 6 7 8] 5 > == [1 0 1 4 5 4 5 0] > > See you, > Eric > > >
[REBOL] What's next for REBOL...
Me too!