[REBOL] Problem with sending attachements Re:
I think Rebol does not have a built-in capability for this, however a script will do the job. Have a look at the following page and search for attach.r http://www.rebol.org/email/index.html Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 12, 2000 5:10 PM Subject: [REBOL] Problem with sending attachements Hey, sorry to be annoying. I'm new in Rebol and I really like it. But I have a problem. My questions is how to send a file that can be seen as an attachements in Microsoft Outlook. Thank you very very much. dare
[REBOL] rebol weak points (i think) Re:(5)
Hi, Rishi... By the way, did anyone write a rebapp to read/post messages on this newsgroups rather than having it come in my mail box? I am having to constantly subscribe/unsubscribe on demand depending on when I need to send messages. You could also stick around and help others new to Rebol. ;-) Brett.
[REBOL] IRC Protocol (I give up ) Re:(7)
message ::= [':' prefix SPACE ] command params crlf prefix ::= servername | nick [ '!' user ] [ '@' host ] It could be nice to have a REBOL function to actually parse (any) whole 'pseudo' BNF formatted description.. /PeO I agree. I started looking at a function like this (given the number of EBNF floating around w3c.org) but unfortunately have not produced anything remotely useful. Though the exercise taught me a heap about all sort of things I didn't know before... Problems struck include "backtracking". I found a relevent scscript called search-text.r (on www.rebol.org) by Eric Long that takes regular expressions - but again I got lost. So I second the motion, it would be nice to a such a function :) Brett.
[REBOL] Copyrights Re:
Since it is very important, you should consult a lawyer and explain to him/her your requirements. Different countries have different copyright laws. Some countries have agreements between them so that if your work is protected in one country it may also be protected in another. The site http://www.copyright.org.au is meant to be used by Australians (in Australia copyright protection is automatic). It has a number of useful articles about copyright including an information sheet called "Copyright Protection in Other Countries". This may give you a clue to what you need to consider. That said, it is likely that you will need to understand your home countries copyright law before looking into other countries. Maybe others on this list will add some other links. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 2:52 PM Subject: [REBOL] Copyrights Hello, I live in Peru and I need register my products, copyrigths, etc. Basicly in USA, I think. Please, can somebody tell me what I must do or who contact ? It is very important. Thank you very much. Cristian G. Amayo
[REBOL] if any [not suffixes find suffixes find/last file . ] [ Re:(4)
Just a note. There is an enhancement request for find so that it return values like John's code suggests but without requiring the loop. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 08, 2000 3:00 AM Subject: [REBOL] if any [not suffixes find suffixes find/last file "." ] Re:(3) Hi, Do you mean ... foreach file-name file-list [ if find/any file-name "*.r" [ print join "found " file-name ] ] ? cheers, john I think it makes sense now... but: how could I use a wildcard such as the find/any wildcard to find the file, e.g.: find/any file-list "*.r"
[REBOL] Creating an absolute path filename via join on directory and filename Re:(4)
Shouldn't they return the same thing on Rebol? It seems like they should. Is this a bug? I doubt it. What would be the point of such information? It it is clearly platform specific information. With my Rebol hammer, I'm seeing most problems as nails, but is this going a little far? [snip something I can't comment on.] Even if it is cool for Unix wizards to have whatever this info is, it will be a drag for them if they write a script using that info and expecting it to work everywhere... I don't know what info is there, but I can guess, so I suspect that it may even be a drag to expect that the information would work even on the same platform at a later time. It may be that the result on Windows may be the better behaviour - don't know really. Brett. -Galt = Original Message From [EMAIL PROTECTED] = Without the final '/', read attempts to access the directory as an actual file. On mess-doss this causes an error, while on *nix it returns some nice binary stuff which only wizards know how to use. With the final '/', read returns a block of names found within the directory. For example, in the MICROS~1 world: foo: read %Examples ** Access Error: Cannot open /C/bin/REBOL/Examples. ** Where: foo: read %Examples foo: read %Examples/ == [%all.r %index.html %webprint.r %webget.r %webgetter.r %weblib.r %websend. r %webfind.r %webfinder.r %webcheck.r %webloop.r %webt... And in the *nix world: foo: read %java == {^@H^@^@^@^@^[A^@\^@^G^@^@classes^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^ @ ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^... foo: read %java/ == [%classes/] -jn- [EMAIL PROTECTED] wrote: Hi, an absolute path is like this: %/c/cygwin/ %/d/games/afile etc.. Hope that's what you're after. By the way, somebody once said it's better to specify dirs with the '/' on the end. I forget why... Anton. [EMAIL PROTECTED] wrote: I want to create a configuration file which loads in some functions I wrote. I wrote a verbose description of the program below, but then figured: "Gee, REBOL is actually more concise and easy to understand than my English!" REBOL [] rebol-dir: "/cygwin/home/administrator/rebol" j: join rebol-dir "/vindex.r" f: to-file j do f so I have two questions: 1- how can i use "c:/cygwin/home/administrator/rebol" instead of just "/cygwin/home/administrator/rebol" so that I can use directories which may be on any drive? 2- As it stands, this script just hangs even though there is a file called vindex.r in the created directory path Get your FREE Email and Voicemail at Lycos Communications at http://comm.lycos.com -- ; Joel Neely [EMAIL PROTECTED] 901-263-4460 38017/HKA/9677 REBOL [] print to-string debase/64 decompress #{ 789C0BCE0BAB4A7176CA48CAB53448740FABF474F3720BCC B6F4F574CFC888342AC949CE74B50500E1710C0C2400}
[REBOL] Jobs/projects list? Re:(4)
IfranView is a great little freeware (non-commercial use) viewer for Windows that can handle more image formats "than you can poke a stick at" including PPM. Does batch conversions as well. Worth checking out. http://www.irfanview.com/ Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 9:47 AM Subject: [REBOL] Jobs/projects list? Re:(3) Practically all file viewers on UNIX/Linux can view .ppm. I used to have a viewer for Windows but I can't find it anymore. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, August 28, 2000 4:10 PM To: [EMAIL PROTECTED] Subject: [REBOL] Jobs/projects list? Re:(2) OK. What kind of application can I use to view a .ppm (portable pixel map) file? I have finished up a good chunk of the GML parsing (grammer.r) and started work on the renderer (renderer.r and threed.r). However RealLife and WeakMathSkills is preventing me from finishing it up. 'do %render.r' should create a tiny 'testing.ppm' file containing a picture of a rendered plane. --- Although I wasn't able to finish it, I had a lot of fun with the parsing. REBOL parses like a hot knife through butter! My problem is that I've never written any 3-d code in my life so that bit was going to be out of my reach for a while. If there are any enterprising programmers out there, feel free (no strings attached) to use this code as you please. There are still about 20 hours left till the deadline. Top prize is $1000US and unlimited bragging rights!
[REBOL] Please help with proxy setup Re:
Hi, MAPI is a piece of technology inside Outlook/Windows. You will need to talk to your network administrator at work. It is quite possible that they will have to make a special setting (there are multiple ways they could do it) on their network server machines in order for you to be able to use Rebol or any other TCP/IP client to access your outside pop server. When (and if) they do this, they should tell you the address you should use for the "pop server". Whether they do this for you will depend on the security/network policy at your work and how much extra admin it causes them. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 25, 2000 11:58 PM Subject: [REBOL] Please help with proxy setup Hi, we dont have a pop server here at work, they have some beast call MAPI (not IMAP) that is used, for example, if you want to setup Microsoft Outlook or something. I have an outside ISP (Earthlink) and I know that it gets my email from pop.earthlink.net. Our proxy is esnproxy the port by which it is accessed is 80 So, how do I setup Rebol at work? Any help is appreciated. --- at home, I simply followed answered Rebol's questions and was up and runnning in 20seconds. at home I answered as follows: email address: [EMAIL PROTECTED] email server: pop.earthlink.net no proxy Get your FREE Email and Voicemail at Lycos Communications at http://comm.lycos.com
[REBOL] context of a function Re:(8)
As far as I know, it is only humans that can give the word simple a meaning. ;) So it is humans that interpret something as simple. "When you set out to write rules for a game you will be suprised to find that a rule which seems perfectly clear to you can easily be misunderstood even by very intelligent players. The reason is that players are very rarely starting from scratch. There are other games they play and other habits they have. They may therefore interpret your rules on another basis." ["Simplicity", Edward de Bono, Penguin Books] Obviously the antidote for this malaise is clearer (less ambiguous) communication. Edward de Bono also points out that simplicity does not just happen. There is an effort seeking it. If someone has found a simple design everyone benefits when that design is communicated clearly. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 25, 2000 3:36 AM Subject: [REBOL] Re: context of a function Re:(6) Hello [EMAIL PROTECTED]! On 23-Ago-00, you wrote: [...] b Functions are simpler b than most think they are. Actually, REBOL is simpler than most think it is. This is the reason because they often complain for bugs or strange behaviour: humans have a lot of difficulty to grasp simplicity. Regards, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] Refining functions.
I've finally got paths working on functions. So you can call a refined function fairly easily. Other may know this, but it was new on me. In the following example f1 will called a refined version of f2. The nice thing is how it just calls existing functions. Also, it leaves the argument passing to the caller. to-refined-function: function [ "Refines a function with the specified refinements." 'f refinements [any-block!] ] [p] [ p: to-path head insert/only head copy refinements f :p ] f1: function [ x y ] [a-func refines] [ refines: [r2 r3] a-func: to-refined-function f2 refines a-func x y ] f2: func [ x /r1 /r2 y /r3 ] [ print ["Function f2 was called with parameter" mold x] if r1 [ print "Refinement r1 was called." ] if r2 [ print ["Refinement r2 was called with parameter" mold y] ] if r3 [ print "Refinement r3 was called." ] ] Now the test. f1 "test" "2nd-param" Function f2 was called with parameter "test" Refinement r2 was called with parameter "2nd-param" Refinement r3 was called. Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol
[REBOL] Refinement Help output Re:
You made all your refinements and their arguments local. You will need to move the "/local..." after the description for "/rev". Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 21, 2000 1:09 PM Subject: [REBOL] Refinement Help output I got the following function which I enhanced from a previous posting with some help from members of this list. How do you get help to display the comments for the refinements. Paul Tretter dec2bin: func[ "Converts Based 10 Integers to Binary" dn [integer!] "Base 10 Integer" /local holder neghold /pad+ zr+ [string!] "Add String to beginning of Output value" /pad- zr- [string!] "Add String to tail of Output value" /rev "Reverses the normal output of the value"][ holder: make string! "" if dn = 0 [holder: "0"] if negative? dn [ dn: absolute dn neghold: 1] while [dn / 2 0][ either dn // 2 0 [insert holder 1][insert holder 0] dn: to-integer dn / 2 ] if rev [reverse holder] if pad+ [insert head holder zr+] if pad- [insert tail holder zr-] if neghold = 1 [return join "-" holder] return holder ]
[REBOL] Enhancement Request - Range! datatype Re:(6)
how about? 1to10 -1to-10 .1to.10 Is using n"to"n that different from using n"x"n for pairs? It is immediately obvious that it is a range, ( in English at least). Other ideas? "to" could be exclusive and "thru" inclusive like parse. Don't know what you do about the range start though. ".." is quite concise (if barely legible on my monitor ;) ). So if we were lucky enough to get some range math use a .. b for an inclusive range as suggested before. a .. b for an exclusive start point and inclusive end point a .. b you can guess a .. b a range that does not include the end points Brett.
[REBOL] Find/any doesn't seem to find strings in blocks.. Re:(3)
Hi Elan, Good question. I assumed one sort of behaviour but it is not necessarily obvious is it? Having thought on it a little I think the /any refinement should be activated for the block situation or the help/documentation changed to indicate it will not work. My preference is for the former since we should get those other great refinements as part of the bargin. I suspect that the behaviour should not be the same in both cases as the cases are of different types. Since Find is defined as "Finds a value in a series..." - its behaviour should depend on the values of the series it is given. The values of a string are characters so Find returns us the string with the current index of the string set appropriately - resulting in a part string. So, I suggest that it makes sense that the result of the find on a block should be the block with the current index set appropriately, as it does now, but with the /any refinement enabled to influence the matching. Any comments? Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 20, 2000 2:44 PM Subject: [REBOL] Find/any doesn't seem to find strings in blocks.. Re:(2) Hi etcha, help find [...] /any -- Enables the * and ? wildcards. [...] Case 1: string: "xdefgjkljyjkljweruiouz" find/any string "y*z" == "yjkljweruiouz" Case 2: block-with-string: reduce [string] == ["xdefgjkljyjkljweruiouz"] find/any block-with-string "y*z" == none Should find's behavior be the same in both cases? At 12:00 PM 8/20/00 +1000, you wrote: whats wrong with: blah: "my-string" == "my-string" blah: parse blah "-" == ["my" "string"] if find blah "my" [print ["yes"]] yes its not what you want, but you cant search the string for something thats not there, eg "my*" :) etcha -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Sunday, August 20, 2000 11:42 AM Subject: [REBOL] Find/any doesn't seem to find strings in blocks.. I would have expected this to work. Am I missing something? find/any ["my-string"] "my*" == none Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol ;- Elan [ : - ) ] author of REBOL: THE OFFICIAL GUIDE REBOL Press: The Official Source for REBOL Books http://www.REBOLpress.com visit me at http://www.TechScribe.com
[REBOL] Is there a rebol email client app yet? Re:(2)
Thanks for the replies Gabriele and Paolo. I look forward to preliminary sketch info. Also, it will be very interesting to look on the results of this effort, down the track, to analyse how effective the environment is towards applications development productivity. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 20, 2000 4:45 PM Subject: [REBOL] Is there a rebol email client app yet? Re: I thought there was a Rebol email client app project underway. I was wondering if anyone knows if it has produced something. Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol We're just at the beginning of the development cycle... and yet have to organize our cohordinate efforts. There's plenty of space, anyway... Today or tomorrow, I'll post a very preliminar sketch/proposal of user interface, based on Carl's drafts. If you are curious, you can join the mailing list (Rebmail) at www.egroups.com. -- Paolo Russo [EMAIL PROTECTED] _ PERD s.r.l. Virtual Technologies for Real Solutions http://www.perd.com
[REBOL] Is there a rebol email client app yet? Re:(3)
Thanks Andrew. I'll do that - but probably just in stealth mode :) Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 20, 2000 6:10 PM Subject: [REBOL] Is there a rebol email client app yet? Re:(2) If you are curious, you can join the mailing list (Rebmail) at www.egroups.com. To subscribe to this group, send an email to: [EMAIL PROTECTED] To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Andrew Martin Rebol list 'bot... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] Find/any doesn't seem to find strings in blocks.. Re:(4)
Hm. Which means I want a consistent behaviour (setting the index appropriately according to the value found) even if it looks different (one returns what looks like a part string - the other returns what looks like a part block, not a part string). Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 20, 2000 11:45 PM Subject: [REBOL] Find/any doesn't seem to find strings in blocks.. Re:(3) Hi Elan, Good question. I assumed one sort of behaviour but it is not necessarily obvious is it? Having thought on it a little I think the /any refinement should be activated for the block situation or the help/documentation changed to indicate it will not work. My preference is for the former since we should get those other great refinements as part of the bargin. I suspect that the behaviour should not be the same in both cases as the cases are of different types. Since Find is defined as "Finds a value in a series..." - its behaviour should depend on the values of the series it is given. The values of a string are characters so Find returns us the string with the current index of the string set appropriately - resulting in a part string. So, I suggest that it makes sense that the result of the find on a block should be the block with the current index set appropriately, as it does now, but with the /any refinement enabled to influence the matching. Any comments? Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 20, 2000 2:44 PM Subject: [REBOL] Find/any doesn't seem to find strings in blocks.. Re:(2) Hi etcha, help find [...] /any -- Enables the * and ? wildcards. [...] Case 1: string: "xdefgjkljyjkljweruiouz" find/any string "y*z" == "yjkljweruiouz" Case 2: block-with-string: reduce [string] == ["xdefgjkljyjkljweruiouz"] find/any block-with-string "y*z" == none Should find's behavior be the same in both cases? At 12:00 PM 8/20/00 +1000, you wrote: whats wrong with: blah: "my-string" == "my-string" blah: parse blah "-" == ["my" "string"] if find blah "my" [print ["yes"]] yes its not what you want, but you cant search the string for something thats not there, eg "my*" :) etcha -Original Message- From: [EMAIL PROTECTED] [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Sunday, August 20, 2000 11:42 AM Subject: [REBOL] Find/any doesn't seem to find strings in blocks.. I would have expected this to work. Am I missing something? find/any ["my-string"] "my*" == none Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol ;- Elan [ : - ) ] author of REBOL: THE OFFICIAL GUIDE REBOL Press: The Official Source for REBOL Books http://www.REBOLpress.com visit me at http://www.TechScribe.com
[REBOL] Passing refinements to sub functions. Re:(3)
That's funny. I should have checked the scripts I load by default before checking the sources. Now what other little gems have I unwittingly loaded? :) Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 21, 2000 6:04 AM Subject: [REBOL] Passing refinements to sub functions. Re:(2) Hi, back from holiday. You might not notice, but Refined is a function defined in www.rebol.org/advanced/highfun.r It was my reaction to Michael's problem, but he pointed out, that he didn't want to use it because of its overhead... Regards Ladislav Rooting around Rebol sources as the official guide book recommends, I came across the following function (which would make my /refinements refinement unnecessary. Now to get it to work help refined USAGE: REFINED f refinements DESCRIPTION: Create a function doing the same thing as a function with given refinements does REFINED is a function value. ARGUMENTS: f -- (Type: any-function) refinements -- (Type: block) (SPECIAL ATTRIBUTES) catch - Original Message - From: "Brett Handley" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 12, 2000 7:20 PM Subject: Re: [REBOL] Passing refinements to sub functions. Re: Thanks for your response Michael. Now that's an interesting idea. I think your approach is good at getting the refinements of the higher-function processed as a set, but it obscures what happens after that. My latest approach has been to use an additional refinement on the sub-function called /refinements. This has an argument of type block that contains pairs of refinement-name and refinement-value. Inspired by your work I produced this. main-func: function [/va /vb /vc][this-code refine-values r][ sub-func/refinements refinements-to-block :main-func va ] sub-func: function [/refinements refine-list][va vb vc][ do bind refine-list 'va print ["va:" va] print ["vb:" vb] print ["vc:" vc] ] refinements-to-block: function [ hi-func 'sample-refinement ][refinement-block][ refinement-block: copy [] foreach r first :hi-func [ if (refinement? r) and (r /local) [ append refinement-block to-set-word r append/only refinement-block to-paren bind reduce [to-word r] :sample-refinement ] ] compose refinement-block ] It results in this: main-func/vb/vc va: none vb: true vc: true Of course it doesn't handle any refinement arguments. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 09, 2000 1:35 AM Subject: [REBOL] Passing refinements to sub functions. Re: Well since I know you're thinking about asking for the solution I had come up with, I'll go all out and post it here. The actual solution to loop through the function items (refinements) is not much code, but is tedious and messy-looking. I feel like I'm going through alot of trouble to hide this and save a few characters in the "high-level" function, but the result is a little easier on the eye and made me learn about contexts and 'bind. ; Say you have a high-level function (main-func) with a list of refinements, and you want to pass all of these refinements to a lower-level function (sub-func). The bare parameter-passing code is: main-func: function [/va /vb /vc][this-code refine-values r][ this-code: make-code "main-func" "sub-func" bind this-code 'some-global bind this-code 'refine-values do this-code ] sub-func: function [param-list][va vb vc][ set [va vb vc] param-list print ["va:" va] print ["vb:" vb] print ["vc:" vc] ] ; Resulting in: main-func/va/vc va: true vb: none vc: true ; To support this you must define the following globally: some-global: none make-code: function [hi-func [string!] lo-func [string!]][code][ code: copy { refine-values: make block! [] foreach r first :hi-func [ if (refinement? r) and (r /local) [ append refine-values get bind to-word r 'refine-values ] ] lo-func refine-values } replace/all code "hi-func" hi-func replace/all code "lo-func" lo-func return(to-block code) ] - Michael Jelinek
[REBOL] Official guide in the UK Re:(2)
It even made it to Waterstones in little old Newbury ! (Priced at GBP 26.99) That is amazing. When I was there, I really had to go to Oxford or Reading to get something technical :) Brett.
[REBOL] Is there a rebol email client app yet?
I thought there was a Rebol email client app project underway. I was wondering if anyone knows if it has produced something. Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol
[REBOL] A novice question Re:
Hi Vik, Did you retry your program in a fresh session of Rebol? It may have been that during your writing/testing of your program you got to a point that triggered the Rebol GC bug (which I understand is being looked at by RT). Regarding the keywords are they tags or text? This might change the approach. If say your keywords are part of the text, are immediately before and after your job posting information, and are unique enough, then you could just ignore the tags completely and parse based on your keywords. Something like this maybe: parse-rules: [ some [ thru keyword-one-text copy text to keyword-two-text (print text) ] Also, it may not be relevant, but note that the parse function as used in script examples ignores spaces by default (use parse/all if you want parse to process spaces). On a different track, Rebol version 2.3 has the ability to load markup. Like this, loaded-page: load/markup http://www.abc.net.au/news loaded-page is now a block that contains values of type tag! and type string!. foreach item loaded-page [ if not tag? item [ print item ] ] or use parse in block mode rules abc-news-headlines: [ thru !-- start insert of main story copy -- some [ thru b copy text to /b (print text)] !--end insert of copy for top stories-- to end ] parse loaded-page abc-news-headlines Supply ship approaches rescue site as hopes fade Muslim extremists collapse hostage release talks Monsoon bus tragedy in central India US bushfires not letting up Gore pulls ahead in US presidential poll Man falls overboard in crocodile-infested waters Fighting couple force jumbo jet to land Sport news This is good if you know exactly what the value of some items in the block are, but not sood good if you need to do pattern matching. For example finding the title text is easy because we know a tag title exists in the b lock. copy/part find/tail loaded-page title 1 == ["ABC Online News - Latest Bulletin"] Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 20, 2000 8:27 AM Subject: [REBOL] A novice question I was trying to modify the web parser code from the User's Guide. The original code is like this: tag-parser: make object! [ tags: make block! 100 text: make string! 8000 html-code: [ copy tag ["" thru ""] (append tags tag) | copy txt to "" (append text txt) ] parse-tags: func [site[url!]] [ clear tags clear text parse read site [to "" some html-code] print text ] ] My aim is to pick up listings from the web site to pick up jobs which begin with "keyword_one" and end with "keyword_two", but I would still like to get rid of the tags. So I tried this html-code: copy tag ["" thru "keyword1"] (append tags tag) | copy txt to "keyword2" (append text txt) ] etc.. and then use tag-parser/parse-tags modified-url. But this now hangs. Any help welcomed by this novice. -Vik __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
[REBOL] problems with local vars??? Re:(5)
Guru question. Rebol functions are a dialect which is interpreted... [ ] At load time. [ ] After being loaded. [ ] Both of the above. [ ] The question is irrelevent and can be ignored without harm. [ ] Not enough information to say. [ ] Other (please specify). ;) Brett - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 18, 2000 3:43 PM Subject: [REBOL] problems with local vars??? Re:(4) Brett wrote: But I wonder if Rebol necessarily sees functions like this? Are they perhaps a dialect that is interpreted? Rebol functions are a dialect and they are interpreted. Andrew Martin ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] problems with local vars??? Re:(7)
second :f is different. It returns a "live" block of code (the body) with the contained words bound to the local frame of the function f. This block of code can be modified with and extended (with append etc. using 'bind if necessary) after the function is created. It seems clear that the interpreter executes the function by 'do-ing this body block. The original reason I originally questioned the relationship between functions and dialects in this thread was due to this "'do-ing the body block" concept. To make the question specific define a function f like this: f: func[/local x][x: {} append x "a" print x] My question then is, how are the first two values (x: {}) of the body block treated when the interpreter executes the function? In terms of purely executing the block, logically it seems, the first two values could be considered redundant, correct? A related issue (maybe), I don't know if it is been asked before. If I now use f, I get: f a f aa Compare this with another function g and its results: g: func[/local x][x: 0 x: add x 1 print x] g 1 g 1 Are these results related to the execution of a function or the interpretation of datatypes? Any enlightenment please? Brett.
[REBOL] For bitset fiddlers and Outlook express users.
Two items unrelated to each other apart from where they are hosted. Bitsets I've made available on my site a script that given a bitset will describe that bitset in a form that the charset function will understand. The address is http://www.zipworld.com.au/~bhandley/rebol/scripts/bitsets.r Outlook Express Ssh. I use it too. My problem with it has been HOW do I get my messages of out the damnable thing once it has gorged on my precious emails? The answer lies in telling it to "drop it's bundle". Rebol sifts the bundle. Details at http://www.zipworld.com.au/~bhandley/exporting-from-outlook-express.html Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol
[REBOL] problems with local vars??? Re:(3)
Here's your function slightly edited local-func: function [input][my-local-string][ my-local-string: ; This says make it so that my-local-string refers to the next value. (1) "that is local " ; This says create a string value. (2) print append my-local-string input; (3) ] I think it's slightly confusing to say in (2) that the literal string "says to create a string value". Instead, I suggest that in (2) the literal string IS a string value. (If I had my geek hat on, I'd say something more complicated like "serves as a reference to the string that was created when this source code was loaded", bit I left my geek hat at home today... ;-) Yeah, it probably is a bit confusing. I confused my contexts. I intended to to convey the sense that Rebol "does it differently", especially compared to a compiled language (which was the example), rather than attempting to explain the deepest truths behind Rebol (which I'm not entirely confident on). I should have made that clear. I sould have also made clear that my meaning referred to what happens at load - distinguishing between might happen when Rebol script is parsed as opposed to when Rebol values are evaluated. Every time the function referred to by to local-func is evaluated, my-local-string is set to refer to THE SAME STRING, rather than a newly-created one. This sounds like a nice description when you have the expectation that functions always do something (their definitions) when they are evaluated. That they carry out all the parts of their definition when evaluated. A way of thinking that says "this function now has program control" so it has to do something (which is quite reasonable to imagine). But I wonder if Rebol necessarily sees functions like this? Are they perhaps a dialect that is interepreted? I only ask this because I'm trying to shake of my normal assumptions of what Rebol is doing when it evaluates a "function" which is after all a Rebol value not something like machine instructions (another guess!). Therefore, mutations on the value of my-local-string (e.g., append, insert, remove, replace ) are continuing to operate on the same string which ORIGINALLY (at load time) contained "that is local ", but which has subsequently been modified with every evaluation of the function. I don't want to sound hypercritical here! I'm really just thinking out loud about how to describe the behavior of literal series values in REBOL, as this sort of thing keeps coming up on the list. Yes, I know. I've collected three useful descriptions of it on my tips page. But I feel that at least two levels of description (absolute beginner/ not an absolute beginner) could be useful - differentiated perhaps by one using metaphor and the other describing "the truth"... You certainly described the correct solution in the remainder of your note, but I'm wondering if making a more explicit distinction between load time and evaluation time will help us explain this. Well, I think Elan can tell you that he believes it would since this distinction is made in "The Official Guide" (p230). Brett.
[REBOL] Search for in Strings Re:
The following is a literal string that contains two double quotes print {He said "hi".} He said "hi". HTH Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 10:16 PM Subject: [REBOL] Search for " in Strings Hi List, I need to search for " in lines of a file to remove them, but i dont know to do that. All other characters are no problem, but """ wont work. Everything i tried ends up in an Invalid String failure. Any suggestions will be gratefully accepted. Thorsten
[REBOL] Search for in Strings Re:(3)
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 10:51 PM Subject: [REBOL] Search for " in Strings Re:(2) The following is a literal string that contains two double quotes print {He said "hi".} He said "hi". gWell, to be grammatically correct, it should be: print {He said "hi."} He said "hi." Sorry, can't resist a correction. As an author, editor, and publisher AND programmer, this is one of my pet peeves. Punctuation goes inside the quote. Syntax counts in English as well as REBOL. --Ralph
[REBOL] problems with local vars??? Re:
Hi Raimund, The first thing is to understand that you can use my-local-string like a variable, but it is not really a variable (in the sense of a pointer to memory). It is a word that can refer to a value. The word my-local-string exists in it's own right - so does the value of type string "that is local". Doing an "assignment" associates the two. With this in mind, Rebol does not "initialise" the variable - it actually associates a word with a value. In C and other compiled languages when you declare a variable you give the variable a datatype and when you assign something to the variable your value is just a bunch of bits that conform to the datatype. This is not the case with Rebol. In Rebol the value has the type information. A word is a value too - a special type of value that can be associated with another value. In Rebol everything is a value including functions. So local-func is a word that refers to a value of type function. Here's your function slightly edited local-func: function [input][my-local-string][ my-local-string: ; This says make it so that my-local-string refers to the next value. (1) "that is local " ; This says create a string value. (2) print append my-local-string input; (3) ] Both (1) and (2) are part of the function definition. When (3) is actually executed, it in fact changes the value of (2). Why? because when the line is evaluated, my-local-string is evaluted before the append. My local string evaluates to the actual string stored in the function definition. You can see how the function definition has changed by calling your function once and then using the command. source local-func Now, if you function read like this... local-func2: function [input][my-local-string][ my-local-string: ; This says make it so that my-local-string refers to the next value. (4) copy "that is local " ; This says create a new string value that is a copy of another. (5) print append my-local-string input; (6) ] What would happen in (5) is a copy would be make of the string that is stored inside the function definition and the copy would be "assigned" to the word my-local-string. In this case when line (6) is executed the string will change but the function will not because the function does not refer to the copy. Hope it helps. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 17, 2000 12:12 AM Subject: [REBOL] problems with local vars??? Hi, I have quite some problems with the scope of local variables. The following script does point it out: -- REBOL [] local-func: function [input][my-local-string][ my-local-string: "that is local " print append my-local-string input ] local-func "Call 1" local-func "Call 2" print my-local-string - raimund@linux:~/Development/rebol/Tests rebol test_locals.r that is local Call 1 that is local Call 1Call 2 ** Script Error: my-local-string has no value. ** Where: print my-local-string The results suggest that locals are handled like static vars in C is that correct? Why does the assignemnt to my-local-string at the start of the local-func not inititalize the local? Can anyone point me to some more info about this issue? Thanx Raimund - 42 war schon immer einge gute Antwort;-))
[REBOL] AW: Search for in Strings Re:(2)
I'm not sure what you meant by "informations" but is something like this what you want? replace/all {2;"615165151";"L";20.15;456} {"} "" == "2;615165151;L;20.15;456" Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 11:11 PM Subject: [REBOL] AW: Search for " in Strings Re: Hi Brett, that was not was i was searching for. Perhaps i should be more detailed. i got a file with lines like this: 2;"615165151";"L";20.15;456 what i need is a way to get rid of the quotes including informations. the result should look like this 2;615165151;L;20.15;456 Hope you can help. Thorsten -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 16. August 2000 14:24 An: [EMAIL PROTECTED] Betreff: [REBOL] Search for " in Strings Re: The following is a literal string that contains two double quotes print {He said "hi".} He said "hi". HTH Brett.
[REBOL] AW: Search for in Strings Re:(3)
I can't let Allen finish with that...;) You could also do rejoin parse/all {2;"615165151";"L";20.15;456} {"} == "2;615165151;L;20.15;456" Not quite as elegant though. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 11:32 PM Subject: [REBOL] AW: Search for " in Strings Re:(2) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 16, 2000 11:11 PM Subject: [REBOL] AW: Search for " in Strings Re: Hi Brett, that was not was i was searching for. Perhaps i should be more detailed. i got a file with lines like this: 2;"615165151";"L";20.15;456 what i need is a way to get rid of the quotes including informations. the result should look like this 2;615165151;L;20.15;456 Or this works too. data: {2;"615165151";"L";20.15;456} == {2;"615165151";"L";20.15;456} trim/with data {"} == "2;615165151;L;20.15;456" Allen K
[REBOL] Core/View/etc. install plan Re:
If I want to install Core and View, do I need to have them separate, or could I put everything together except the executables (sounds unlikely), or do I need both installed at all? Not entirely sure why you would have to have them in the same directory, unless you are thinking about a single script library. I have a single "Rebol" directory with subdirectories of "Core" and "View". Each of these have their own standard .r files (user.r). I have a script manager that is defined in both user.r files so that it can utilise a shared script library for common scripts and specific script libraries if necessary. Is Core a subset of View? Yup. So unless you specifically want an exe without the GUI you can get away without Core - except that is the one that is non-beta. Is the latest Core inherently more stable than the latest View? Or is it just the View-y parts of View that are less stable? I think only RT could really answer this one properly. Is there an easy way of separating usr-lib and example scripts that only pertain to one executable or the other? See above. -- Pete Wason|"LWATPLOTG"|[EMAIL PROTECTED]|[EMAIL PROTECTED]|CUCUG|TA|PHX
[REBOL] Simple question regarding saving strings to files. Re:
Howdy, help save USAGE: SAVE where value /header header-data DESCRIPTION: Saves a value or a block to a file or url. SAVE is a native value. help mold USAGE: MOLD value DESCRIPTION: Converts a value to a REBOL-readable string. MOLD is a native value. help load USAGE: LOAD source /header /next /library /markup DESCRIPTION: Loads a file, URL, or string. Binds words to global context. LOAD is a native value. load {"stringa" "stringb" "stringc"} == ["stringa" "stringb" "stringc"] So you can do this save %your-file1.txt ["string a" "string b" "string c"] print load %your-file1.txt string a string b string c Or this (which retains the containing block in the file)... write %your-file2.txt mold ["string a" "string b" "string c"] print load %your-file2.txt string a string b string c Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 15, 2000 10:47 AM Subject: [REBOL] Simple question regarding saving strings to files. Hello again. I was just trying to write/append a series of strings to a .txt file and retain the format so that I get the following... a: "string a" b: "string b" c: "string c" How do you save the above strings to string-text.txt so that when I read the .txt file I get... "string a" "string b" "string c" "string a1" "string b1" "string c1" so that I can do a... str: read string-text.txt foreach [a b c][print [a b c]] Or is there a better way to do this? Thanks again, TBrownell __ Do You Yahoo!? Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
[REBOL] Passing refinements to sub functions. Re:
Rooting around Rebol sources as the official guide book recommends, I came across the following function (which would make my /refinements refinement unnecessary. Now to get it to work help refined USAGE: REFINED f refinements DESCRIPTION: Create a function doing the same thing as a function with given refinements does REFINED is a function value. ARGUMENTS: f -- (Type: any-function) refinements -- (Type: block) (SPECIAL ATTRIBUTES) catch - Original Message - From: "Brett Handley" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, August 12, 2000 7:20 PM Subject: Re: [REBOL] Passing refinements to sub functions. Re: Thanks for your response Michael. Now that's an interesting idea. I think your approach is good at getting the refinements of the higher-function processed as a set, but it obscures what happens after that. My latest approach has been to use an additional refinement on the sub-function called /refinements. This has an argument of type block that contains pairs of refinement-name and refinement-value. Inspired by your work I produced this. main-func: function [/va /vb /vc][this-code refine-values r][ sub-func/refinements refinements-to-block :main-func va ] sub-func: function [/refinements refine-list][va vb vc][ do bind refine-list 'va print ["va:" va] print ["vb:" vb] print ["vc:" vc] ] refinements-to-block: function [ hi-func 'sample-refinement ][refinement-block][ refinement-block: copy [] foreach r first :hi-func [ if (refinement? r) and (r /local) [ append refinement-block to-set-word r append/only refinement-block to-paren bind reduce [to-word r] :sample-refinement ] ] compose refinement-block ] It results in this: main-func/vb/vc va: none vb: true vc: true Of course it doesn't handle any refinement arguments. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 09, 2000 1:35 AM Subject: [REBOL] Passing refinements to sub functions. Re: Well since I know you're thinking about asking for the solution I had come up with, I'll go all out and post it here. The actual solution to loop through the function items (refinements) is not much code, but is tedious and messy-looking. I feel like I'm going through alot of trouble to hide this and save a few characters in the "high-level" function, but the result is a little easier on the eye and made me learn about contexts and 'bind. ; Say you have a high-level function (main-func) with a list of refinements, and you want to pass all of these refinements to a lower-level function (sub-func). The bare parameter-passing code is: main-func: function [/va /vb /vc][this-code refine-values r][ this-code: make-code "main-func" "sub-func" bind this-code 'some-global bind this-code 'refine-values do this-code ] sub-func: function [param-list][va vb vc][ set [va vb vc] param-list print ["va:" va] print ["vb:" vb] print ["vc:" vc] ] ; Resulting in: main-func/va/vc va: true vb: none vc: true ; To support this you must define the following globally: some-global: none make-code: function [hi-func [string!] lo-func [string!]][code][ code: copy { refine-values: make block! [] foreach r first :hi-func [ if (refinement? r) and (r /local) [ append refine-values get bind to-word r 'refine-values ] ] lo-func refine-values } replace/all code "hi-func" hi-func replace/all code "lo-func" lo-func return(to-block code) ] - Michael Jelinek
[REBOL] digests of REBOL list messages Re:
http://www.rebol.org/userlist/html/index.html I think that is what you are after. Brett - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 14, 2000 9:45 AM Subject: [REBOL] digests of REBOL list messages Hi, Are the digests of the messages sent to this list still available ? For the moment, the lists.rebol.com server seems to be non-existent (offline or dead or something).. I have all the messages from the start up to 2400 collected in files of 100 messages/each, and the rest of the mails in my mail prog... /PeO
[REBOL] Passing refinements to sub functions. Re:(2)
Thanks for your response Michael. Now that's an interesting idea. I think your approach is good at getting the refinements of the higher-function processed as a set, but it obscures what happens after that. My latest approach has been to use an additional refinement on the sub-function called /refinements. This has an argument of type block that contains pairs of refinement-name and refinement-value. Inspired by your work I produced this. main-func: function [/va /vb /vc][this-code refine-values r][ sub-func/refinements refinements-to-block :main-func va ] sub-func: function [/refinements refine-list][va vb vc][ do bind refine-list 'va print ["va:" va] print ["vb:" vb] print ["vc:" vc] ] refinements-to-block: function [ hi-func 'sample-refinement ][refinement-block][ refinement-block: copy [] foreach r first :hi-func [ if (refinement? r) and (r /local) [ append refinement-block to-set-word r append/only refinement-block to-paren bind reduce [to-word r] :sample-refinement ] ] compose refinement-block ] It results in this: main-func/vb/vc va: none vb: true vc: true Of course it doesn't handle any refinement arguments. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 09, 2000 1:35 AM Subject: [REBOL] Passing refinements to sub functions. Re: Well since I know you're thinking about asking for the solution I had come up with, I'll go all out and post it here. The actual solution to loop through the function items (refinements) is not much code, but is tedious and messy-looking. I feel like I'm going through alot of trouble to hide this and save a few characters in the "high-level" function, but the result is a little easier on the eye and made me learn about contexts and 'bind. ; Say you have a high-level function (main-func) with a list of refinements, and you want to pass all of these refinements to a lower-level function (sub-func). The bare parameter-passing code is: main-func: function [/va /vb /vc][this-code refine-values r][ this-code: make-code "main-func" "sub-func" bind this-code 'some-global bind this-code 'refine-values do this-code ] sub-func: function [param-list][va vb vc][ set [va vb vc] param-list print ["va:" va] print ["vb:" vb] print ["vc:" vc] ] ; Resulting in: main-func/va/vc va: true vb: none vc: true ; To support this you must define the following globally: some-global: none make-code: function [hi-func [string!] lo-func [string!]][code][ code: copy { refine-values: make block! [] foreach r first :hi-func [ if (refinement? r) and (r /local) [ append refine-values get bind to-word r 'refine-values ] ] lo-func refine-values } replace/all code "hi-func" hi-func replace/all code "lo-func" lo-func return(to-block code) ] - Michael Jelinek
[REBOL] REBOL the Official Guide Re:(4)
Here here. Received mine this morning (Sydney time). With excitement of receiving my first internet order from America, I opened the box, flipped some pages and found a very nice book as expected. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 09, 2000 4:17 PM Subject: [REBOL] REBOL the Official Guide Re:(3) After reading about it for days on this list (and getting increasingly envious), today I finally received my copy of Rebol: The Official Guide, the limited edition Carl Sassenrath-signed tip sheet. The CD was in the back, as expected, and works very well. Thanks Ralph and all the folks at Alexander Press who were responsible for getting this book into my hands (it's a hefty thing!) Thanks to all the folks at RebolPress for putting it all together! Thanks Elan and John for distilling the facts into concrete examples and explanations! Thanks Carl and all the folks at REBOL Technologies for manifesting your inner REBOLs! chaz
[REBOL] Passing refinements to sub functions.
Hi list, Often I have a function built on another. Sometimes the lower function has refinement that I want to surface on the higher function. If there is one refinement I just use an either. If there are more this approach becomes a real pain. I've come up the solution of creating an object with the refinements as fields and passing that. But I still have a bit of code creating the object in the first place. An alternative is using a block with set words and values, but I haven't figured how to use this effectively (that is I suspect I need bind but I haven't got it working yet). Has anyone an elegant solution for passing multiple refinements down the line? Brett. -- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol
[REBOL] Print on a real printer Re:
I'm not sure you mean by "real" but have a look at http://www.zipworld.com.au/~bhandley/rebol/learning-about-rebol.html#Miscell aneous For example, if you are talking to a postscript printer you will have to talk postscript yourself (as far as I know). Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 07, 2000 8:32 PM Subject: [REBOL] Print on a real printer Hello, how can I send text to an real printer with REBOL? Helmut
[REBOL] curiosity killed the code-generator Re:(3)
The word what Returns all functions. first system/words returns all words. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 07, 2000 11:20 AM Subject: [REBOL] curiosity killed the code-generator Re:(2) I know that there is a way to get a list of all rebol words, and have used it before, but have forgotten. How do I do that again? Thanks Tim
[REBOL] curiosity killed the code-generator Re:
I've thought about this myself a little, just for curiosity. I suppose if you're a Java developer then you should be able to come up with a few situations, like help with implementing design patterns say. This then is at the level of manipulating and interpreting Java source code. At a different level. Another thing you could do is leave the Java source behind and look at the Java Virtual Machine itself. In some ways this may be simpler. You could create a Rebol program, no doubt using a particular dialect, that would generate class files that could be directly executed on the JVM. If you like a feature of the JVM or some library of functionality already implemented for the JVM, this could be a way to leverage it. Obviously these languages have their strong and weak points. The thing is, I may be a little "uncreative" but I came to the conclusion that at the moment, unless there is a specific feature, "just" doing it Rebol is probably better. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, August 06, 2000 4:15 AM Subject: [REBOL] curiosity killed the code-generator howdy list, this one falls into the "I'm just curious" catagory. What would be some of the benefits of writing a code-generator in REBOL, say, for Java? That was actually suggested to me some time ago, and a person I mentioned it to called it a "trial by fire". hmm. Someone wrote some fortran tools, didn't they? I was just wondering what it helped. thanks! -- Spend less time composing sigs. -tom
[REBOL] Bug in either clean-script.r or the parser.
I've been using clean-script heavily recently, and have now tripped over the following problem. clean-script mangles the attached script. Specifically it creates an unmatched "(" for the following line. In other tests it could be a new "[". table-start: [text-line (emitter/start-table trim text) newline] The thing is it handles earlier such lines correctly, which leads me to think about the parser. I've think I've narrowed it down to the script not "consuming" the first "[" for this line. Instead load/next gets and it will return a block value. I tried removing some lines before this line and the error moved. Same for when you add extra lines - BUT they have to be of the same type not just any old line. Any ideas? Thanks. Brett. --- my-rebol-stuff == http://www.zipworld.com.au/~bhandley/rebol text-to-html.r
[REBOL] web stuff Re:
Just replying to one bit. By the way, the cookies-client.r is giving me trouble. there are documentation mistakes, redundancies, and inflexible code, and it doesn't fetch binary files like .jpg properly because of mishandling of cr lf chars, etc. - does anybody have a proper version that works or does anybody want to have a go at improving the blasted thing? For instance, what the heck is the actual purpose of cookie-data2? Why are there two and not many (a block)? Where is an actual example of use of each of these? Is the cookie stuff supposed to be built into Rebol, or do you have to get down and dirty with the http protocol internals? I hope that cookies will be supported in Rebol. I think that cookies-client.r is a bit too low-level. One way I have seen it done (WebL) is having a cookie database built into the language, which by default makes cookies transparent to the programmer. It also allows the programmer to manage cookie databases. Something similar would no go astray here. I was going to give this method a go, but became entangled in uncertainty as to what is the real cookie spec. actually is. Then I just got sidetracked.
[REBOL] why this not work? Re:
First, your message format. Could you please sent your emails to this list in plain text? The HTML of outlook will probably annoy all the plain text readers of the list. To do this in Outlook Express you can either: 1) Send all your email in plain text by Tools - Options - Send tab and select Mail Sending Format = Plain Text. Or 2) For plain text only to this list. Add [EMAIL PROTECTED] as an address to your address book. Select the properies of the this address and choose the name tag. Check the "Send e-mail using plain text only" checkbox. Thanks. Secondly your program. Your program is self-modifying (though you would not have intended that). The problem line is if find in_file "BODY" [body_tobe: {BODY}] On this line the word body_tobe is referring to a string that is actually part of your function definition. I know this sound strange but have a look at this web page for a simpler explanation. http://www.zipworld.com.au/~bhandley/rebol/rebol-techniques.html#Wordsarenot variables1 Change the line to read like this if find in_file "BODY" [body_tobe: copy {BODY}] There are other lines which are affected by this. Use source make_generic_html_locator to see the other changes. On a side note, the line in_file: make string! in_file is completely redundant since the result of the read is a string. Hope it helps. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 02, 2000 11:54 PM Subject: [REBOL] why this not work? i just cant keep figuring out when you use this with two different files and go say: function file here function second file here function file here btw: these are html files with one body having BGCOLOR="white" and one simply having BODY - start of function - make_generic_html_locator: func [ a [file!] "Filename to add location reference for" ] [ page_content: "sd" clear page_content if not exists? a [print reform ["File not found:" a] halt] in_file: read a in_file: make string! in_file if not find in_file "HTML" [print "File is not HTML Compliant" halt] if find in_file "TITLE" [ parse in_file [thru {TITLE} copy page_title to {/TITLE}] print page_title ] parse in_file [thru {BODY} copy body_attrib to {}] body_tobe: rejoin [{BODY} body_attrib {}] if find in_file "BODY" [body_tobe: {BODY}] parse in_file [thru body_tobe copy page_content to {/HTML}] print body_tobe print page_content clear page_content clear body_tobe print "Generic Page Locator Finished" ]
[REBOL] Rebol novice questions Re:
It would be nice to have shell access is this possible? I believe Rebol/Command addresses this, but I haven't used it. I rely on another Linux program to convert the text to a Midi file, and again another one to play it! though I am thinking of writing out the Midi File directly this time are there any Midi Rebol functions to to deal with Midi files? None that I know of. Brett
[REBOL] For those new to list and notetab-gateway users.
Hi, 1) I've created a web page of a collection of posts that have been sent to this list over the last few months. By no means is it a complete list. It is just messages that caught my eye while learning Rebol. So if you have been on the list for a while you will not find anything new there, but you may find your own message :) 2) Regarding the notetab-gateway I mentioned earlier on the list. I've fixed a bug in the notetab-gateway.r script (used to truncate input to 10k) and I've updated the matching clipbook library so that it is a lot more clear on how to call Rebol from Notetab. The page for both of these is http://www.zipworld.com.au/~bhandley/rebol Brett.
[REBOL] Using Rebol from within Notetab.
I've created a web page with a few rebol scripts and in particular some support for using Rebol from within the Notetab text editor. Things you can do: Write a rebol expression in a notetab text file, select it and have the selected expression evaluted by Rebol, with the results replacing the selected text. Add your own clipbook entries to mine for calling on Rebol scripts to process your text. For example, you can open a tab delimited text file exported from Excel. Select all the text. Click on "Tab delimited to block" and the text will be replaced with a rebol block version of the data. You can also go the other way. Anyway, check it out at http://www.zipworld.com.au/~bhandley/rebol/ Have fun :) Brett.
[REBOL] parse-xml cannot be reversed Re:(2)
With a few adjustments, it should be able to handle all xml-parsed trees, afaik... but it's 5:48am right now, so I may be wrong. :-) I think I stand corrected. Which is good :) You can also parse the whole parse-xml structure with the new block parser in /View and /Core 2.3. It only takes about 6 lines of code. :-) Try this: doc-rule: ['document none! subtags-rule] subtags-rule: [none! | into [some [tag-rule | substring-rule]]] tag-rule: [into [string! parameters-rule subtags-rule]] substring-rule: [string!] parameters-rule: [none! | block!] parse (parse-xml {ateststringb/c//a}) doc-rule This is great. I was wanting to see an example of block parse with into in action. Brett.
[REBOL] Parse does not have not match type. Re:(2)
That's brilliant Ladislav. It took a little while to understand what magic you put there, and I learnt something as a result. I've made a few tests so far and cannot fault it. Thanks, Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 31, 2000 4:06 AM Subject: [REBOL] Parse does not have "not" match type. Re: Hi, I think, that Parse has got a bug as in: parse "a" [none skip] == true cc-ing to feedback. Here is a version of A-B-rule, that should work reliably. Test it please. A-B-rule: func [ "Generate an A-B parse rule" A [block!] {A-rule} B [block!] {B-rule} /local o ] [ o: make object! [ A-rule: A B-rule: B res-rule: none ] bind/copy [ (self) [ B-rule (res-rule: [to end skip]) | A-rule (res-rule: []) | (res-rule: [to end skip]) ] res-rule ] in o 'self ]
[REBOL] Parse does not have not match type.
I was playing around with the idea of using rebol to convert EBNF to Rebol parse rules. A strange occupation maybe, but I thought it might be useful one day. Anyway, I found a rule in EBNF, as described in XML1.0 - http://www.w3.org/TR/REC-xml.html, for which I believe there is no equivalent in Rebol - and I cannot see how it can be worked around. It is the A - B rule which says "matches any string that matches A but does not match B". I looked into the use of this rule in the xml spec and found that it does not relate simply to characters, so I cannot just do something with "complement". Is there a way, or no? Thanks, Brett.
[REBOL] REBOL SCOPING / CONTEXT EXPLANATIONS Re:(5)
Hi Larry, one small correction. Yep. Slipped on a banana as I was nearing the finish line. I knew I should have gone to bed - just had to get rid of the "monkey on my back" :) Of course, Carl's example was very contrived -- how else could one short script have 15 uses (one hidden in 'b2) of the word 'b. :-) Indeed. Apart from 'use, hopefully Carl has run out of more uses! Brett.
[REBOL] input a bunch? Re:
Um.. Read it from a file? Read it from an url? Read it from a Tcp/ip port?! If you mean you want a better user interface, then you could set a mini-webserver /cgi/ and HTML page for input :) or use Rebol/View and construct an interface with it. If you were using /view you could also read from the clipboard as well. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 26, 2000 8:37 AM Subject: [REBOL] input a bunch? hey list guys, I have something like this: print "type something" input: somthingtyped this works like a champ when I type stuff in at the console. but I'd prefer to get it in some other way, and pasting mucks stuff up. how can I get, say, a paragraph into input? I'm typing in stuff that I don't know beforehand... thanks, -- Spend less time composing sigs. -tom
[REBOL] One more thing - Odd behavior with setting variables Re:
path: ["blah1" "blah2" "blah3" "blah4" "blah5"] is better written as: paths: [%blah1/ %"blah blah2/" ... paths: [%blah1/ %"blah blah2/" (i dont get it) In this case paths is a block. A block groups a number of values. You've shown two values - both represent rebol filenames (see the Rebol user's guide - files - names). The first filename represents a directory, while the second represents a filename that has a space between "blah" and "blah2/". The % indicates a filename. So here is an example combining both concepts that will read the "Program Files" directory on Windows. read %"/c/Program Files/" Hope it helps. Brett.
[REBOL] APL'ish operations Re:(3)
Perfect. Just what I needed. Wish there was a way to make simple one-off functions in a block like [ + 5] etc. I think you can. Again according to what you need. This is where Rebol shines. Rebol gives you the ability to interpret blocks (and strings) in way other than the default provided by Rebol. That is, according to your own grammar. Rebol calls this a dialect. Admittedly this is not straight-forward when you're beginning with Rebol. On the other-hand once you have done this a few times, you will see opportunities for it everywhere and discover that it really is not as complex as it sounds. One way to achieve this is to interpret a block by stepping through it and checking types then doing something. Another way is to use the parse function of rebol. Parse takes a string or a block as input plus a grammar specification that will interpret your input according to rules. So to your example. What would [+ 5] actually do and how would it be used? Brett.
[REBOL] Rebol Dictionary as Clipbook Library Re:
From: [EMAIL PROTECTED] For those that aren't familiar with "Notetab" you should go visit www.notetab.com. No I wasn't familiar with it. It is an absolutely brilliant program. Thanks for the reference! You can edit your rebol scripts in "Notetab" and view the dictionary file without loading your browser. Great! Brett.
[REBOL] 'dynamic append' Re:
Hi Hendrik-Jan, You're almost there - here is a simple solution. append/only test rejoin ["block1_"A ": copy []"] do last test test: [] a: 12 append/only test rejoin ["block1_"A ": copy []"] last-block: do last test append last-block "whatever you want" so now try: block1_12 == ["whatever you want"] Brett Handley
[REBOL] context exploration Re:
I really like your function Thomas. Very good! Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 24, 2000 1:03 PM Subject: [REBOL] context exploration Hello, While playing with contexts, I threw together this little function to show the words that are defined in a context (and their values in that context). (something like that have been discussed before AFAIR, but a 1min. search didn't find it, sooo :-) It goes like this: show-context: func [word [word!]] [ foreach x-word next first system/words [ if value? bind x-word :word [ print [:x-word "|" get bind x-word :word] ] ] ] Attached is a script that demonstrates the use of the function with contexts created with func, use and make object! Best regards Thomas Jensen
[REBOL] Rebol Dictionary as Clipbook Library Re:(4)
I'm not aware of any Rebol work on this line, but I would think you could get something going pretty quickly given the example Rebol parsing scripts in the library. Brett. For example, here's a variant of parse-code.r which I've called explain-code.r It won't solve the "javadoc" feature but it might be helpful. I wrote it to help me understand "Carl's conundrum" ( [REBOL] REBOL SCOPING / CONTEXT EXPLANATIONS Re:(2)). In the end it didn't help but it was a good excerise. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 22, 2000 9:15 AM Subject: [REBOL] Rebol Dictionary as Clipbook Library Re:(3) Is any work being down on a "reboldoc" format or parser -- along the lines of the javadoc utility http://java.sun.com/products/jdk/javadoc/ -- that extracts comments and presents them as a standard HTML file? explain-code.r
[REBOL] REBOL SCOPING / CONTEXT EXPLANATIONS Re:(3)
Echos of Yoda. :) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 20, 2000 9:15 PM Subject: [REBOL] REBOL SCOPING / CONTEXT EXPLANATIONS Re:(2) Basically, let go of your normal understanding of programming, and approach Rebol with no mind. Don't try to analyse it, just 'do it. :-) Andrew Martin Zen Rebol... ICQ: 26227169 http://members.xoom.com/AndrewMartin/ --
[REBOL] REBOL's scoping rules Re:(3)
With respect to So now, I don't tend to think of global variables as just that. Instead I know I can create symbols in a global context, and I can also set symbols in a specific context. And I can write Rebol descriptions that will work on both depending on context! can you perhaps construct the simplest example that illustrates your point ? Um.. yeah that particular ramble lacked some context :) I was referring to the interpretation of something being different in different contexts. While it's not automatic, the language facilitates it. Anyway here's an example. REBOL [ Author: "Brett Handley" Purpose: {An example of how one description can be interpreted differently according to context.} ] cat-description: ["The cat is" cat] ; A symbol in the global context. cat: "Feline" example-specific-context: make object! [ cat: "Tiddles" work-in-context: func[][ ; Make the words of cat-description have this ; context's specific meaning - is permanent. bind cat-description 'self print cat-description ] ] print cat-description example-specific-context/work-in-context
[REBOL] simple foreach question Re:(3)
More likely you meant this... I've seen farm: [ "bob""cecil" "bill" "chris" "barry" "curtis" ] foreach [pig chicken] farm [print reduce [pig chicken]] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 19, 2000 10:45 PM Subject: [REBOL] simple foreach question Re:(2) The nice thing about foreach is that you can also parse your block into more than than one word (variable): farm: [[pigs] [chickens]] foreach [pig chicken] farm [print [pig chicken]] Boss is going to please with you aint 'e? "page" is being defined by the foreach. So for each element in the block "pages" foreach will set the word page to the value of that element - it then does the body block with that value. You can use whatever you want: foreach qwrtyuiop ["one" "two" "three"] [print qwrtyuiop] Note that qwrtyuiop only has a value in the body block. see: help foreach USAGE: FOREACH 'word data body DESCRIPTION: Evaluates a block for each value(s) in a series. FOREACH is a native value. ARGUMENTS: word -- Word or block of words to set each time (will be local) (Type: get-wor d word block) data -- The series to traverse (Type: series) body -- Block to evaluate each time (Type: block) Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 19, 2000 4:26 AM Subject: [REBOL] simple foreach question howdy guys, I'm on a roll, just trying to "get" simple things. for instance, in the exapmle, pages: [ http://www.cnet.com http://www.rebol.com/index.html http://www.news-wire.com/news/today.html ] loop 24 [ foreach page pages [send [EMAIL PROTECTED] read page] wait 1:00 ] where did "page" come from? is it arbitrary? if the block was of species of pigs, would it be "foreach pig pigs? just curious. Let me know if I get annoying. -- Eat more spinach. -tom -- [EMAIL PROTECTED] http://perso.worldonline.fr/mutant
[REBOL] Bug in 'use? Re:(4)
I would have expected [3 2 1] not [1 1 1] nor [3 3 3]. But I find it difficult to answer what I want, because the function argument x seems like it's in a bit of a no-mans land (I'm thinking of :x ) My brain hurts now. :) Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 19, 2000 5:03 PM Subject: [REBOL] Bug in 'use? Re:(3) Hi, Hi Ladislav, 15-Jul-2000 you wrote: you are right, the problem is caused by a context manipulation - Use unsets your Middle every time it gets executed. My suggestion is to not use Use in recursive functions, while this problem doesn't get corrected. Judging from the nature of recursiveness, that's a little hard, isn't it? ;-) Do you know if this problem has already been reported to feedback? Kind regards, -- Ole Friis [EMAIL PROTECTED] Amiga is a trademark of Amiga Inc. You should probably report it to feedback. BTW, did you succeed to sort the permutations correctly? One more question for everybody. What do you want to see after executing: blk: copy [] probeblk: func [] [ prin mold blk prin ": " print mold reduce blk ] recfun: func [x] [ append blk 'x either x = 1 [ probeblk ] [ recfun x - 1 ] ] recfun 3 probeblk Regards Ladislav
[REBOL] REBOL's scoping rules Re:
Judging by previous message on the list, this question will bring a variety of responses! Re "global variables". Coming from a compiled-language background, it was hard for me to learn about the immediate nature of the message I send to Rebol. More important, I had to get out of my old ideas of thinking of variables and instead treat words as symbolising something else. A subtle but profound difference. One has you thinking like "I have this little box with a value in it. Now I must remember the various allowable ways to get my value in and out of the box". The other way leads to thinking like "I will refer to this thing here using the name x. So now, let's intrepret x as a email". This relates directly to context-sensitivity. The words-as-symbols idea means that you can have a description of something that will take on different values in different contexts. For example, applying a function to different rebol objects. If you are from an OOP school you may be of the opinion that this should be done through an object interface - but I believe that this an actually an paradigm that Rebol allows for, without mandating. It comes down to how you want to describe it. A benefit of this approach is that it is providing a lower barrier of entry for non-programmers. That is, when starting out with Rebol a person may not even think of such things as scope and contexts (way too abstract) - they are perhaps, in their mind, using one context, perhaps like in a simple conversation with someone else. So now, I don't tend to think of global variables as just that. Instead I know I can create symbols in a global context, and I can also set symbols in a specific context. And I can write Rebol descriptions that will work on both depending on context! Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 19, 2000 11:49 AM Subject: [REBOL] REBOL's scoping rules I've been wondering what the reasoning behind REBOL's scoping rules was for awhile. In C, for instance, any variable that you declare in a function is "automatic" (that's what C calls them anyway :). They're automatically local to the function they're defined in, etc. Why does REBOL have variables be globally scoped by default? I ran into this a few days ago when I asked the list for assistance, and people helpfully replied (thank you). One of the things people pointed out was that I wasn't being careful with my recursion and kept using the same global variable over and over again. Perl takes a similar approach, where everything is global unless you declare the variable 'local' or 'my', but I always assumed that this was just because of Perl's heritage as a "throw away" script language, in which cases you really don't have to worry about scoping so much. PHP takes a completely opposite approach. Any variable you declare is local to a function, and you can't even get at global variables unless you explicitly get the variable through the $GLOBALS associative array, or declare a variable 'global' in your function. Anyway, I'd really like to understand why REBOL works the way it does in this respect, so if anyone has any insight to give I'd love to receive it. Thanks so much. Keith
[REBOL] where are all the components? Re:(2)
I loved reading the two post from Jake and Garold. They express things I've been musing over for years. My own, coupla bits: With any description there is an irreducible amount of information that has to be encoded. Whether this has been done as an interface or as a monolithic program or system. The great thing that Rebol has done is to give the "Reboler" (programmer/user) power in expressing and interpreting this minimum of information. Maybe we call this stuff a dialect - a better language to communicate in. This then is how I understand RT description of Rebol being a messaging language - an' boy don' it do that well. So from this great ideas flow. One day I had an idea - may not be original but hey my brain produced it - one day I'll try it too. I thought well Rebol is so cool at languages I can buy me a voice interpreter and use it to chuck some dialectical words at Rebol and think of the possibilites. Now how does it work on Voyager? "Computer.." "Bip beep" Another. I've found that I'm wanting to write input-parsers for Rebol that take information out of existing format and place it in Rebol blocks where I suspect I'll be able describe all sort of wonderful transformations before forming into other formats again. One example. I got my tab-delimited-with-quoted-strings parser thingy happening. Now if get my Flash SWF input/output thingy happening I'll be able to combine the result and produce a Flash spreadsheet! Cool eh? Well, ok not cool. Probably dum. BUT I would have NEVER DREAMED of doing that before. Thats the point I think. Components. In my Rebolised mind now, a component is an interpreter with associated context. Thus, this component can be in my Rebol script, sitting in Java, sitting in Javascript in a browser, sitting on in another process on my machine, on another machine behind a port or maybe one day be part of a Rebol-OS accessible from the OS prompt. This isn't new this is what is today. Rebol has accepted it and provided another way to talk between them. I think components arrived when system theory game them birth - just maybe no-one celebrated at the time because they could'nt work out they were. They're here to stay because we have a wired and distributed world to talk to, but maybe not existing in the form the designers of COM and CORBA thought they might. End-of-trip. Boy that coffee was strong. Brett.
[REBOL] where are all the components? Re:(2)
"Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS." That hilarious! But mostly true! A name to my discontent, "distressing". I knew there was a reason I've been playing (=fun) with Rebol instead of working (=discipline) through Java for the last three months. Java is here to stay, it is a great 3GL+ (+ = objects). It is a pity it didn't come out a decade earlier - would've made my life easier. On second thought, probably not, nothin new under the sun Brett.
[REBOL] Find cant find reference to block. Re:(6)
Yes!! That is exactly the result I was looking for. Thank you for your efforts Ladislav. Pity it is a sequential search. Now I wonder if RT could incorporate this functionality so that it works with hashes...? :) Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 16, 2000 5:46 PM Subject: [REBOL] Find cant find reference to block. Re:(5) Hi, From: [EMAIL PROTECTED] probe find/only reverse_lookup :e ; The answer: [[] "a" ["added to the series"] "b" [] "c"] == [[] "a" ["added to the series"] "b" [] "c"] Thanks, but no - I tried that too. I wanted this to return [[] "c"] since that was what "e" was referring to. So, you needed a function sfind? sfind: func [ {finds the same value as a given one in a given series} series [series!] value [any-type!] ] [ while [not tail? :series] [ if same? first :series get/any 'value [ return :series ] series: next :series ] none ] probe sfind reverse_lookup :e ; The answer: [[] "c"] == [[] "c"] Regards Ladislav
[REBOL] Find cant find reference to block. Re:(3)
Thankyou Gabriele, That by itself is useful to know. But, it still is different to what I was asking. My code was attempting to find an empty block. But not just any empty block it was a particular empty block. But find doesn't distinguish between particular empty blocks they look the same! Which I guess is reasonable. Yet I can store multiple different empty blocks inside another block such that they behave as references to blocks. Which is really handy. For example I used this to create bookmarks in some HTML I was creating. E.g my-html: [ html body h1 ] append/only my-html my-bookmark: copy [] append my-html [/h1 /body /html] append my-bookmark "How to fill in after the fact with Rebol blocks" print my-html But I just can't use find to find those references my-html: [ html body h1 ] append/only my-html my-bookmark-1: copy [] append my-html [/h1] append/only my-html my-bookmark-2: copy [] append my-html [/body /html] What is the index position of the block referred to by my-bookmark-2 in my-html? index? find/only my-html my-bookmark-2 == 4 Nope it got it wrong, the answer I wanted was 6. But if I now do this append my-bookmark-2 "Fill in the body" and try the same question - it gets it right index? find/only my-html my-bookmark-2 == 6 Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 15, 2000 10:55 PM Subject: [REBOL] Re: Find cant find reference to block. Re: Hello [EMAIL PROTECTED]! On 14-Lug-00, you wrote: G find list select list 'a ; no good find can't find the G reference to the G block Hope this clears things up: find [a b c d e f g e g f h i j] [e g f] == [e g f h i j] find/only [a b c d e f g e g f h i j] [e g f] == none find/only [[a] [b]] [a] == [[a] [b]] find/only [[a] [b]] [b] == [[b]] So: blk: [a ["a"] b ["b"]] == [a ["a"] b ["b"]] select blk 'a == ["a"] find/only blk select blk 'a == [["a"] b ["b"]] But notice that that is the same as: next find blk 'a == [["a"] b ["b"]] which does one search only. Regards, Gabriele. -- Gabriele Santilli [EMAIL PROTECTED] - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
[REBOL] Find cant find reference to block. Re:(4)
From: [EMAIL PROTECTED] probe find/only reverse_lookup :e ; The answer: [[] "a" ["added to the series"] "b" [] "c"] == [[] "a" ["added to the series"] "b" [] "c"] Thanks, but no - I tried that too. I wanted this to return [[] "c"] since that was what "e" was referring to.
[REBOL] Find cant find reference to block.
Is this right? Just wondering. list: [] append list reduce ['a copy ["a"]] append list reduce ['b copy ["b"]] append select list 'a "a-test" ; OK probe list find list select list 'a ; no good find can't find the reference to the block Brett.
[REBOL] CGI and XML Re:(4)
The very nature of CGI dictates that anything that is to be printed to the output stream of the program is sent to your browser. The job of the webserver is the make sure this happens for any cgi-program that requested. example: a: probe make lit-word! "b" 'b == 'b 'b will be shown in my browser, So in you example you have used the word "probe" which actually is a "print" to your current output stream. Type "?? probe" at the console prompt. So the short answer, if you don't want it in your browser don't use print or probe, etc. If you need to debug an installed cgi-program, then write your debug information to a file and look at that later, or send your debug info to the browser with markup so it looks pretty :) Or, if you are doing all your testing on your own Rebol based webserver on your own machine, define a word in the webserver that will allow access to the normal console output port. So that as the cgi script runs it will output to the normal console for the webserver. But, it's a bit beyond me at the moment to do this. Brett.
[REBOL] Function and variable scope Re:
You could use the /local refinement like this: list-dirs: func [ "returns dir tree as block" dir [file!] "root dir" /local dirtree ; A change here ] [ dirtree: make block! 100 foreach name read dir [ if dir? dir/:name [ append dirtree dir/:name list-dirs dir/:name ] ] dirtree ] Or you could the other way to define a function like this: list-dirs: function [; A change here "returns dir tree as block" dir [file!] "root dir" ][dirtree] ; A change here - this block specifies the locals [ dirtree: make block! 100 foreach name read dir [ if dir? dir/:name [ append dirtree dir/:name list-dirs dir/:name ] ] dirtree ] Brett.
[REBOL] adding data to hyperlinks, etc. Re:
The next feature I want to add is a commenting system. I want the reader to be able to click on a hyperlink for "comments" which will then execute a .cgi script. The .cgi script will then render a page including all of the comments people have posted in regards to the news article in question. The question I have is, how do I pass a value to a script from a hyperlink so that the script renders the correct set of comments? Encode you hyperlink like this. http://cgi.zipworld.com.au/~bhandley/cgidump.r?your-id=123456789 Which would be the same as if a HTML form was submitted with an input element of "your-id" that value 123456789. I have thought of another option, albeit more cumbersome. During the time the main script creates object expressions for the news articles themselves, the script could create a separate .cgi script just for that article. Probably overkill. But how can I write a script to a directory and then make the script executable all at the same time? I'm thinking the web server will see the .cgi extension and assign it executable status, but I'm not sure that is always the case. I'm little curious about this myself. Hope this was what you wanted. Brett.
[REBOL] adding data to hyperlinks, etc. - RE-SENT
Don't know why this went missing. So here it is again. - Original Message - From: "Brett Handley" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 09, 2000 11:44 AM Subject: Re: [REBOL] adding data to hyperlinks, etc. The next feature I want to add is a commenting system. I want the reader to be able to click on a hyperlink for "comments" which will then execute a .cgi script. The .cgi script will then render a page including all of the comments people have posted in regards to the news article in question. The question I have is, how do I pass a value to a script from a hyperlink so that the script renders the correct set of comments? Encode you hyperlink like this. http://cgi.zipworld.com.au/~bhandley/cgidump.r?your-id=123456789 Which would be the same as if a HTML form was submitted with an input element of "your-id" that value 123456789. I have thought of another option, albeit more cumbersome. During the time the main script creates object expressions for the news articles themselves, the script could create a separate .cgi script just for that article. Probably overkill. But how can I write a script to a directory and then make the script executable all at the same time? I'm thinking the web server will see the .cgi extension and assign it executable status, but I'm not sure that is always the case. I'm little curious about this myself. Hope this was what you wanted. Brett.
[REBOL] func[func] Re:(7)
Jeff and Brian, you guys are terrific help, and I really appreciate it. Hopefully some of the other people on the list have the same questions as me and are benefitting from your wisdom, too. Most definitely. I've got this leetle folder where I'm squirreling away these important tidbits. Brett.
[REBOL] Where's the docs for user-defined-dialects? Re:(2)
I totally agree that there is a miserable lack of dialect creation examples or tutorials. In fact, I would dare say I have only seen a small handful of dialect examples. Maybe because not many of us are used to creating our own grammars or protocols (yet). Prior to Rebol, these things seemed like way too much work. For me, I've been modelling for years, but thinking of modelling in terms of a grammar is a real brain strain at the moment. However, I feel it will ultimately be far more versatile and powerful to work with a dialect than my clunky old ER diagrams. However, the "html dialect" is a good example to study. Another would be the simple but powerful example given by Carl in July's DDJ. Brett.
[REBOL] NETSCAPE vs EXPLORER... CGI problem solved! Re:
Okay, the problem was simple (as most are when you get right down to it). Explorer automatically converts spaces into an %20 character (escapes them) whereas Netscape doesn't and is, thus, confused when it gets some CGI data with spaces in it. Eesh. There are other ways to solve this (in my humble opinion) deficiency in at least early Netscape (4.03 is the latest I have or wantg, I just use it to make sure stuff works in both flavor browsers). One way is the following little REBOL function: cgi-escape: func [cgi][ parse cgi [some [to " " (find replace cgi " " "%20")] to end] ] That got my order forms working, but I still need to handle other characters such as ''. I going to have to handle special HTML chars soon. I was hoping there was a Rebol function to do this straight off. That is encode/decode HTML special chars. I've not used it, but as it happens I came across it yesterday while reading my little Javascript pocket reference. Javascript has a "escape" function to which the book documents it as "Encode a strnig for transmission. Javascript 1.0; ECMA-262; Unicode support in Internet Explorer 4." Also there is "unescape(s)" Which decodes an escaped string. Thought I'd pass it on, in case it became of interest to you. Though I'd use the Rebol approach too since it seems like it would be more reliable. Ah, the adventure of it all. --Ralph Roberts Indeed. Brett.
[REBOL] An experiment with RTF Re:(2)
Thats a point. Unfortunately I don't have it (the latest version), but my sister does. I'll get her to send me something. Thanks. Word can also export as XML which you could parse much easier with Rebol. :) Deryk
[REBOL] Does rebol --do print 123 for e.g. work for ya? Re:
Um, yup. Win NT4 REBOL/Core 2.3.0.3.1 REBOL/View 0.9.9.3.1 Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 06, 2000 10:04 PM Subject: [REBOL] Does rebol --do "print 123" for e.g. work for ya? Hi, I am just curious if running rebol with command line parameters work for you? I get following error: rebol --do "print 123" ** Script Error: print is missing its value argument. ** Where: print ** Press enter to quit... Thanks, -pekr-
[REBOL] Fun with literals (was Parser seems to have bug...) Re:
Hi Brian. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 03, 2000 8:35 AM Subject: [REBOL] Fun with literals (was Parser seems to have bug...) Hi Brett! While you're reassembling, think of the advantages that this trick can give you. This kind of assignment can be useful for implementing what the C world calls static local variables. You can set a word to a literal string value, then append to that string to create a string accumulator. This allows you to build a string incrementally. Yep, can certainly vouch for that. :) You can set a word to a literal block and store values in it. This allows you to use a function like a Scheme closure, a function with values bundled in it, like OOP in reverse. This technique allows OOP-like programming with better control of your data because it is hidden inside the function. Look at http://www.bigfoot.com/~brian.hawley/rebol/require.r for an example of how this technique can make for bulletproof code. Gunna need a little time with this one... The most fun with this technique comes when you use compose to create your code blocks. For example, consider this: f: func [key] [ table: make hash! [a "a" b "b"] table/:key ] Trivial, true, but imagine that pattern with a much larger hash table, or a large binary value, or a dozen charsets for a parse process. You can't directly represent those values as literals - they get recreated every time. Do that in a function and the function gets really slow. But do this: f: func [key] compose [ table: (make hash! [a "a" b "b"]) table/:key ] and the hash table is only created once, right before the function is created. All calls to f then reference the now literal hash table, making for a very fast, memory efficient function. This really helps with my "mind reassembling". I won't look at my functions the same way again... I also didn't realise that one could use path access on the hash like that. I'd being using SELECT before. If you can use literal hash tables in a function, you can do one of the coolest tricks from the functional-language world, memoization. When you memoize a function, it remembers the results of the calls to the function, so that later calls of that value don't have to recalculate the result. You can even do this from the outside with a separate function, although REBOL's flexible args make the general case of that rather tricky (I'll work on it). Here's a one-arg memoize function: memoize: func ["One-arg memoize, kinda weak :(" 'f [word!]] [ set f func [x /local f saved res] compose [ f: (get f) saved: (make hash! []) either res: select saved :x [first res] [ res: f x append saved reduce [:x reduce [res]] res ] ] ] I know, it looks awkward, but this can speed up functions that have to go through even worse trouble to calculate their values in the first place. It also helps with those that use deep self-recursion to calculate their values, as REBOL's stack space is quite limited. I couldn't get the memoize to work. But I can see what you are doing and that is quite a gem. Fun stuff? Very. Thanks very much for making those points. I'm gradually training myself into a better understanding of Rebol rather than automatically assuming I know what is happening based on other language experience. Brett.
[REBOL] to-path curio
I was attempting to create a filename like "anz-visa-statement [30-may-2000 27-jun-2000].r" using the to-path. What I found was: to-path "astring[anotherstring]" == astring/[anotherstring] to-path "astring anotherstring" == astring/anotherstring and mysteriously (to me) to-path "astring anotherstring]" ** Syntax Error: Missing [ at end-of-block. ** Where: (line 1) astring anotherstring] also somewhat unexpectedly to-path #1-3-4 == 1-Mar-2004 I obviously have a limited understanding of paths. Can someone educate me in the ways of the path please? Or is this all there is to say about it? I did manage to get something like my desired filename using print rejoin [%anz-visa-statement to-path {[30-may-2000 27-jun-2000] } %.r] anz-visa-statement[30-May-2000 27-Jun-2000].r It just misses a space. And finally print replace %anz-visa-statement--.r "--" { [30-May-2000 27-Jun-2000]} anz-visa-statement [30-May-2000 27-Jun-2000].r Success. Last question: Are such filenames legal on other OSs (other than Windows)? Brett.
[REBOL] Parser seems to have bug - different results on multiple calls.
Howdy, I've been having trouble with strange results in the parser. Rebol seems to cache the parse rules, which seems like a good idea, but I've found something unexpected. If you copy the code below and paste it (Win or call script in Linux) into your Rebol session you can see how the three calls to parse will change results even though it is the same rule and data. If in the same session you repeat the process you will get the same results again - that is, the first line is right again! Have I done something wrong? BTW, Wouldn't it be nice if there was a parse /explain that would show the "plan" or description of the state machine that will be used for parsing, or whatever is used. I'm always getting confused on the parse syntax. Having this would make it easier for me anyway! Appears in REBOL/View 0.9.9.3.1 1-Jun-2000 REBOL/Core 2.3.0.3.1 on Windows NT 4 SP 4 Brett Handley ; Here starts the code only-string: func[ s [any-string! none!] ][ either s [s][{}]] quoted-data-rule: [ (cell-data: {} Print "Setting the cell-data value") ; This seems to get ignored on subsequent calls of parse. {"} copy data to {"} {"} (append cell-data only-string data) any [ {"} copy data to {"} {"} (append cell-data rejoin [{"} only-string data]) ] ] parse/all {"""."} quoted-data-rule ; This looks ok. print cell-data ; parse/all {"""Hrmm."} quoted-data-rule ; This is not right. print cell-data ; parse/all {"""oi!"} quoted-data-rule ; Bugger. print cell-data ;
[REBOL] Webcam URL Re:
Hm. The benefit of night time is the reflection, in the window, of the room the camera is in. It looks empty! No chairs nothin! Hm Implications.. Implications.. Ah - truely virtual. ;) Brett.
[REBOL] Parser seems to have bug - different results on multiple calls. Re:
How embarassing. Sent the wrong code. Here is the actual problem code. only-string: func[ s [any-string! none!] ][ either s [s][{}]] quoted-data-rule: [ (cell-data: {} print "--init-line--") ; This seems to be ignored on subsequent calls of parse. {"} copy data to {"} {"} (append cell-data only-string data) any [ {"} copy data to {"} {"} (append cell-data rejoin [{"} only-string data]) ] ] parse/all {"""Mutter."} quoted-data-rule ; This looks ok. print cell-data ; parse/all {"""Mutter."} quoted-data-rule ; This is not right. print cell-data ; parse/all {"""Mutter."} quoted-data-rule ; Bugger. print cell-data ;
[REBOL] Parser seems to have bug - different results on multiple calls. Re:(5)
The colon ":" is the set-word operator, which is literally: set the word to the left to point to the right. Which is not quite assignment in conventional languages. I hope that helps! I think it will.hopefully. :\ Thanks. Brett.
[REBOL] Parser seems to have bug - different results on multiple calls. Re:(5)
picks jaw off ground/ Thanks Ingo, I'll just have to go away and reassemble some brain patterns... Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 02, 2000 12:48 AM Subject: [REBOL] Parser seems to have bug - different results on multiple calls. Re:(4) Hi Brett, maybe this little func 'll show you what's happening ... test: func [] [ s1: "" s2: copy "" append s1 "Hi, I'm changed" append s2 "I'm not ..." source test ] test test: func [][ s1: "Hi, I'm changed" s2: copy "" append s1 "Hi, I'm changed" append s2 "I'm not ..." source test ] You see, s1 has literally been changed in the source-code, s2 has not. (It's one of the Rebol traps everyone has to fall into once.) I hope this helps Ingo Once upon a time [EMAIL PROTECTED] spoketh thus: Thanks Allen. That certainly does work. But, now I'm confused. Why is that different to what I had? Or, why didn't I get a new empty string each call previously? Brett. -- _ ._ ingo@)|_ /| _| _ We ARE all ONE www._|_o _ _ ._ _ www./_|_) |o(_|(/_ We ARE all FREE ingo@| |(_|o(_)| (_| ._| ._|
[REBOL] Parser seems to have bug - different results on multiple calls. Re:(5)
Some time back. Brian Hawley referred to a discussion on Contexts. Which at first I could not find. However spurred on by my misunderstanding of what Rebol is doing, I made a renewed attempt to find the discussion and was successful. See the thread "Contexts, and related ideas" in... http://www.rebol.org/userlist/html/threads-21.html Brett.
[REBOL] A tool for tags.
I thought a function that would be the complement to build-tag was in order. So here's my attempt. Comments appreciated. Suggestions on improvements welcomed. Now where did that bed get to Oh, anyone thought up a dom (or just structured) approach to HTML in rebol yet? Brett. REBOL [ Author: "Brett Handley" Title: "Parse-tag" Date: 30-June-2000 Note: {Feeds off xml-language for some code. I didn't know if there was an easier way to do this - and without clutter of a object cloning. Probably better just copying and pasting but I thought I'd highlight the commonalities.} Note2: {I'd be more happy if this sort of (or better) functionality was part of the package. :) } ] unset [tag-language-defn tag-language] tag-language-defn: [ unquoted-data: complement charset reduce [ " " tab ] tag-rule: [(tag-name: none) copy tag-name name (append result to-word tag-name) any [sp attribute] sp?] attribute: [copy attr-name name (append result to-word attr-name) opt [eq attr-value (append result attr-data)]] parse-tag: func[ a-tag [tag!] ] [ result: make block! 1 parse/all/case a-tag tag-rule result ] ] foreach field [ space name-first name-chars data-chars qt1 qt2 data-chars-qt1 data-chars-qt2 name sp sp? eq attr-value ][ append tag-language-defn reduce [to-set-word :field copy get in xml-language :field ] ] ; Add rule for handling unquoted attribute data append tag-language-defn [ append attr-value '| append/only attr-value [ copy attr-data some unquoted-data ] ] tag-language: make object! tag-language-defn parse-tag: func[ t [tag!] ] [ tag-language/parse-tag t ] ; Examples ; ;Use it like so... ;parse-tag a href="http://" ; ;Grab an attribute value ;select parse-tag a href=http://localhost/ id="a1" 'id ; ;or maybe... ;html: load/markup http://www.rebol.com ;foreach e html [ ;either tag? e [ ;if select parse-tag e 'src [print select parse-tag e 'alt] ;][ false ] ;] ; ;This one might be handy for tidying up those nasty unquoted values... ;build-tag parse-tag input type=radio name='theAnimal' value="cat" CHECKED ; ;parse-tag /a; returns empty block - don't know if this is the best or not.
[REBOL] Calling all Brisbane Rebols Re:(2)
Or Sydney! :) Seriously though, great idea Allen. Once you work out a time, please post it again, just in case out-of-towners "meander" by. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 30, 2000 11:40 AM Subject: [REBOL] Calling all Brisbane Rebols Re: Allen, Care to broadcast to Albany too? lol Deryk - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 30, 2000 8:59 AM Subject: [REBOL] Calling all Brisbane Rebols Hi Rebols, I know there are few people from Brisbane on this list. I am thinking about organising/running a free Rebol/View workshop sometime in late July or August. Numbers will determine the venue. If you are interested in attending please contact me directly by email or phone Cheers, Allen K [EMAIL PROTECTED] ph 3366 8093 mob 0402 246664
[REBOL] REBOL/Core 2.3 Released! Re:
REBOL/Core is available for download at http://www.rebol.com/downloads.html and No it aint. I cannot find it listed. So I don't know how you other guys got it! Brett.
[REBOL] REBOL/Core 2.3 Released! Re:(3)
Thanks for that. I was thrown by the "version" column of the platform page which lists it at 2.2. Should have just tried it Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 29, 2000 11:01 AM Subject: [REBOL] REBOL/Core 2.3 Released! Re:(2) brett, after you complete the form and agreement (if you wish to), the script will take you to platforms.html where you'll find the 2.3 versions available. Let me know if you have any further problems. dan At 10:46 AM 6/29/00 +1000, you wrote: REBOL/Core is available for download at http://www.rebol.com/downloads.html and No it aint. I cannot find it listed. So I don't know how you other guys got it! Brett.
[REBOL] (NT) View home Re:
Methinks that there is unfortunately a dependence on the registry. I forgot to send feedback about this, but when I first installed View I had a similar (same?) problem. All in all I think you would be better off uninstalling and reinstalling view. Which is what I did, and it works. Since there is not uninstall feature (yet, I guess), you should delete the directories (backup whatever you want to keep of course) and use the registry editor to remove the registry key from NT's registry (insert disclaimer here re dangers of editing the registry, loss of data... losss of sanity... panic, pandemonium, gnashing of teeth, and maybe a couple of tears). Then reinstall, letting the install process create the directories for you. Then put back any scripts that you had saved. Hope it helps. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 24, 2000 2:02 AM Subject: [REBOL] (NT) View home How does View determine it's home? I see where it reads home, but where does the actual value come from? I have it installed in E:\Program Files\_Rebol\View and when I try to check for updates, it tells me there's a problem and I should set up the Network stuff. When I try to do that, it asks for permissions to write E:\Program Files\Rebol\View\user.r, which of course doesn't exists. If I try to rename _Rebol to Rebol, I get a permission denied message. Wha? -- Pete Wason|"LWATPLOTG"|[EMAIL PROTECTED]|[EMAIL PROTECTED]|CUCUG|TA|PHX
[REBOL] for loop block Re:
USAGE: PRINT value DESCRIPTION: Outputs a value followed by a line break. PRINT is a native value. ARGUMENTS: value -- The value to print (Type: any) The second case works because you have used a block as value. Think of a Rebol block as a data structure. Brett. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 22, 2000 9:48 AM Subject: [REBOL] for loop block for k 1 22 2 [print "Count is " k] Count is Count is Count is Count is Count is Count is Count is Count is Count is Count is Count is == 21 BUT for k 1 22 2 [print ["Count is " k]] Count is 1 Count is 3 Count is 5 Count is 7 Count is 9 Count is 11 Count is 13 Count is 15 Count is 17 Count is 19 Count is 21 Should not both be equivalent? Why would the first form ignore the brackets? Also for k 1 22 2 [[print "Count is "] k] == 21 Say what? A Rebol "Block" is not like { } in C? --- Harry Parshall Jr. [EMAIL PROTECTED]
[REBOL] Resume getting a web page? Re:(5)
Hi ddaley It might be that the server or a proxy server between you and the page is returning an incomplete page. My bet would be a proxy server that is too stupid to realise it doesn't have the complete resource. Is there any way for me to find out if a server is at fault? Given that Galt retrieved the page with no problem, sounds like it may be between you and the server. So, I think that Allen's suggestion of the proxy problem is worth trying. If you using IE as browser try holding ctrlshift and clicking Refresh. From memory I believe this sends a request to the proxy for the latest page. In netscape, I can't remember accurately but I think it may be ctrl and click reload. May as well try shift reload as well, and why not clickshift reload just be sure? :) Hope it helps. Brett.
[REBOL] Hidden object values? Re:
Here's some stuff you might not know about objects: o: make object! [ [ A: 1 [ B: 2 [ C: 3 [ ] first o == [self A B C] second o == [ make object! [ A: 1 B: 2 C: 3 ] 1 2 3] By using 'first and 'second, you can access parts of the object. Can I rely on this not changing? Is this a stable part of rebol?
[REBOL] Andrew, you beast! - GC too tidy? Re:(6)
The most detailed documentation for REBOL direct binding and contexts that I've seen is an argument on the subject that Gabriele and I had on this mailing list last fall. It is probably in the mailing list archives at rebol.org with the subject Contexts. If not, tell me and I'll try to bundle them and send them to you. Brian I would be interested in these as I have not been able to find the messages your referred to. Brett Handley.
[REBOL] Tool for those of us in the southern-hemisphere.
Hi fellow southerners, Ever had that annonying little hassle of trying to decode what those folks on the northern hemisphere mean when they say "fall" or winter? Well I've done this neat little tool that will tell you what they mean. Check out the attachment ! :) Brett Handley [EMAIL PROTECTED] PS. Shiver Cold at the moment eh? nh-seasons.r
[REBOL] How and when is bind useful?
It takes me awhile sometimes... But can someone give me an example of how bind is useful please? Thanks. Brett.
[REBOL] How and when is bind useful? Re:(2)
Thanks Andrew. On the second read. I realised it is exactly what I need my current programming excerise: a dialect for a specific device control app. Thanks Petr. Your example looks so devilishly clever I think I'll go to be and read it in the moring. :) Brett.
[REBOL] Andrew, you beast! - GC too tidy? Re:
Nicely described Galt :) I suppose it means you can bind a block to another block or word and it will share the context of that other block. I wonder what would happen if you unset O at this point. Could you still run Dialect and have it bind and reduce another block to what O was bound to? Tried it, yup it will and it won't work. It will for a bit until the garbage collector takes away O. Try Create O as in the example. Dialect [f1 f2] ; --Ok Unset 'O ; -- oh oh , could be trouble coming Dialect [f1 f2] ; --Still worksPhew. Recycle; Dialect [f1 f2] ; * Crash * -- Looks like the GC was a bit enthusiastic.
[REBOL] How and when is bind useful? Re:(2)
what-not: [ empty? trim/all copy line found? find trim/all copy line "WEIGHTNAMEOFPRODUCT" found? find radek "===" (to-char first radek) = (to-char 12) ] foreach line file [if not any bind what-not 'line [insert tail result line]] Thanks Pekr. I didn't realise that when binding a block only the words in the block that can be found in the context will be bound. Brett.
[REBOL] PAM links Re:(2)
The links in your message? Oh well. Must be my end. I get 404 - not found message. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 14, 2000 7:41 PM Subject: [REBOL] PAM links Re: [EMAIL PROTECTED] wrote: Hi deryk, The links do not work. Brett. Brett, I tested both links from a couple of my offshore shell accounts and they worked just fine. Regards, Deryk
[REBOL] parsing questions - newbie Re:(2)
Hi Keith, well i've looked at the parse section and can't quite figure it out... how do you nominate that you want the parse function to take place on a text file say "aeros.txt" rather than a string? The parse function works on a string or on a block. If you want to parse a file read the file into a string like this file-as-string: read %aeros.txt or maybe (on windows) file-as-string: read %/c/autoexec.bat If you want to parse a web based page you can do this web-page-as-string: read http://www.abc.net.au/news Then you can parse file-as-string parse-rules or parse web-page-as-string parse-rules etc.. and how do you specify it's location? Refer to the user manual for the word READ and for accessing files. and how would you strip off just what's after the colon and discard what is before the colon? your-string: "FORM: Popular Recording" parse your-string [ SKIP THRU ":" COPY text [ TO newline | TO END ] (print text) ] when you parse files, can it be done on a folder of files? i have a stack of html files that i need to extract all text in a particular section and then change the table cells to tabs etc but i have a few to do and would like to run the script over the whole lot at once if possible. Use a loop. See the manual on looping. i can see no reference to how you parse files locally..there are only examples of web addresses or specifying a string. The input data to parse must be a series! type. This series! can be either a string! or a block!. So if you can make your data into a string or a block you can use parse. thanks for your help No Prob. Brett.