[REBOL] [REBOL] Reading text a line at a time Re:
Hi Tim, >> help read Reads from a file, url, or port-spec (block or object). Arguments: source -- (file url object block) Refinements: /binary -- Preserves contents exactly. /string -- Translates all line terminators. /direct -- Opens the port without buffering. /wait -- Waits for data. /lines -- Handles data as lines. /part -- Reads a specified amount of data. size -- (number) /with -- Specifies alternate line termination. end-of-line -- (char string) /mode -- Block of above refinements. args -- (block) /custom -- Allows special refinements. params -- (block) ===> /lines -- Handles data as lines. AHA. >>foreach line read/lines [ print ["=>" line] ;- do something with line ] ;- Elan >> [: - )]
[REBOL] [REBOL] Reading text a line at a time Re:
Tim wrote: > I would like to read a text file a line at a time. What's more, I would like to read each line into a variable. After looking at the draft manual and reading fillines.html, I attempted the following code: > file: open/read %test.txt > foreach line file [print line] > ;like to replace the above line of code > ;with one that reads into a variable > ;perhaps for parsing or modification > ;and then prints it > close text > ;; > {The second line of code generates an error message} You're so close. It's your experience in C that's tripping you up. Have a read of the manual again at the page you say you've read, fillines.html: For example, to read a file as a block of lines: read/lines %file.txt The block contains a series of strings without line terminators. Try executing it at the REBOL console and look at the result. Here's where you went wrong: > file: open/read %test.txt Here you're actually opening a read port to the file %test.txt. If your file is really, really big, greater than megabytes in size, opening a port is the way to go. But for smaller files, ones intended to be viewed at the console, this is better: "...read a text file a line at a time..." File: read/lines %test.txt ; File contains entire file as block of lines. > foreach line file [print line] "...to read each line into a variable..." "...reads into a variable, perhaps for parsing or modification, and then prints it..." foreach line File [ append line "My modification" print line ] > close text Don't need this. If you want to release the memory held by File, do this: File: none and it's gone. > I'd like to make a comment here: I learned C starting about 9 years ago, with my main reference called (if I remember correctly), "The C Users Bible". It had a very special rule. EVERY EXAMPLE WAS FULLY EXECUTABLE!! Nothing taken out of context. > > I believe if Rebol makes this a goal, for a manual, you can kick some Perl butt out there in Cyber Land. These first tiny steps for any newbie are as important as showing off the power of Rebol. > > Now you have it in writing: If I can help to this end, just ask. The REBOL script for the manual already executes each example, except for the examples for 'quit, 'ask and a couple of others, if I recall correctly. Have a look at the beta manual script at the http://www.rebol.com site and check it out. Don't be put off, you are on the learning path. REBOL - It's better than you think! H... Looks like I'm sloganeering again... Andrew Martin A return to innocence... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] [REBOL] Reading text a line at a time Re:
Try this for standard file access it is easier to use 'read instead of using 'open and 'close lines: read/lines %test.txt foreach line lines [ ; do what ever ] ;-- or you can access lines individualy by lines: read/lines %test.txt print lines/1 print lines/2 etc Cheers Allen K - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 21, 2000 1:52 PM Subject: [REBOL] [REBOL] Reading text a line at a time > I would like to read a text file a line at > a time. What's more, I would like to read each > line into a variable. > After looking at the draft manual and reading > fillines.html, I attempted the following code: > ;; > file: open/read %test.txt > foreach line file [print line] > ;like to replace the above line of code > ;with one that reads into a variable > ;perhaps for parsing or modification > ;and then prints it > close text > ;; > {The second line of code generates an error message} > > I'd like to make a comment here: > I learned C starting about 9 years ago, with > my main reference called (if I remember correctly), > "The C Users Bible". It had a very special rule. > EVERY EXAMPLE WAS FULLY EXECUTABLE!! Nothing taken > out of context. > > I believe if Rebol makes this a goal, for a manual, > you can kick some Perl butt out there in Cyber Land. > These first tiny steps for any newbie are as important > as showing off the power of Rebol. > > Now you have it in writing: If I can help to this end, > just ask. > Thanks > Tim > >
[REBOL] strange append behavior Re:(2)
I think my trouble started when I tried: foo: next bar If I then do: foo: next foo foo: head foo #now I think I am at ('foo: next bar') Now that I see it, I'll be able to work with it... Thanks -ridley In a message dated 1/20/00 4:24:24 PM Pacific Standard Time, [EMAIL PROTECTED] writes: > Ridley, > > >> help next > Returns the series at its next position. > Arguments: > series -- (series port) > > Note the use of the words "the" and "its" in "Returns THE series at ITS > next position." > > > >> help append > Appends a value to the tail of a series and returns the series head. > Arguments: > series -- (series port) > value -- > Refinements: > /only -- Appends a block value into a block series as a block > > Here note the words "... and returns THE series HEAD." > > > ;- Elan >> [: - )] > > >
[REBOL] [REBOL] Reading text a line at a time
I would like to read a text file a line at a time. What's more, I would like to read each line into a variable. After looking at the draft manual and reading fillines.html, I attempted the following code: ;; file: open/read %test.txt foreach line file [print line] ;like to replace the above line of code ;with one that reads into a variable ;perhaps for parsing or modification ;and then prints it close text ;; {The second line of code generates an error message} I'd like to make a comment here: I learned C starting about 9 years ago, with my main reference called (if I remember correctly), "The C Users Bible". It had a very special rule. EVERY EXAMPLE WAS FULLY EXECUTABLE!! Nothing taken out of context. I believe if Rebol makes this a goal, for a manual, you can kick some Perl butt out there in Cyber Land. These first tiny steps for any newbie are as important as showing off the power of Rebol. Now you have it in writing: If I can help to this end, just ask. Thanks Tim
[REBOL] How do I test for simple regex from external string Re:(5)
Hi Bob, >this is a candidate for storing as a separate >script library element with your name on it. > >set it up so we can call >do %simple_re.r >from within wiki.r > >if you dont get to it >by the weekend, then I will. Thanks. I'd like to test it a little more thoroughly, though. I wrote it rather late last night and only tested it against the examples you supplied. I'd rather try out a few more combinations. >>5. You don't specify whether the front and end anchors ("^" and "$" >>respectively) must appear at the beginning (or end) of the string. Neither >>do you mention whether not ("?!") must appear at the beginning of the >>string. I assume that your example indicates that this is an implied rule. >> > for #5 I can live with requiring at least one or the other. It's easy enough to remove the line that regulates that. Will make the code even shorter (and one less line of code to cause a bug ;-). > I am not sure if negate binds outward (?! or inward ?!( > in the re library of perl. it feels outward. > it can appear anywhere ahead > of some other subgroup but I do not know of > more complicated uses than up front once so I will > leave that one alone too. I just checked and it appears that the correct notation is (?! for negation. I think I'll change that as well, while I'm at it. I'll (try) to >set it up so we can call >do %simple_re.r >from within wiki.r over the weekend. (I'll probably be calling you for instructions!) ;- Elan >> [: - )]
[REBOL] How do I test for simple regex from external string Re:(9)
Elan wrote: > Nice work. (I was planning to get started on something like that myself. Haven't had time yet.) Thanks! > One little bug I found (adding ?! to the first sample regex string): > a) "noty" causes an error in > > > "?!" (append RegExp_Parser [noty]) | > > here: > "intruder" > [noty "ted" | "admin" | "bobr" | "andrew" | "elan" | "keith" | "cheryl" | > "joel" | "brady" end] > ** Script Error: noty has no value. > ** Where: parse/all probe Exp probe RegExp_Parse > > Probably you meant "not". I don't think that the REBOL parse dialect supports the word "not". Yes ::blush:: My mistake. I plan to use complemented character sets, when the "?!" appears. > 2. Doesn't * mean zero or more? you appear to replace it by | none. > > "*" (append RegExp_Parser [| none]) | > > That would not account for repetitive patterns. It should be replace by something like any xxx where xxx would be whatever it is that may appear zero or more times. 'any would work, except I couldn't think of a way to get it the right place. "| none" would allow this. > Come to think of it, I think regexs are a little more complicated then this and cannot be implemented by a one-to-one mapping of regex symbols to REBOL parse words. > > Let me think about it a little longer, but IMHO you will need some kind of state machine to do it correctly. You could well be write, but I'm hopeful. Here's what I've got so far: RegExp_Parse: function [RegExp [string!]] [ Stack RegExp_Parser Match Match_Character Match_Characters Parenthesis_Rules RegExp_Rules Nest ][ Stack: Stack! RegExp_Parser: make block! 4 * length? RegExp Match: make string! 0 Match_Character: charset [#"0" - #"9" #"A" - #"Z" #"a" - #"z"] Match_Characters: [some Match_Character] append RegExp_Parser [to] Nest: head RegExp_Parser Parenthesis_Rules: [ "|" (append Nest [|]) | "(" (append/only Nest [] Stack/Push Nest Nest: last Nest) some Parenthesis_Rules ")" (Nest: Stack/Pop) | copy Match Match_Characters (append Nest Match) ] RegExp_Rules: [ "^^" (if 'to = first probe Nest [remove head Nest]) | "*" (append Nest [| none]) | "?!" "(" (append Nest ["complement"]) ")" | "|" (append Nest [|]) | "$" (append Nest [end]) | "(" (append/only Nest [] Stack/Push Nest Nest: last RegExp_Parser) some Parenthesis_Rules ")" (Nest: Stack/Pop) | copy Match Match_Characters (append Nest Match) ] parse/all RegExp [some RegExp_Rules] if not 'end = last RegExp_Parser [append RegExp_Parser [to end]] RegExp_Parser ] RegExp: func [RegExp [string!] Exp [string!]] [ parse/all probe Exp probe RegExp_Parse RegExp ] print RegExp "^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$" "intruder" print RegExp "^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$" "cheryl" It doesn't quite work properly, the complement doesn't, and I haven't figured out nesting of parenthesis yet. Here's what 'stack! looks like: >> source stack! stack!: func [][ make object! [ Stack: make block! 0 Push: func [Item] [ append/only Stack Item ] Pop: function [] [Item] [ if empty? Stack [exit] Item: last Stack remove back tail Stack Item ] ] ] Andrew Martin Learning more about 'Parse and RegExp every day... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] How do I test for simple regex from external string Re:(8)
Hi Andrew, nice work. (I was planning to get started on something like that myself. Haven't had time yet.) One little bug I found (adding ?! to the first sample regex string): a) "noty" causes an error in > "?!" (append RegExp_Parser [noty]) | here: "intruder" [noty "ted" | "admin" | "bobr" | "andrew" | "elan" | "keith" | "cheryl" | "joel" | "brady" end] ** Script Error: noty has no value. ** Where: parse/all probe Exp probe RegExp_Parse Probably you meant "not". I don't think that the REBOL parse dialect supports the word "not". 2. Doesn't * mean zero or more? you appear to replace it by | none. > "*" (append RegExp_Parser [| none]) | That would not account for repetitive patterns. It should be replace by something like any xxx where xxx would be whatever it is that may appear zero or more times. Come to think of it, I think regexs are a little more complicated then this and cannot be implemented by a one-to-one mapping of regex symbols to REBOL parse words. Let me think about it a little longer, but IMHO you will need some kind of state machine to do it correctly. Hope this helps. At 05:26 PM 1/20/00 -0800, you wrote: >Here's what I've got so far: > >RegExp_Parse: function [RegExp [string!]] [ > RegExp_Rules RegExp_Parser Match Match_Character Match_Characters > ][ > RegExp_Parser: make block! 4 * length? RegExp > Match: make string! 0 > Match_Character: charset [#"0" - #"9" #"A" - #"Z" #"a" - #"z"] > Match_Characters: [some Match_Character] > append RegExp_Parser [to] > RegExp_Rules: [ > "^^" (if 'to = first RegExp_Parser [remove head RegExp_Parser]) | > "*" (append RegExp_Parser [| none]) | > "?!" (append RegExp_Parser [noty]) | > "|" (append RegExp_Parser [|]) | > "$" (append RegExp_Parser [end]) | > "(" | > ")" | > copy Match Match_Characters (append RegExp_Parser Match) > ] > parse/all RegExp [some RegExp_Rules] > RegExp_Parser > ] > >RegExp: func [RegExp [string!] Exp [string!]] [ > parse/all probe Exp probe RegExp_Parse RegExp > ] > >print RegExp "^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$" >"intruder" >print RegExp "^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$" >"cheryl" > >And here it is running: > >>> do %bobr.r >Script: "bobr" (20-Jan-1999) >"intruder" >["ted" | "admin" | "bobr" | "andrew" | "elan" | "keith" | "cheryl" | "joel" >| "brady" end] >false >"cheryl" >["ted" | "admin" | "bobr" | "andrew" | "elan" | "keith" | "cheryl" | "joel" >| "brady" end] >true > >Parenthesis don't work, yet. Gabrielle, Elan? Feel free to improve it. > >I've also noticed that _two_ calls to parse in the one function doesn't seem >to work right. > >Andrew Martin >ICQ: 26227169 >[EMAIL PROTECTED] >http://members.xoom.com/AndrewMartin/ >-><- > > > > ;- Elan >> [: - )]
[REBOL] Faxing in REBOL Re:(5)
Phzzt! This message has been on some vacation! ;^) On 25-Oct-99, [EMAIL PROTECTED] wrote: > On 26-Oct-99, [EMAIL PROTECTED] wrote: > > Where is this in the docs? I've look at the documentation from the REBOL > > site and couldn't find anything about faxing? > Cheryl: the doc is How-To/web-read.html: > SEND [EMAIL PROTECTED] READ http://www.page.html -- ---===///||| Donald Dalley |||\\\===--- The World of AmiBroker Support http://webhome.idirect.com/~ddalley Member: ICOA and Team AMIGA
[REBOL] Does REBOL support multiple instances of functions? Re:
Hi Steve, the reason you get this result is that your gettext function returns a reference to the string 'text which is defined in your tag-parser object. This 'text string is created exactly once, namely when the object is created. Each time your parse-rule evaluates (append text txt), the string referenced by txt is appended to the (cleared) string referenced by text. When you change the content of the string referenced by 'text in the tag-parser object, you have changed the data being referenced by all references to the 'text string. including the reference appended to 'result in the line append result reduce [ What you can do about it: you can either return a copy of text from gettext, instead of returning the refernce itself: change this: return text to this: return copy text or replace the clear text expression in gettext to making the 'text string and kick the 'text string from the object altogether: >tag-parser: make object! [ > text: make string! 8000 <== remove this >gettext: func [str [string!]] [ > clear text <=== replace this gettext: func [str [string!] /local text] [ text: make string! 8000<= by this or >tag-parser: make object! [ > text: make string! 8000 <== replace this tag-parser: make object! [ text: none<== by this and >gettext: func [str [string!]] [ > clear text <=== replace this gettext: func [str [string!] /local text] [ text: make string! 8000<= by this At 04:46 PM 1/20/00 -0600, you wrote: >Hello, I've been beating my head on the wall on this one for a while and thought someone else might have a solution. Starting with the tag parsing examples on the web site I've created a function to return just the text portion of a string, removing all HTML tags and newline characters. However, when I call this function more than once in the same statement it returns the value of the last function call for each instance of the call!?! The script and it's output is as follow: > >;<-Start Script-> >REBOL [] >tag-parser: make object! [ > text: make string! 8000 > text-rule: [ > ["<" thru ">"] | [newline] | copy txt to "<" (append text txt) > ] > gettext: func [str [string!]] [ > clear text > parse str [to "<" some text-rule] > return text > ] >] >blk-name: copy {BLOCK} >notice: copy {NOTICE} >frm-val: copy {From1} >to-val: copy {To1} >amt-val: copy {Amount1} >result: copy {} > >append result reduce [ > tag-parser/gettext blk-name ":" > tag-parser/gettext notice ":" > frm-val " to " to-val " = " > amt-val newline >] >print result >;<-End Script-> > > From REBOL command prompt: > >> do file:test.r >Script: "Untitled" (none) >NOTICE:NOTICE:From1 to To1 = Amount1 > >In this test, it returned "NOTICE:NOTICE" instead of "BLOCK:NOTICE". If I remove one of the tag-parser/gettext calls in the append statement it returns the correct value, but one of them is left with it's HTML tags. I encapsulated the function and it's variables into an object! hoping this would help but it's the same either way. > >Am I missing some easy fix for this? > >Thanks in advance! > >->Steve Blackmore > > > ;- Elan >> [: - )]
[REBOL] How do I test for simple regex from external string Re:(7)
Here's what I've got so far: RegExp_Parse: function [RegExp [string!]] [ RegExp_Rules RegExp_Parser Match Match_Character Match_Characters ][ RegExp_Parser: make block! 4 * length? RegExp Match: make string! 0 Match_Character: charset [#"0" - #"9" #"A" - #"Z" #"a" - #"z"] Match_Characters: [some Match_Character] append RegExp_Parser [to] RegExp_Rules: [ "^^" (if 'to = first RegExp_Parser [remove head RegExp_Parser]) | "*" (append RegExp_Parser [| none]) | "?!" (append RegExp_Parser [noty]) | "|" (append RegExp_Parser [|]) | "$" (append RegExp_Parser [end]) | "(" | ")" | copy Match Match_Characters (append RegExp_Parser Match) ] parse/all RegExp [some RegExp_Rules] RegExp_Parser ] RegExp: func [RegExp [string!] Exp [string!]] [ parse/all probe Exp probe RegExp_Parse RegExp ] print RegExp "^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$" "intruder" print RegExp "^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$" "cheryl" And here it is running: >> do %bobr.r Script: "bobr" (20-Jan-1999) "intruder" ["ted" | "admin" | "bobr" | "andrew" | "elan" | "keith" | "cheryl" | "joel" | "brady" end] false "cheryl" ["ted" | "admin" | "bobr" | "andrew" | "elan" | "keith" | "cheryl" | "joel" | "brady" end] true Parenthesis don't work, yet. Gabrielle, Elan? Feel free to improve it. I've also noticed that _two_ calls to parse in the one function doesn't seem to work right. Andrew Martin ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Does REBOL support multiple instances of functions?
Hello, I've been beating my head on the wall on this one for a while and thought someone else might have a solution. Starting with the tag parsing examples on the web site I've created a function to return just the text portion of a string, removing all HTML tags and newline characters. However, when I call this function more than once in the same statement it returns the value of the last function call for each instance of the call!?! The script and it's output is as follow: ;<-Start Script-> REBOL [] tag-parser: make object! [ text: make string! 8000 text-rule: [ ["<" thru ">"] | [newline] | copy txt to "<" (append text txt) ] gettext: func [str [string!]] [ clear text parse str [to "<" some text-rule] return text ] ] blk-name: copy {BLOCK} notice: copy {NOTICE} frm-val: copy {From1} to-val: copy {To1} amt-val: copy {Amount1} result: copy {} append result reduce [ tag-parser/gettext blk-name ":" tag-parser/gettext notice ":" frm-val " to " to-val " = " amt-val newline ] print result ;<-End Script-> From REBOL command prompt: >> do file:test.r Script: "Untitled" (none) NOTICE:NOTICE:From1 to To1 = Amount1 In this test, it returned "NOTICE:NOTICE" instead of "BLOCK:NOTICE". If I remove one of the tag-parser/gettext calls in the append statement it returns the correct value, but one of them is left with it's HTML tags. I encapsulated the function and it's variables into an object! hoping this would help but it's the same either way. Am I missing some easy fix for this? Thanks in advance! ->Steve Blackmore
[REBOL] Faxing in REBOL Re:(4)
On 26-Oct-99, [EMAIL PROTECTED] wrote: > Where is this in the docs? I've look at the documentation from the REBOL > site and couldn't find anything about faxing? Cheryl: the doc is How-To/web-read.html: SEND [EMAIL PROTECTED] READ http://www.page.html -- ---===///||| Donald Dalley |||\\\===--- The World of AmiBroker Support http://webhome.idirect.com/~ddalley Member: ICOA and Team AMIGA
[REBOL] strange append behavior Re:
Ridley, >> help next Returns the series at its next position. Arguments: series -- (series port) Note the use of the words "the" and "its" in "Returns THE series at ITS next position." >> b: make block! ["hello"] == ["hello"] >> b: next b == [] >> index? b == 2 >> head b == ["hello"] >> help append Appends a value to the tail of a series and returns the series head. Arguments: series -- (series port) value -- Refinements: /only -- Appends a block value into a block series as a block Here note the words "... and returns THE series HEAD." >> source append append: func [ {Appends a value to the tail of a series and returns the series head.} series [series! port!] value /only {Appends a block value into a block series as a block} ][ head either only [insert/only tail series :value ] [ insert tail series :value ] ] Note the line: head either only ... ie, when you have used append, append will returns head b, and head b is >> head b == ["hello"] before append and will continue to begin at "hello" after the append. Some people have complained that append should not return the head of the series, because, as in your case, you may be dealing with a series whose current position has been modified, and the resulting series is not intended. If that is the behavior you are looking for, you can simply use the following home-brewn version of append. I stored in a file called append.r. This version does returns the series at its former current position, but it does not do the same thing for ports, because 'at does not support ports. REBOL [] append: func [ {Appends a value to the tail of a series and returns the series at its passed position, if series is a series! type and not a port!.} series [series! port!] value /only {Appends a block value into a block series as a block} /local position s ][ if series? series [position: index? series] s: head either only [insert/only tail series :value ] [ insert tail series :value ] return either series? series [ at s position ] [s] ] >> do %append.r Script: "Untitled" (none) >> append at [1 2 3 4] 3 100 == [3 4 100] >> b: make block! ["hello"] == ["hello"] >> b: next b == [] >> append b "Why do I see the first string?" == ["Why do I see the first string?"] ;- Elan >> [: - )]
[REBOL] Re: POST method under IIS3/4 Re:
On 20-Jan-00, [EMAIL PROTECTED] said about the subject [REBOL] POST method under IIS3/4 Re:: Hi, > there is a CGI HOWTO at http://www.rebol.com/howto.html#cgi-scripts.html > which mentions POST. Yeah been through that. I never seem to have trouble posting data using apache. > These two little files work for me in IIS 4. If GET works for you, POST > should as well, no more server configuration is needed. Hmm, I just realised the PUT, DELETE extras mentioned in the cgi howto isn't setup in IIS4 configuration. Would that likely cause a problem ? Thanks for the scripts, I'll try them in work tomorrow. > I think I read earlier that 'read-io function does not grow its string > argument dynamically as other functions in REBOL, but needs enough > bytes (here it is 2000) already reserved. I'm not sure. IIS4 gave the impression it didn't know when to end the data from the input. Kind Regards, Ed. -- _ \___ \ /\ / ___// ICQ: 34895924 | \ \\_/\_// __// TWF Home : http://www.worldfoundry.com/ |_ /__\/_// CEG Home : http://www.worldfoundry.com/ceg/ = The World Foundry LLC - Amiga PPC - Explorer 2260 - Maim & Mangle I think that God in creating man somewhat overestimated his ability. -- Oscar Wilde
[REBOL] Re: POST method under IIS3/4 Re:
On 20-Jan-00, [EMAIL PROTECTED] said about the subject [REBOL] POST method under IIS3/4 Re:: Hi, > What kind of error messages are you getting? > Can you paste them into your next message? Um, there isn't an error message. :) What happens is when my script tries to decode the input from the POST. Using the likes of the lines below in my code: read-io system/ports/input data: make string! 2000 2000 print data would result in the browser sitting there until the browser times out the connection. It didn't seem to know what to do with the input. > Also, the flags you are setting when you invoke the script > eg. rebol -cs or >> rebol -cgi or whatever? Yes they're setup as -cs in the IIS setup. Like I say, rebol scripts do work except when data from a POST is used (or rather when tried to be interpreted/decoded). Kind Regards, Ed. -- _ \___ \ /\ / ___// ICQ: 34895924 | \ \\_/\_// __// TWF Home : http://www.worldfoundry.com/ |_ /__\/_// CEG Home : http://www.worldfoundry.com/ceg/ = The World Foundry LLC - Amiga PPC - Explorer 2260 - Maim & Mangle That secret you've been guarding, isn't.
[REBOL] strange append behavior Re:
Here's what append does: >> ? append Appends a value to the tail of a series and returns the series head. Arguments: series -- (series port) value -- Refinements: /only -- Appends a block value into a block series as a block >> "Returns the series head" means 'Returns the series positioned at its head' After the append, if you look at b, you'll see only what you appended, as you expect. Look at this: >> b: make block! [" Hello"] == [" Hello"] >> b: next b == [] >> append b "Russell" == [" Hello" "Russell"] >> b == ["Russell"] >> append b "jr" == [" Hello" "Russell" "jr"] >> b == ["Russell" "jr"] Looks fine to me, ie, not strange! Russell [EMAIL PROTECTED] - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, January 20, 2000 7:36 AM Subject: [REBOL] strange append behavior > Howdy... > > I ran this interactively: > > b: make block! ["hello"] > length? b > b: next b > length? b > append b "Why do I see the first string?" > > > And got this: > > >> b: make block! ["hello"] > == ["hello"] > >> length? b > == 1 > >> b: next b > == [] > >> length? b > == 0 > >> append b "Why do I see the first string?" > == ["hello" "Why do I see the first string?"] > >> > > > > -ridley > > >
[REBOL] Openletter to Rebol HQ. Re:(9)
Dan, In case I've never said it, I think you folks at RT are an amazing bunch, working to bring us an amazing tool. Your efforts are greatly appreciated. I'm looking forward to employing REBOL as a key piece in our company's toolkit once its main constituents are are all available. Do you folks ever feel like you're members of some kind of jazz ensemble -- or perhaps a symphonic orchestra ? Regards, Mike -Original Message- From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Thursday, January 20, 2000 2:06 PM Subject: [REBOL] Openletter to Rebol HQ. Re:(8) >Little late for me to enter this thread, but I'll throw a REBOL employee >response into the mix prior to Carl's. > >I strongly believe Elan's excitement (and others) for View is well-placed. Carl and some of the team were pounding away until the wee early morning hours today getting View working...it really will be ready soon :-) Actually, the need to provide you with a bunch of decent examples to get everyone off on the right foot is our biggest gating factor, but there are already more than 20 and many more to come. > >As for jb and other's demand for Command and web application needs, they are also valid and not forgotten. We have a number of modules that are quite close, but in addition to final testing and packaging, are held up until we make some strategic decisions and free up some resources...rest assured, everyone's feedback on this list and through direct emails are being considered in our decision-making and we will actively solicit your viewpoints going forward. > >Hope this helps clarify things a little! dan
[REBOL] Rebol Web Server Re:
Porter wrote: > Ideally the script engine would have a "request" object - one of the properties of the request would be the named arguments that had been supplied when the page was requested - thus the URL for this page might have read: > > http://www.myserver.net/test.rsp?condition=true Check out: Title: "CGI Form Dumper" Date: 19-July-1999 File: %cgidump.r Purpose: { Display the contents of a submitted form as a web page. Useful for debugging CGI forms. Available at http://www.rebol.org > Or - the rsp page could be entirely a Rebol script, overriding any sort of HTTP headers, and spitting back binary data - perhaps to generate an image on the fly. Check out: Title:"GIF number generator" Author: "Jan Strejcek" File: %gif-number.r Available at http://www.rebol.org > Or - if the rebol script generates a page, perhaps the tags could be autogenerated such that they include meta tags, and the block simply transcribes the Title: from the rebol header... Check out my HTML dialect available at http://www.rebol.org or latest version on my web_dialect list at onelist.com > Of course, most of this seems to be well beyond the current capabilities of Rebol (as it stands right now). :-\ > I think it'll be possible to get a rebol based web server to execute .r files, and spit back the output of those scripts - but w/o multi-threading, it's performance under any load will be poor. Use Apache module, out soon. Or use the beta. Andrew Martin Beyond the bleeding edge... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] strange append behavior Re:
ridley wrote: > >> append b "Why do I see the first string?" > == ["hello" "Why do I see the first string?"] >> source append append: func [ {Appends a value to the tail of a series and returns the series head.} series [series! port!] value /only {Appends a block value into a block series as a block} ][ head either only [insert/only tail series :value ] [ insert tail series :value ] ] ...returns the series head. Andrew Martin Dah, dah, dah, dah... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] How do I test for simple regex from external string Re:(6)
jn wrote: > The limitation of the code you presented is that it ignores some of the context and partial-description issues. It would seem that a 'RegExpParse-er would be a good idea. Then bobr's PERL function: sub userInList { my ($user, $userlist) = @_; $user =~ s/$userlist//; # a perfect match erases all chars return ( $user eq "" ) ? 1 : 0; } would look this in REBOL: userInList: func [user [string!] userList [block!]] [ RegExpParse userList user ] RegExpParse would work by first reworking the PERL RegExp, 'userList, into parse rules, then use those parse rules with 'parse to check 'user. That would seem the most elegant way to do it. Andrew Martin Thinking about it all night... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] Openletter to Rebol HQ. Re:(9)
Dan, Is it possible for Rebol Technologies to provides some screen shots? This might quiet the crowd down a little. Thanks, Cheryl - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 20, 2000 5:55 AM Subject: [REBOL] Openletter to Rebol HQ. Re:(8) > Little late for me to enter this thread, but I'll throw a REBOL employee > response into the mix prior to Carl's. > > I strongly believe Elan's excitement (and others) for View is well-placed. Carl and some of the team were pounding away until the wee early morning hours today getting View working...it really will be ready soon :-) Actually, the need to provide you with a bunch of decent examples to get everyone off on the right foot is our biggest gating factor, but there are already more than 20 and many more to come. > > As for jb and other's demand for Command and web application needs, they are also valid and not forgotten. We have a number of modules that are quite close, but in addition to final testing and packaging, are held up until we make some strategic decisions and free up some resources...rest assured, everyone's feedback on this list and through direct emails are being considered in our decision-making and we will actively solicit your viewpoints going forward. > > Hope this helps clarify things a little! dan > > > > .At 09:56 AM 1/20/00 -0600, you wrote: > >[EMAIL PROTECTED] wrote: > >> > >> Whether the beta ships this week or next week, let us not lose from > >> sight, what it is that we are talking about. We are not talking > >> about extending REBOL with a GUI interface! > >> > >> We are talking about adding REBOL to GUI applications. GUI > >> applications become programmable in REBOL! This is GUI applications > >> with Internet processing programmable in REBOL! This is Internet > >> applications with GUIs programmable in REBOL! Big difference! > >> > > ... > >> > >> There are millions and millions of people out there, who are > >> comfortable with a mouse and who expect that they can start up an > >> application and make choices from menus in order to accomplish > >> their tasks. These people will be able to use our scripts. > >> This is important! > >> > > > >It's really too bad that experienced users like Elan have become > >so jaded that they can't get excited about the future of REBOL... > > > >;-} > > > >Seriously, I think Elan's right on target about the importance of > >GUI capabilities to the great masses. Those of us that are happy > >with a text-based interaction (or who write server scripts, etc.) > >are definitely in the minority. As long as we are writing code > >just for ourselves to use, or to be hidden in a server somewhere, > >text mode is fine. However, if I want to write scripts for non- > >technical human users, I want the tools to make it easy for them > >to appreciate the beauty of my work! ;-) > > > >I think there's a significant market for REBOL code which will > >only open up when T. C. Mits can drive it with pretty pictures. > > > >-jn- > > > >P.S.: The prospect of early availability of REBOL/View only > >increases my desire for comprehensive docs. Please, please, > >please, please >
[REBOL] How do I test for simple regex from external string Re:(5)
[EMAIL PROTECTED] wrote: > > At 02:48 AM 1/20/00 -0800, [EMAIL PROTECTED] wrote: > >Here's the fixed and improved function and rules: > excellent! > > this is a candidate for storing as a separate > script library element with your name on it. > > set it up so we can call > do %simple_re.r > from within wiki.r > Cool! > > 5. You don't specify whether the front and end anchors ("^" and "$" > respectively) must appear at the beginning (or end) of the string. > In traditional REs, ^ matches the beginning of the searched string and should only appear at the beginning of a pattern (or a pattern alternative). By this rule, ^(icimjs|bobr) is OK, and equivalent to (^icimjs|^bobr) (although I didn't notice any beginning-of-line alternatives in bobr's initial examples). However some^thing is bogus, as it would require "some" to appear BEFORE the beginning of the string. Corresponding mirror-imaged rules apply for $ where (com|net|org)$ is actually equivalent to (com$|net$|org$) (but the first usage is more common). Perl 5 added a switch/refinement which allows ^ and $ to match the beginning and ending of a LINE within strings containing embedded \n characters, but that's too cruel to throw into the discussion at this point -- and way beyond what I understood bobr to be asking for. > > Neither do you mention whether not ("?!") must appear at the > beginning of the string. I assume that your example indicates that > this is an implied rule. > The full syntax is (?!pattern) where pattern is any regular expression. The simple usage in bobr's example simply applied it to the entire match, so that ^(?!(per|jav|vb)) will match any string that DOESN'T begin with one of the listed alternatives. However, it doesn't have to be used only at the beginning of a pattern. Again, any examples I can think of take us into areas of RE syntax that go beyond what bobr was asking for, AFAICT. -jn-
[REBOL] POST method under IIS3/4 Re:
What kind of error messages are you getting? Can you paste them into your next message? Also, the flags you are setting when you invoke the script eg. rebol -cs or >> rebol -cgi or whatever?
[REBOL] strange append behavior
Howdy... I ran this interactively: b: make block! ["hello"] length? b b: next b length? b append b "Why do I see the first string?" And got this: >> b: make block! ["hello"] == ["hello"] >> length? b == 1 >> b: next b == [] >> length? b == 0 >> append b "Why do I see the first string?" == ["hello" "Why do I see the first string?"] >> -ridley
[REBOL] Rebol Web Server
Hi - despite the fact that Rebol is not yet multi-threaded, I have an interesting project that I'm fiddling with, and need some help with. I've taken the webserver.r script off of rebol.com, and am modifying it so that it can run Rebol scripts to generate web pages. Essentially it intercepts all requests for "pages" that end in .rsp (rebol server page), and then tries to execute them and spit back the output to the browser... Of course the ideal would be to end up with some sort of script engine very similar to PHP, or ASP, where <% %> indicates a block of code - that way you could end up with the following: test.rsp Test Rebol Server Page <% either request/argument/condition = true [ %> You are correct! <% ][ %> You are incorrect! <% ] %> Ideally the script engine would have a "request" object - one of the properties of the request would be the named arguments that had been supplied when the page was requested - thus the URL for this page might have read: http://www.myserver.net/test.rsp?condition=true Thus the actual HTML that would be sent back to the browser - after being parsed by a rebol enabled server would read: Test Rebol Server Page You are correct! Or - the rsp page could be entirely a Rebol script, overriding any sort of HTTP headers, and spitting back binary data - perhaps to generate an image on the fly. Or - if the rebol script generates a page, perhaps the tags could be autogenerated such that they include meta tags, and the block simply transcribes the Title: from the rebol header... Of course, most of this seems to be well beyond the current capabilities of Rebol (as it stands right now). I think it'll be possible to get a rebol based web server to execute .r files, and spit back the output of those scripts - but w/o multi-threading, it's performance under any load will be poor. - Porter
[REBOL] POST method under IIS3/4 Re:
Hi, there is a CGI HOWTO at http://www.rebol.com/howto.html#cgi-scripts.html which mentions POST. These two little files work for me in IIS 4. If GET works for you, POST should as well, no more server configuration is needed. I think I read earlier that 'read-io function does not grow its string argument dynamically as other functions in REBOL, but needs enough bytes (here it is 2000) already reserved. [EMAIL PROTECTED] wrote: > > Hi folks, > It's me again. I'm not sure if my mail got lost in the large number of posts > in the last few days or if nobody knows the answer. Can anyone who has > succeded in getting the POST method to be used with webbased forms under > IIS3/4 tell us how they managed it. The GET method works fine (with the > additional check on the query string) but my form holds too much data to be > sent as a GET. Ofcourse POSTs work fine under apache which only makes if > even more annoying to wonder what M$ has been doing with their server > software. :( > > All the best, > Ed. > -- > _ > \___ \ /\ / ___// ICQ: 34895924 > | \ \\_/\_// __// TWF Home : http://www.worldfoundry.com/ > |_ /__\/_// CEG Home : http://www.worldfoundry.com/ceg/ > = > The World Foundry LLC - Amiga PPC - Explorer 2260 - Maim & Mangle > > God isn't dead, he just couldn't find a parking place. -- Michal Kracik posttest.r
[REBOL] REBOL/View vs. OpenAmulet? Re:(8)
> >> REBOL script using the new parse block capability. > >Hi, will this feature make it into /Core too? Having a official way to do >dialecting would be great. Robert > Hi Robert, Yes, /view is built on /core which will be re-released shortly with some improvements and bug fixes. One improvement involves modifying a scalar quantity using a path. For example, previously if you did: t: now/time t/minute: 0 to make that work you needed to do: t: t/minute: 0 This now works as expected and the extra assignment is no longer needed. ( Uh oh, there goes that immutable list... ;-) ) - jim
[REBOL] Openletter to Rebol HQ. Re:(8)
Little late for me to enter this thread, but I'll throw a REBOL employee response into the mix prior to Carl's. I strongly believe Elan's excitement (and others) for View is well-placed. Carl and some of the team were pounding away until the wee early morning hours today getting View working...it really will be ready soon :-) Actually, the need to provide you with a bunch of decent examples to get everyone off on the right foot is our biggest gating factor, but there are already more than 20 and many more to come. As for jb and other's demand for Command and web application needs, they are also valid and not forgotten. We have a number of modules that are quite close, but in addition to final testing and packaging, are held up until we make some strategic decisions and free up some resources...rest assured, everyone's feedback on this list and through direct emails are being considered in our decision-making and we will actively solicit your viewpoints going forward. Hope this helps clarify things a little! dan .At 09:56 AM 1/20/00 -0600, you wrote: >[EMAIL PROTECTED] wrote: >> >> Whether the beta ships this week or next week, let us not lose from >> sight, what it is that we are talking about. We are not talking >> about extending REBOL with a GUI interface! >> >> We are talking about adding REBOL to GUI applications. GUI >> applications become programmable in REBOL! This is GUI applications >> with Internet processing programmable in REBOL! This is Internet >> applications with GUIs programmable in REBOL! Big difference! >> > ... >> >> There are millions and millions of people out there, who are >> comfortable with a mouse and who expect that they can start up an >> application and make choices from menus in order to accomplish >> their tasks. These people will be able to use our scripts. >> This is important! >> > >It's really too bad that experienced users like Elan have become >so jaded that they can't get excited about the future of REBOL... > >;-} > >Seriously, I think Elan's right on target about the importance of >GUI capabilities to the great masses. Those of us that are happy >with a text-based interaction (or who write server scripts, etc.) >are definitely in the minority. As long as we are writing code >just for ourselves to use, or to be hidden in a server somewhere, >text mode is fine. However, if I want to write scripts for non- >technical human users, I want the tools to make it easy for them >to appreciate the beauty of my work! ;-) > >I think there's a significant market for REBOL code which will >only open up when T. C. Mits can drive it with pretty pictures. > >-jn- > >P.S.: The prospect of early availability of REBOL/View only >increases my desire for comprehensive docs. Please, please, >please, please
[REBOL] BE PATIENT! - was - Openletter to Rebol HQ. Re:(3)
Hi Dan, waiting until a product is ready, and _then_ releasing it, is a Good Thing (tm), but it is even better to tell people about what is happening. You have this shiny little [EMAIL PROTECTED] mailing list, why don't you use it? Some messages like: - hey, today we started working on the palm version - Ohh, sorry, we ran into memory management problems in the palm version, so it is dropped for the time being - Rebol/View beta is in the works, that's what it will contain ... .. and so on. Whenever something interesting happens would surely raise confidence in Rebol (Tech.) jus' my some and a half cents, regards, Ingo Those were the words of [EMAIL PROTECTED]: <..> > At 12:36 AM 1/20/00 +0100, you wrote: <..> > >Just to avoid such threads I would even dare to suggest Carl some form > >of "Monthly letter of REBOL creator", discussing some actual developments > >inside of company, if not secret of course ... > > > >-pekr- <..> -- _ ._ ingo@)|_ /| _| _ ingo@| |(_|o(_)| (_| http://www.2b1.de/Rebol/ ._| ._|
[REBOL] How do I test for simple regex from external string Re:(4)
At 02:48 AM 1/20/00 -0800, [EMAIL PROTECTED] wrote: >Hi Bob, > >I just realized that there are two bugs in my code and a bug in your specs: thank you for the correction. >Here's the fixed and improved function and rules: excellent! this is a candidate for storing as a separate script library element with your name on it. set it up so we can call do %simple_re.r from within wiki.r if you dont get to it by the weekend, then I will. 3. Your use of a single caret character "^" is not accepted by REBOL (as Andrew pointed out), because it is REBOL's string escape character. I therefore replaced it by two caret characters, "^^", where the first caret escapes the second caret, thereby restoring it as a simple character with no special functionality. 4. You don't specify suffix and prefix. I assume that they separated by a dot character ".". 5. You don't specify whether the front and end anchors ("^" and "$" respectively) must appear at the beginning (or end) of the string. Neither do you mention whether not ("?!") must appear at the beginning of the string. I assume that your example indicates that this is an implied rule. #3 I agree that I did not write ^^ when I should have. for #5 I can live with requiring at least one or the other. I am not sure if negate binds outward (?! or inward ?!( in the re library of perl. it feels outward. it can appear anywhere ahead of some other subgroup but I do not know of more complicated uses than up front once so I will leave that one alone too. {-} [EMAIL PROTECTED]
[REBOL] How do I test for simple regex from external string Re:(5)
Thanks for the contribution -- I always learn something worthwhile from seeing really different approaches to a problem! [EMAIL PROTECTED] wrote: > >Apologies in advance if I'm missing the mark (haven't been >able to really read this or any other thread very deeply >lately, but isn't the situation you are addressing one of sets: > I can see why it would appear that way (especially given the simple examples to date) but there's much more to it. (I suppose we could say "sets in context", I'd have to think hard about whether that was adequate.) Each regular expression does, in fact, describe a set of strings, but does so by describing the syntax required of any string in (or, as we'll cover in a moment, out of) the target set. Since these sets can be arbitrarily large, it's often infeasible to perform the test by explicit operations over the set of possible valid strings. The regular expression (RE) itself specifies whether the context of the explicitly-matched characters is relevant, and whether the match is a "succeed if matched" or "succeed if not matched" test. The limitation of the code you presented is that it ignores some of the context and partial-description issues. Let me give a few slightly more interesting examples, and ask if you can see a simple way to extend your code to handle them. Examples: (The slashes are simply the default RE delimiters -- I'm using them to avoid bogging down in escape character issues) /(zip|gz)$/ will match any string that ENDS in "zip" or "gz"; /^(reb|lis|sch)/ matches any string that BEGINS with one of the three-letter combinations listed; /^(larry|curly|moe)$/ will only match the three words EXACTLY as given (beginning to end, with no prefixes or suffixes allowes); /(ix|ux)/ will match any string that contains either of the two-letter combinations ANYWHERE, regardless of context (as in "unix", "unixes", "Nixon", etc.); and /^(?!(Win|win|MS))/ will match the name of any state-of-the-art operating system (by excluding "windows", "Win32", "Windows 2000", "MS-DOS", etc. ;-) -jn-
[REBOL] Re: Pulling values from parsed HTML ... more REGEX trouble
Hello [EMAIL PROTECTED]! On 20-Gen-00, you wrote: r> I still can't do what I need to do! Tell me if this can be useful: >> html-source: { { {ALPHAONE {BETATWO {DUMMY LINE ONE {GAMMATHREE {DELTAFOUR {DUMMY LINE TWO {EPSILONFIVE { {} == { ALPHAONE BETATWO DUMMY LINE ONE ... >> parse-html html-source == ["ALPHA" "ONE" "BETA" "TWO" "GAMMA" "THREE" "DELTA" "FOUR" "EPSILON" "FIVE"] >> foreach [name value] parse-html html-source [ [print [name "=" value] [] ALPHA = ONE BETA = TWO GAMMA = THREE DELTA = FOUR EPSILON = FIVE This function has the advantage to be able to parse malformed HTML too: >> malformed-html: { {I hope you don't have to cope with things like this! { {You don't wantthis, do you? { {Some unwanted content... { { {Bla bla bla { Hey, look: this is very bad HTML! { { { {ALPHA { {ONE {...abcde { {BETATWO {and so on... { { { {} == { I hope you don't have to cope with things like this! You don't wantthis, do you? Some unwan... >> parse-html malformed-html == ["^/^/ALPHA" "^/^/ONE" "BETA" "TWO"] It will also accept other tags inside the cells, stripping them: >> parse-html {Some tags hereetc.} == ["Some tags here" "etc."] And now, here's the code. It is a state machine, so perhaps there are simpler ways to do this, but this is very flexible. REBOL [] html-rule: [some [tag | text]] tag: [ "<" [ "TABLE" (start-table) | "/TABLE" (end-table) | "TD" (start-cell) | "/TD" (end-cell) | "TR" (start-row) | "/TR" (end-row) | none ] thru ">" ] text: [ copy content some characters (process content) ] characters: complement charset "<>" result: make block! 10 buffer: make block! 10 discard: func [ "Discards unwanted content" content [string!] ] [] store: func [ "Store content" content [string!] ] [ append last buffer content ] process: :discard in-row: reduce [ func [ "Cell start" ] [ append buffer make string! 100 process: :store ] func [ "Cell end" ] [ process: :discard ] ] not-in-row: reduce [none none] in-table: reduce [ none none func [ "Row start" ] [ set [start-cell end-cell] in-row clear buffer process: :discard ] func [ "Row end" ] [ if 2 = length? buffer [ append result buffer ] set [start-cell end-cell] not-in-row process: :discard ] ] not-in-table: reduce [none none none none] set [start-cell end-cell start-row end-row] not-in-table start-table: func [ "Table start" ] [ set [start-cell end-cell start-row end-row] in-table ] end-table: func [ "Table end" ] [ set [start-cell end-cell start-row end-row] not-in-table ] parse-html: func [ "Parse the HTML source" html [string!] ] [ clear result parse/all html html-rule result ] Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] Openletter to Rebol HQ. Re:(8)
I'm new to Rebol, and have been only slightly informed of this thread. In matters of both Open-source and ODBC, there are both advantages and disadvantages. I would like to offer a slight different train of thought: Why not consider offering object modules (not source) that could be optionally compiled into the rebol interpreter, depending on the user's needs? As a C/C++ programmer, who does a lot of Database/CGI work, I've been under-impressed by the different external DB resources out there. I'm just in the process of implementing the Mix Database Toolchest. ISAM/BTree library written in C. Maybe the Rebol folks and the Mix folks coul talk? Could be a marriage made in heaven! Just a thought. tim At 09:56 AM 1/20/00 -0600, you wrote: >[EMAIL PROTECTED] wrote: >> >> Whether the beta ships this week or next week, let us not lose from >> sight, what it is that we are talking about. We are not talking >> about extending REBOL with a GUI interface! >> >> We are talking about adding REBOL to GUI applications. GUI >> applications become programmable in REBOL! This is GUI applications >> with Internet processing programmable in REBOL! This is Internet >> applications with GUIs programmable in REBOL! Big difference! >> > ... >> >> There are millions and millions of people out there, who are >> comfortable with a mouse and who expect that they can start up an >> application and make choices from menus in order to accomplish >> their tasks. These people will be able to use our scripts. >> This is important! >> > >It's really too bad that experienced users like Elan have become >so jaded that they can't get excited about the future of REBOL... > >;-} > >Seriously, I think Elan's right on target about the importance of >GUI capabilities to the great masses. Those of us that are happy >with a text-based interaction (or who write server scripts, etc.) >are definitely in the minority. As long as we are writing code >just for ourselves to use, or to be hidden in a server somewhere, >text mode is fine. However, if I want to write scripts for non- >technical human users, I want the tools to make it easy for them >to appreciate the beauty of my work! ;-) > >I think there's a significant market for REBOL code which will >only open up when T. C. Mits can drive it with pretty pictures. > >-jn- > >P.S.: The prospect of early availability of REBOL/View only >increases my desire for comprehensive docs. Please, please, >please, please > >
[REBOL] POST method under IIS3/4
Hi folks, It's me again. I'm not sure if my mail got lost in the large number of posts in the last few days or if nobody knows the answer. Can anyone who has succeded in getting the POST method to be used with webbased forms under IIS3/4 tell us how they managed it. The GET method works fine (with the additional check on the query string) but my form holds too much data to be sent as a GET. Ofcourse POSTs work fine under apache which only makes if even more annoying to wonder what M$ has been doing with their server software. :( All the best, Ed. -- _ \___ \ /\ / ___// ICQ: 34895924 | \ \\_/\_// __// TWF Home : http://www.worldfoundry.com/ |_ /__\/_// CEG Home : http://www.worldfoundry.com/ceg/ = The World Foundry LLC - Amiga PPC - Explorer 2260 - Maim & Mangle God isn't dead, he just couldn't find a parking place.
[REBOL] [REBOL] How do I simulate CGI? Re:
Hi Elan: Thanks for that tip. Actually, I use a multi-stage process (I've been using compiled apps with C/C++); 1)First write and debug in a console mode, redirecting html stdout to a test file. 2)Then run with web browser against Microsoft Personal Web Server. 3)Then port to server. In many cases, Rebol will be more suitable, and I know that my approaches to the development cycle may have to change. My next step, I suppose, will be to configure Microsoft Personal Web Server to work with Rebol. Any tips or comments? Regards Tim At 02:48 PM 1/19/00 -0800, you wrote: >At 12:28 PM 1/19/00 -0900, you wrote: >>I am a CGI programmer new to Rebol. >> >>In previous work, I have begun a project >>by simulating the CGI environment on my >>desktop and redirecting output from stdout >>to a file. > >I have installed Apache on my MS Windows desktop machine and run a Web >browser against it to simulate cgi. > >;- Elan >> [: - )] > >
[REBOL] How do I simulate CGI? Re:(2)
Thanks!! It worked. Tim At 02:47 PM 1/19/00 -0800, you wrote: >> >>;;;query-string is redefined to simulate input from a form >>query-string: "name=tim&[EMAIL PROTECTED]&phone=9005551212" >>cgi: make object! decode-cgi system/options/cgi/query-string > >cgi: make object! decode-cgi query-string > >will work in your example, as will > >system/options/cgi/query-string: >"name=tim&[EMAIL PROTECTED]&phone=9005551212" >cgi: make object! decode-cgi system/options/cgi/query-string > > >Explanation: > >You are creating a global word query-string here => >>query-string: "name=tim&[EMAIL PROTECTED]&phone=9005551212" > >however you are passing decode-cgi a different query-string word embedded >in an object here: >>cgi: make object! decode-cgi system/options/cgi/query-string > >this .../cgi/query-string is a different query-string from your query-string. > >This has to do with contexts. The object cgi, in the path system/options >has its own context and system/options/cgi/query-string is limited to the >cgi object's context (unless its context is extended by referencing it from >outside the cgi object. Don't worry about that just now.) When you create >query-string as a glocal word - which is what happens by default when you >do what you did - it does not affect the query-string in the context of cgi >object. > >use probe system/options/cgi > >to see the contents of the cgi object. > >use => >system/options/cgi/query-string: >"name=tim&[EMAIL PROTECTED]&phone=9005551212" > >to more realistically simulate the situation you will encounter when you >run the script as a cgi script. > >Hope this helps > >;- Elan >> [: - )] > >
[REBOL] Openletter to Rebol HQ. Re:(7)
[EMAIL PROTECTED] wrote: > > Whether the beta ships this week or next week, let us not lose from > sight, what it is that we are talking about. We are not talking > about extending REBOL with a GUI interface! > > We are talking about adding REBOL to GUI applications. GUI > applications become programmable in REBOL! This is GUI applications > with Internet processing programmable in REBOL! This is Internet > applications with GUIs programmable in REBOL! Big difference! > ... > > There are millions and millions of people out there, who are > comfortable with a mouse and who expect that they can start up an > application and make choices from menus in order to accomplish > their tasks. These people will be able to use our scripts. > This is important! > It's really too bad that experienced users like Elan have become so jaded that they can't get excited about the future of REBOL... ;-} Seriously, I think Elan's right on target about the importance of GUI capabilities to the great masses. Those of us that are happy with a text-based interaction (or who write server scripts, etc.) are definitely in the minority. As long as we are writing code just for ourselves to use, or to be hidden in a server somewhere, text mode is fine. However, if I want to write scripts for non- technical human users, I want the tools to make it easy for them to appreciate the beauty of my work! ;-) I think there's a significant market for REBOL code which will only open up when T. C. Mits can drive it with pretty pictures. -jn- P.S.: The prospect of early availability of REBOL/View only increases my desire for comprehensive docs. Please, please, please, please
[REBOL] REBOL/View vs. OpenAmulet? Re:(6)
Ted wrote: > Is Friday a lock? I thought strict deadlines lead to more bugs and longer development time. Gisle
[REBOL] Character encoding/decoding
Hi, there was a demand for a decoding/encoding program between MAC and PC. Here's the one I use for some Czech code pages: Rebol [ Title: "Code" Date: 27/10/1999 File: %code.r ] ; a function to translate coding table into a 256 character string translate-coding: func[table [block!] /local result] [ ; create a 256-character string result: make string! 256 ; and fill it with identical encoding for i 0 255 1 [append result to-char i] ; change the encoding according to the given table foreach [chr nchr] table [ change skip result to-integer chr nchr ] result ] code: func ["Encode/decode text" input [file! string! port!] "input text" output [file! string! port!] "output text" table [string!] "encoding info" /local chr nchr ] [ if file? input [input: open/read input] if file? output [ if exists? output [delete output] output: open/new output ] while [not tail? input] [ chr: first input nchr: first skip table to-integer chr output: insert output nchr input: next input ] if port? input [close input] if port? output [close output] ] ; Example: ; table1 contains encoding information - pairs of type: ; source-character result-character ; this example is used for some Czech encoding/decoding ; it may not survive the e-mail transport table1: [ #""#"É" #"e"#"ý" #"¬"#"C" #"µ"#"Á" #"í"#"Ý" #"Ö"#"Í" #"é"#"Ú" #" "#"á" #"?"#"í" #"z"#"c" #"R"#"e" #"ý"#"r" #"L"#"ú" #"."#"u" #"¦"#"Z" #"ü"#"R" ] ; table2 contains translated encoding information table2: translate-coding table1 ; now the work: result: copy "" code "ü¦" result table2 result
[REBOL] Cursors Re:(2)
Try this: Goto Start -> RUN -> type "winfile" and click [ok]. From the pull down "File" menu select "associate". Type "r" in the window and remove any settings for it or REBOL that are found. Close the open windows. Launch Windows Explorer and locate the script "r" file you want to launch with REBOL. Now highlight the script file and (right click with your mouse the highlighted file) -> select "Open With" from the right click menu and browse to the REBOL.EXE file. You sould also check your path statements and include a path statement on your machine to the REBOL.EXE directory. Good luck. From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 20, 2000 4:10 AM Subject: [REBOL] Cursors Re: > Hi Phil, > > It sounds like you have two different versions of REBOL installed in > different locations. Check the version number on each and see if they are > different. The cursor was changed in 2.2 I think with the new console code. > Hope this helps. > > - jim > > At 07:22 AM 1/20/00 +, you wrote: > >I use Rebol on Win32 (Windows 98) - when I launch Rebol from my quicklaunch > >toolbar I get a console with a block cursor. > > > >If I click on a .r in Explorer I get an I bar cursor. > > > >How do I control this?? > > > >Cheers Phil > > >
[REBOL] Rebol CGIs on Personal Web Server (Win98)? Re:(2)
I havent tried this but you might want to setup the application mappings as specified in the How To's in your explorer file options. It would appear that the %s %s is very important not sure why but seen that with other languages as well. Let me know how this goes. I will try it when I get the chance. I will collect some of the information I get from the list and other on win32 platforms and put together some How To's for CGI on win32 platforms. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 20, 2000 6:00 AM Subject: [REBOL] Rebol CGIs on Personal Web Server (Win98)? Re: > Stefan Falk wrote: > > I've been trying to get Rebol CGI scripts running on a Microsoft Personal > Web Server, but it just won't work. It just pops up a window (like it's > downloading) for about 1 sec, then it closes it and nothing else happens. I > tried to look in the Help files and I've come to the conclusion that I need > to "Set Application Mappings", however, this option seems to be available > only to IIS servers. Anyone got any idea of how to make it work with PWS? > > Actually, I just got REBOL working on my own MS Personal Web Server, about > an hour or two or three ago. It works well, and I like it. > > What do you need to do? > > There's this from Allen K: > > Copied from a post by Ira from June 1999). Following these directions is how > I got REBOL working on PWS.. > > Add a new string value to: > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Script > Map with name of .r (this is the suffix for the rebol script) and data > value of > > c:\rebol\rebol.exe -cs %s > > (obviously substitute the appropriate path to your executable). > > Your rebol cgi scripts should reside in your PWS Scripts directory. > > > I changed: > c:\rebol\rebol.exe -cs %s > to suit my directory: > C:\PROGRA~1\REBOL\REBOL.EXE -cs %s %s > I also added another "%s", due to my own FUD. > > Then I _restarted_ my computer, after I found that it didn't seem to work. I > put REBOL cgi script/s here: > C:\Inetpub\scripts > > In my copies of REBOL cgi scripts, for this: > system/options/cgi/query-string > I substituted this: > either none? system/options/cgi/query-string [ > "" > ][ > system/options/cgi/query-string > ] > > Otherwise 'decode-cgi complained about invalid strings. > > In Personal Web Manager, I made sure that PWS was on and that the /scripts > directory (from the advanced tab), had all permissions on. > > Then I clicked on my home page and added to the existing url: > scripts/tictac.r > and it all went. > > I hope that helps! > > If not, I'll be awake sometime later tomorrow/today/yesterday. > > It's probably in the wrong order, but do it all and restart, and it should > go! > > Andrew Martin > You feel sleepy, very sleepy... > ICQ: 26227169 > [EMAIL PROTECTED] > http://members.xoom.com/AndrewMartin/ > -><- > >
[REBOL] REBOL/View vs. OpenAmulet? Re:(7)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 20, 2000 1:11 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] REBOL/View vs. OpenAmulet? Re:(6) > REBOL script using the new parse block capability. Hi, will this feature make it into /Core too? Having a official way to do dialecting would be great. Robert
[REBOL] REBOL/View vs. OpenAmulet? Re:(3)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 20, 2000 10:39 AM > To: [EMAIL PROTECTED] > Subject: [REBOL] REBOL/View vs. OpenAmulet? Re:(2) > 2. There was no massive outburst of complaints, as November > and December went by. Hi, as I'm doing development myself I know how hard these things are to predict and that a given date is more like a range... therefore I won't yell to loud. BTW: I did asked about the state several times but without any response... > 3. There was no massive outburst of complaints when Carl > announced that > there would be REBOL/View beta beginning in approx. mid Januar. That > announcement, I believe, was made some time in December or > early Januar. I have to say that I was (am) quite irritated over this. What's the position RT is taking? As JB noted, I don't expect /View to take over the world in months (maybe I'm wrong) too. Further I'm not related to RT in any way, so it's their decision what to do and after recognizing this massive movement to /View and 'loose' on /Core topics, I started to complain (BTW: I didn't expected such a huge response :-|) > You couldn't have overlooked, since there were well over > fifty (I didn't > count) responses, with people asking to participate in the beta. Yep, and I didn't participated (yet ;-)). I hoped that Carl would just give some clarifying 'feel good on all sides' statement. The problem is basing a big project on a tool which is quite new, yet not very wide spread/known and under heavy development can be your killer... I want to avoid this because Rebol looks & feels like the right tool, and it definitely is if it keeps focused where it (first) belongs to. > 4. Why do you wait til the time for REBOL/View beta has > arrived and then > you start yelling at the top of your lungs that you want a > REBOL/Command beta instead of REBOL/View? As said, I asked for some comments several times... further I don't want to bother anybody by going mad to early ;-). BTW: It seems that there are quite a lot of people are interested in /Command and as there was no option to sign in for /Command beta yet I'm not sure which side will have more participants. > You know Robert, you are playing one product against the other and my > experience with companies has been that the more customers > tend to complain and make demands, the more careful and bureaucratic > the respective companies become. Nope, I'm not involved in any decisions, I'm a Rebol user and I have to get my job done. RT has positioned Rebol/Core as a scripting-language (I know it's more but that's at least the fact known to the world) and without /Command this language is missing a 'must-have' feature to be taken serious. Integration of /Command will lead to the 'compelling-reason-to-use-it'. That's what I want to show, I'm highly interested in Rebol becoming the defacto-standard-scripting-language. And if you read back, I never have asked for a release date or something like this, I'm more concerned about the direction RT takes. As I know that most companies are under-staffed some trade-offs have to be taken, I just want to provide some information to help RT see where its customers are (yes, I paid the bucks for Rebol/Core 1.0). > I'd rather see Carl occassionally be uncareful on this list > and speak about > his future plans, and dreams, and intentions and visions and make > announcements, without having to consult with his business and product > development advisors, his attorneys and/or PR people, you > know what I mean. Of course, companies should follow the release-often-release-early pattern. Keep your community satisfied, it's even better to let the people get a feeling for what's going on. I won't pin anybody down to a feature once stated... > I think we all stand to gain if Carl feels that he can freely > speak here, I think he know this, it's his company. > make announcements, change his mind, and talk with us like > his friends, I don't see why this won't be possible. > not like with a bunch of wining and complaining "I'm end user" > "I'm customer" type of people. Beside being a friend, customer and end-user of Rebol I don't think that someone can shut-off someone else on this list... and I hope it didn't looks like I wanted this. > Judging from what I've seen of REBOL so far, IMHO Carl has > accomplished the > most exciting development in computer languages for at least > since the mid eighties. Yes, Rebol is cool! Never said anything else. > You know what, I think Carl deserves to enjoy his work. I'm sure he does. > Ok, I'm biased, I need REBOL/View for my work, I can't wait > to start using REBOL/View. What have you done till today than? > There was plenty of time to complain about REBOL/Command beta > in points 1. > ... 3. > > Now's the time to sit back and enjoy REBOL/View. If this is your way ok, mine is different. I won't stop contributing in any way and just sit and wait. Rebolutions a
[REBOL] REBOL/View vs. OpenAmulet? Re:(6)
At 06:54 AM 1/20/00 -0500, you wrote: >Thanks for your reply, Jim. Much appreciated. > No problem! Something to do between builds... ;-) >On 1/2/2000 at 5:02 PM [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >{ >There is a bonus for those of you who like technical challenges. >REBOL/View will include its GUI dialect source code. That gives >you the power to enhance the GUI as well as create your own custom GUI >dialect, say for interactive TV, kiosks, games, or whatever. >} > >So, is the "GUI dialect source code" REBOL script or C source? > REBOL script using the new parse block capability. >{ >Documentation will be included with the beta. >} > >Is the documentation ready for pre-ase yet? Might help to take the edge >off. > >Is Friday a lock? > I don't make that decision, but we're crankin' away here at 4am ... ! - jim
[REBOL] REBOL/View vs. OpenAmulet? Re:(5)
Thanks for your reply, Jim. Much appreciated. On 1/20/2000 at 3:37 AM [EMAIL PROTECTED] wrote: { What was said was that there would be two levels of access to VIEW functionality. One would be a high level dialect for quickly and easily generating composited graphical interfaces. Second would be full disclosure of the underlying function API and data objects that are used to directly manipulate the interface. This allows for the creation of other dialects targetted for specific domains. } On 1/2/2000 at 5:02 PM [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: { There is a bonus for those of you who like technical challenges. REBOL/View will include its GUI dialect source code. That gives you the power to enhance the GUI as well as create your own custom GUI dialect, say for interactive TV, kiosks, games, or whatever. } So, is the "GUI dialect source code" REBOL script or C source? { Documentation will be included with the beta. } Is the documentation ready for pre-ase yet? Might help to take the edge off. Is Friday a lock? -Ted. *** REPLY SEPARATOR *** At 05:54 AM 1/20/00 -0500, you wrote: >But the source for REBOL/View will be released, hopefully with the >beta, which we are now told will be released Friday. > >Personally, I think it is very important that RT meet the Friday >deadline. It's a beta that will not be closed-source, so if there are >blemishes, we can offer fixes, and RT can release again. Hopefully, >there will also be a VIEW mailing list where interested parties can >discuss this. Hi Ted, I'm sorry to disappoint you, but I think someone has misconstrued what Carl actually said. The C source code to REBOL/view will NOT be released. What was said was that there would be two levels of access to VIEW functionality. One would be a high level dialect for quickly and easily generating composited graphical interfaces. Second would be full disclosure of the underlying function API and data objects that are used to directly manipulate the interface. This allows for the creation of other dialects targetted for specific domains. At the moment the function API consists of just three natives ( show, hide and size-text ) and two mezzanine functions ( view and do-events ). There are a number of additional datatypes, PAIR such as 200x300 for specifying positions and dimensions, EVENT for receiving mouse, timer, keyboard and other events from an event port ( which is a new port type ), and an IMAGE type. There are a number of data objects, but I don't have time to list them now. Documentation will be included with the beta. The real power is in the data objects. Trust me, REBOL/view will be a unique experience! - jim
[REBOL] REBOL/View vs. OpenAmulet? Re:(4)
At 05:54 AM 1/20/00 -0500, you wrote: >But the source for REBOL/View will be released, hopefully with the >beta, which we are now told will be released Friday. > >Personally, I think it is very important that RT meet the Friday >deadline. It's a beta that will not be closed-source, so if there are >blemishes, we can offer fixes, and RT can release again. Hopefully, >there will also be a VIEW mailing list where interested parties can >discuss this. Hi Ted, I'm sorry to disappoint you, but I think someone has misconstrued what Carl actually said. The C source code to REBOL/view will NOT be released. What was said was that there would be two levels of access to VIEW functionality. One would be a high level dialect for quickly and easily generating composited graphical interfaces. Second would be full disclosure of the underlying function API and data objects that are used to directly manipulate the interface. This allows for the creation of other dialects targetted for specific domains. At the moment the function API consists of just three natives ( show, hide and size-text ) and two mezzanine functions ( view and do-events ). There are a number of additional datatypes, PAIR such as 200x300 for specifying positions and dimensions, EVENT for receiving mouse, timer, keyboard and other events from an event port ( which is a new port type ), and an IMAGE type. There are a number of data objects, but I don't have time to list them now. Documentation will be included with the beta. The real power is in the data objects. Trust me, REBOL/view will be a unique experience! - jim
[REBOL] Rebol CGIs on Personal Web Server (Win98)? Re:(2)
Thanks! I won't be able to try it right away since I'm at work, but I'll give it a go when I come home. Cheers Stefan Falk > -Original Message- > From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] > Sent: den 20 januari 2000 13:00 > To: [EMAIL PROTECTED] > Subject: [REBOL] Rebol CGIs on Personal Web Server (Win98)? Re: > > Stefan Falk wrote: > > I've been trying to get Rebol CGI scripts running on a Microsoft > Personal > Web Server, but it just won't work. It just pops up a window (like it's > downloading) for about 1 sec, then it closes it and nothing else happens. > I > tried to look in the Help files and I've come to the conclusion that I > need > to "Set Application Mappings", however, this option seems to be available > only to IIS servers. Anyone got any idea of how to make it work with PWS? > > Actually, I just got REBOL working on my own MS Personal Web Server, about > an hour or two or three ago. It works well, and I like it. > > What do you need to do? > > There's this from Allen K: > > Copied from a post by Ira from June 1999). Following these directions is > how > I got REBOL working on PWS.. > > Add a new string value to: > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Scri > pt > Map with name of .r (this is the suffix for the rebol script) and data > value of > > c:\rebol\rebol.exe -cs %s > > (obviously substitute the appropriate path to your executable). > > Your rebol cgi scripts should reside in your PWS Scripts directory. > > > I changed: > c:\rebol\rebol.exe -cs %s > to suit my directory: > C:\PROGRA~1\REBOL\REBOL.EXE -cs %s %s > I also added another "%s", due to my own FUD. > > Then I _restarted_ my computer, after I found that it didn't seem to work. > I > put REBOL cgi script/s here: > C:\Inetpub\scripts > > In my copies of REBOL cgi scripts, for this: > system/options/cgi/query-string > I substituted this: > either none? system/options/cgi/query-string [ > "" > ][ > system/options/cgi/query-string > ] > > Otherwise 'decode-cgi complained about invalid strings. > > In Personal Web Manager, I made sure that PWS was on and that the /scripts > directory (from the advanced tab), had all permissions on. > > Then I clicked on my home page and added to the existing url: > scripts/tictac.r > and it all went. > > I hope that helps! > > If not, I'll be awake sometime later tomorrow/today/yesterday. > > It's probably in the wrong order, but do it all and restart, and it should > go! > > Andrew Martin > You feel sleepy, very sleepy... > ICQ: 26227169 > [EMAIL PROTECTED] > http://members.xoom.com/AndrewMartin/ > -><- >
[REBOL] Rebol CGIs on Personal Web Server (Win98)? Re:
Stefan Falk wrote: > I've been trying to get Rebol CGI scripts running on a Microsoft Personal Web Server, but it just won't work. It just pops up a window (like it's downloading) for about 1 sec, then it closes it and nothing else happens. I tried to look in the Help files and I've come to the conclusion that I need to "Set Application Mappings", however, this option seems to be available only to IIS servers. Anyone got any idea of how to make it work with PWS? Actually, I just got REBOL working on my own MS Personal Web Server, about an hour or two or three ago. It works well, and I like it. What do you need to do? There's this from Allen K: Copied from a post by Ira from June 1999). Following these directions is how I got REBOL working on PWS.. Add a new string value to: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Script Map with name of .r (this is the suffix for the rebol script) and data value of c:\rebol\rebol.exe -cs %s (obviously substitute the appropriate path to your executable). Your rebol cgi scripts should reside in your PWS Scripts directory. I changed: c:\rebol\rebol.exe -cs %s to suit my directory: C:\PROGRA~1\REBOL\REBOL.EXE -cs %s %s I also added another "%s", due to my own FUD. Then I _restarted_ my computer, after I found that it didn't seem to work. I put REBOL cgi script/s here: C:\Inetpub\scripts In my copies of REBOL cgi scripts, for this: system/options/cgi/query-string I substituted this: either none? system/options/cgi/query-string [ "" ][ system/options/cgi/query-string ] Otherwise 'decode-cgi complained about invalid strings. In Personal Web Manager, I made sure that PWS was on and that the /scripts directory (from the advanced tab), had all permissions on. Then I clicked on my home page and added to the existing url: scripts/tictac.r and it all went. I hope that helps! If not, I'll be awake sometime later tomorrow/today/yesterday. It's probably in the wrong order, but do it all and restart, and it should go! Andrew Martin You feel sleepy, very sleepy... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] OpenSource REBOL Re:(11)
I, too, thought the transputer was a great idea at the time. Andrew Martin ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><- - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, 20 January 2000 10:00 PM Subject: [REBOL] OpenSource REBOL Re:(10) > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 20, 2000 8:32 AM > > To: [EMAIL PROTECTED] > > Subject: [REBOL] OpenSource REBOL Re:(9) > > > One last thought: it's all about the market, not about technology. > > I totally agree here! (Looks like we have made same experience...) > > > Technology --- tools --- are the enabler. > > That's it, what does a good technology help if it's not used? And for most > people the technology isn't (shouldn't) be visible at all. > > > The litany of companies that have had great tech that ultimately > > washed out in the marketplace is endless: Inmos with the Transputer, > > Oho, someone who knows the great Transputer :-)) Robert >
[REBOL] How do I test for simple regex from external string Re:(3)
Hi Bob, I just realized that there are two bugs in my code and a bug in your specs: 1. You wrote: >excluded-files: {^(?!(notxt|ask_new|only_owner_may_edit))} >is-memberof-re excluded-files "myfavoritemartian.html" >>> false Note that excluded-files contains a negate instruction "?!(". Therefore, what we are looking for is NOT the list of options. In other words, anything that does NOT match any of the options should evaluate to TRUE. Therefore >is-memberof-re excluded-files "myfavoritemartian.html" should evaluate to TRUE, not to FALSE, as you proposed in your example. What's a little misleading is that you called the string excluded-files. One tends to think that files that do not match the options in the string are files that are not being excluded, and therefore if a file does not match the list, it should be FALSE == do not exclude this file. Then again, one could also interpret the name of this list as saying, all files that are in this list are included, therefore, when you negate the list, you get the excluded files, which means that TRUE == this a file not contained, excluded from this list. In any event, the negation instruction is there, which means that: 1. If a file MATCHES one of the conditions in the list, a) then the match will return true, b) since we are instructed to negate, true becomes false c) therefore we report the fact that a file matched some item in the list as FALSE. 2. If a file did NOT MATCH any of the conditions in the list, a) then all matches return false b) we are instructed to negate, therefore false becomes true c) therefore we report that a file did not match any of the items in the list as TRUE. It did not match any prefixes in the list, aha, it is indeed a file that is excluded from the list, return TRUE, yep, it's an excluded file. 2. Where I say either not all [front-anchor end-anchor] [ return false it should be either not any [front-anchor end-anchor] [ return false 3. Where I say either use-negate [ return not all check-block it should be either use-negate [ return not any check-block 4. It would have been more elegant to retrieve the options from the string while we are parsing it. It would have saved us a few lines of code in the function, the mark: and end: in the rules, and the rule for checking for closing paren, at the expense of one additional rule to collect the options. Here's the fixed and improved function and rules: REBOL [] verbose: off ;- set to on in order to trace operation vprint: func [string] [ if verbose [print string] ] reset: func [] [ front-anchor: end-anchor: use-negate: false condition-block: make block! [] ] front-anchor-rule: [thru "^^(" mark: (vprint "found front-anchor" front-anchor: true)] negate-rule:[thru "?!(" mark: (vprint "in negate-rule" use-negate: true)] end-anchor-rule: [thru ")$" end: (vprint "found end-anchor" end-anchor: true)] collect-options: [some [copy condition to "|" (vprint rejoin ["in collect-options" condition] append condition-block condition) skip] ] parse-rule: [(reset) some [front-anchor-rule | negate-rule] collect-options end-anchor-rule to end ] is-memberof-re: func [ condition [string!] candidate [string!] /local check-block match ] [ parse condition parse-rule vprint mold condition-block either all [front-anchor end-anchor] [ match: candidate ][ either not any [front-anchor end-anchor] [ return false ] [ if (length? parse candidate ".") = 1 [return false] match: do either front-anchor [ :first ] [ :second ] parse candidate "." ] ] check-block: foreach option condition-block [append [] (= match option)] vprint mold check-block either use-negate [ return not any check-block ] [ return any check-block ] ] userlist: {^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$} current-user: "bobr" excluded-files: {^^(?!(notxt|ask_new|only_owner_may_edit))} print [ "is-memberof-re userlist current-user:" is-memberof-re userlist current-user ] print [ "is-memberof-re excluded-files myfavoritemartian.html:" is-memberof-re excluded-files "myfavoritemartian.html" ] ;- end ;- Elan >> [: - )]
[REBOL] REBOL/View vs. OpenAmulet? Re:(3)
On 1/20/2000 at 1:38 AM [EMAIL PROTECTED] wrote: { But besides that, I'd like Carl to know that he's not our butler (James, where is REBOL/Command?), but that we appreciate the work he has invested in the design and implementation of REBOL and if he thinks its a better idea to put off REBOL/Command for a little time longer, and launch REBOL/View instead, then we are here to back him, and we are here to share the excitement of launching REBOL/View with him. } As you mentioned, Elan, there was not a hue and cry when the REBOL/Command date slipped. It's a significant closed-source project, and will probably stay that way, and we all know what that means. But the source for REBOL/View will be released, hopefully with the beta, which we are now told will be released Friday. Personally, I think it is very important that RT meet the Friday deadline. It's a beta that will not be closed-source, so if there are blemishes, we can offer fixes, and RT can release again. Hopefully, there will also be a VIEW mailing list where interested parties can discuss this. And then perhaps we can also at least get some hard details about /COMMAND -- so some of us can work on things it will not do. Right now, /COMMAND is cited as a silver-bullet for every problem, causing endless FUD. If the beta is not ready, at this point, we really should be asking for at least a hard specification, or a heart-to-heart, developer-to-developer description of the problem. As you point out, we're all friends here. -Ted.
[REBOL] How do I test for simple regex from external string Re:(4)
bobr wrote: > sub userInList { my ($user, $userlist) = @_; > $user =~ s/$userlist//; # a perfect match erases all chars > return ( $user eq "" ) ? 1 : 0; > } The equivalent in REBOL, using REBOL datatypes is: userInList: func [user [string!] userList [block!]] [ found? find userList user ] To use PERL data types: ; We need a helper function RegExp_Block: func [RegExp [string!] /local Exps Exp Exp_Rule][ Exps: make block! 10 Exp: make string! 30 Exp_Rule: [ copy Exp [to "|" | to ")$"] (append Exps Exp) [thru "|" | thru ")$"] ] try [parse/all RegExp ["^^(" some Exp_Rule to end] Exps] ] userInList: func [user [string!] userList [string!]][ found? find RegExp_Block userList user ] REBOL console: >> userInList ask "User: " ask "userList: " User: andrew userList: ^(bobr|andrew|me" halt "pi == true >> userInList ask "User: " ask "userList: " User: andrew userList: ^(bobr|andrew|me" halt "pi|me"hum"m^(q)|jeff)$ == true >> userInList ask "User: " ask "userList: " User: me"hum"m^(q) userList: ^(bobr|andrew|me" halt "pi|me"hum"m^(q)|jeff)$ == true >> userInList ask "User: " ask "userList: " User: intruder userList: ^(bobr|andrew|me" halt "pi|me"hum"m^(q)|jeff)$ == false I'll let someone else do the other part. I hope that helps! Andrew Martin Needing sleep... ICQ: 26227169 [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ -><-
[REBOL] OpenSource REBOL Re:(10)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 20, 2000 8:32 AM > To: [EMAIL PROTECTED] > Subject: [REBOL] OpenSource REBOL Re:(9) > One last thought: it's all about the market, not about technology. I totally agree here! (Looks like we have made same experience...) > Technology --- tools --- are the enabler. That's it, what does a good technology help if it's not used? And for most people the technology isn't (shouldn't) be visible at all. > The litany of companies that have had great tech that ultimately > washed out in the marketplace is endless: Inmos with the Transputer, Oho, someone who knows the great Transputer :-)) Robert
[REBOL] Openletter to Rebol HQ. Re:(2)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 19, 2000 7:19 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] Openletter to Rebol HQ. Re: > my priorities are a little different. No problem. > 1. With the exception of a few minor glitches (and some very > rare crashes) REBOL/Core is currently doing most of what I would like > to see it do. It would be helpful if you posted a more detailed list > of items that you think are missing. Well, here are some: - external program execution - database connection - possible binary script format for distribution (see encryption thread) - better error handling (error messages) - interactive debugger (I know this will need some kind of GUI ;-)) - way to combine Rebol/Core with a script as one exe - better documentation - native dialect support, or how it should look like Robert
[REBOL] Cursors Re:
Hi Phil, It sounds like you have two different versions of REBOL installed in different locations. Check the version number on each and see if they are different. The cursor was changed in 2.2 I think with the new console code. Hope this helps. - jim At 07:22 AM 1/20/00 +, you wrote: >I use Rebol on Win32 (Windows 98) - when I launch Rebol from my quicklaunch >toolbar I get a console with a block cursor. > >If I click on a .r in Explorer I get an I bar cursor. > >How do I control this?? > >Cheers Phil >
[REBOL] Re: Openletter to Rebol HQ. Re:(6)
Hello [EMAIL PROTECTED]! On 19-Gen-00, you wrote: i> Carl mentioned in December (was it in December?) that he i> expected Beta testing of the GUI version will begin in the [etc...] I agree wholeheartedly (sp?). [I know, it's another band-consuming "me-too" message... sorry about that.] Regards, Gabriele. -- o) .-^-. (--o | Gabriele Santilli / /_/_\_\ \ Amiga Group Italia --- L'Aquila | | GIESSE on IRC \ \-\_/-/ / http://www.amyresource.it/AGI/ | o) `-v-' (--o
[REBOL] BE PATIENT! - was - Openletter to Rebol HQ. Re:(3)
[EMAIL PROTECTED] wrote: > Petr, > > Your posts and support are much appreciated and always have been. > Matter of fact, the whole Open Letter thread has been very > informative and I can assure you "we are listening"...we are all > listening. It's going to take a little time, but Carl will > follow up this Open Letter thread with some good answers and details > (and maybe some questions). As for the criticism, it is taken as > offered: both constructive and accurate. REBOL is far from being > above any criticism as we have made our share of mistakes, (including > missed deadlines) but continue to hang in there and in the end we > hope to reward you! > > best regards, > > dan > > p.s. the technical team is working their a**es off to get View out > by the end of this week for Beta release...you will all love it :-) > Thanks very much, Dan, appreciated ... -pekr-
[REBOL] OpenSource REBOL Re:
On 1/19/2000 at 1:31 PM [EMAIL PROTECTED] wrote: { MySQL is a rather popular online dbms (right Randy?). MySQL supports sockets. (Perhaps other commercial dbms's also support ports connectivity. Does anyone know?) In addition to ODBC support, isn't it time to implement an OpenSource ports-based MySQL interface? } Elan, Here's an odd idea. When software development teams couldn't wait for a new machine to be built, people sometimes created an emulator for testing purposes. It wasn't as fast or clean, but it allowed development to begin. We don't have a good connection to a backend database for REBOL now. Though, some other scripting languages do. Do you think it be possible to write some REBOL "middleware" that would write a script in some other language, run that script, and then let REBOL deal with the result? Also I think some database services, like mySQL, also support standard in/out. Might that be another way to get something like REBOL and mySQL to work together? The problem with waiting for /COMMAND has become that our paying customers need solutions to proceed now. I can either make solutions in other languages that I will throw away when /COMMAND comes, or I can make solutions in REBOL to throw away (or integrate) when /COMMAND comes. -Ted.
[REBOL] REBOL/View vs. OpenAmulet? Re:(2)
Hi Robert, I share your interest in Command and Embeddable and Multimedia versions of REBOL. I think it would be good idea for REBOL/View to have access to Command type functionality, either directly or via REBOL/Command. What surprises me is that 1. REBOL/Command beta had been announced for mid November. That was two months ago. REBOL/Command beta did not commence at the time. 2. There was no massive outburst of complaints, as November and December went by. 3. There was no massive outburst of complaints when Carl announced that there would be REBOL/View beta beginning in approx. mid Januar. That announcement, I believe, was made some time in December or early Januar. You couldn't have overlooked, since there were well over fifty (I didn't count) responses, with people asking to participate in the beta. 4. Why do you wait til the time for REBOL/View beta has arrived and then you start yelling at the top of your lungs that you want a REBOL/Command beta instead of REBOL/View? You know Robert, you are playing one product against the other and my experience with companies has been that the more customers tend to complain and make demands, the more careful and bureaucratic the respective companies become. I'd rather see Carl occassionally be uncareful on this list and speak about his future plans, and dreams, and intentions and visions and make announcements, without having to consult with his business and product development advisors, his attorneys and/or PR people, you know what I mean. I think we all stand to gain if Carl feels that he can freely speak here, make announcements, change his mind, and talk with us like his friends, not like with a bunch of wining and complaining "I'm end user" "I'm customer" type of people. Judging from what I've seen of REBOL so far, IMHO Carl has accomplished the most exciting development in computer languages for at least since the mid eighties. You know what, I think Carl deserves to enjoy his work. Ok, I'm biased, I need REBOL/View for my work, I can't wait to start using REBOL/View. But besides that, I'd like Carl to know that he's not our butler (James, where is REBOL/Command?), but that we appreciate the work he has invested in the design and implementation of REBOL and if he thinks its a better idea to put off REBOL/Command for a little time longer, and launch REBOL/View instead, then we are here to back him, and we are here to share the excitement of launching REBOL/View with him. There was plenty of time to complain about REBOL/Command beta in points 1. ... 3. Now's the time to sit back and enjoy REBOL/View. ;- Elan >> [: - )]
[REBOL] How do I test for simple regex from external string Re:(4)
Howdy senator Racko: > to go from > ^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$ > which is what is literally in the input stream/file to > ["ted" "admin" "bobr" "andrew" "elan" "keith" "cheryl" "joel" "brady"] > needs to be explained. the rest using 'find is trivial. > (though you don't cover excluded values or prefixes or suffixes) Apologies in advance if I'm missing the mark (haven't been able to really read this or any other thread very deeply lately, but isn't the situation you are addressing one of sets: --- ;- given data of the form: data: {^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$} split-it: func [what][difference parse/all what "^^|$()" [""]] split-data: split-it data users: ["ted" "admin" "bobr" "andrew" "elan" "keith" "cheryl" "joel" "brady"] some-other-data: split-it {^^(tom|dick|harry|ted|ivan)} whos-in: intersect some-other-data users== ["ted"] whos-out: differece whos-in some-other-data == ["tom" "dick" "harry" "ivan"] --- If not, pardon my intrusion in this knowledge base building thread. (Wondering to myself: if polymorphic set operations were available in languages that rely heavily on regular expressions, would those regexps still be used just as much?) -jeff
[REBOL] How do I test for simple regex from external string Re:(2)
Hi Bob, A) Since Andrew was the only one to respond so far, I'm adding my 0.2 cents. My solution differs from Andrew's: 1. In that it is much more bloated. Well, ok. 2. I try to more accurately model your specification (at least the way I understand it). I believe Andrew didn't consider the prefix, suffix and negation rules. Parsing and applying these rules introduces some additional requirements that account for most of my code. 3. It could be reasonably argued that Andrew's version essentially accomplishes the specification and that it is unreasonable to add quite a few more lines of code in order to accomplish a small number of additional subtleties. But I wanted to show that REBOL is up to the challenge. B) A few notes: 1. If the rules you provide are not met, I return false! I.e. searchlist must contain either a leading "^", a trailing "$", or both, but must contain at least one. A list that contains neither a suffix nor a prefix indicator automatically leads to rejection. 2. you wrote: >and () are used in the app being ported. I interpret "and" here to be part of your explanatory text and not a keyword used by the app. 3. Your use of a single caret character "^" is not accepted by REBOL (as Andrew pointed out), because it is REBOL's string escape character. I therefore replaced it by two caret characters, "^^", where the first caret escapes the second caret, thereby restoring it as a simple character with no special functionality. 4. You don't specify suffix and prefix. I assume that they separated by a dot character ".". 5. You don't specify whether the front and end anchors ("^" and "$" respectively) must appear at the beginning (or end) of the string. Neither do you mention whether not ("?!") must appear at the beginning of the string. I assume that your example indicates that this is an implied rule. 6. My code may be a little overly verbose. I wanted it to be instructive. Besides that, I also wanted to ensure that all your requirements are met. If you set the word verbose to true, you will get a verbos console print out. C) The Implementation you wrote: >>>source is-memberof-re >? REBOL [] verbose: false vprint: func [string] [ if verbose [print string] ] reset: func [] [ front-anchor: end-anchor: use-negate: false ] front-anchor-rule: [thru "^^(" mark: (vprint "found front-anchor" front-anchor: true) ] negate-rule:[thru "?!(" mark: (vprint "in negate-rule" use-negate: true) ] end-anchor-rule: [thru ")$" end: (vprint "found end-anchor" end-anchor: true) ] close-paren-rule: [to ")" end: skip ] parse-rule: [(reset) some [front-anchor-rule | negate-rule] end-anchor-rule some close-paren-rule to end ] is-memberof-re: func [ condition [string!] candidate [string!] /local position end condition-block check-block match ] [ mark: 1 end: length? condition parse :condition parse-rule if series? mark [mark: index? mark] end: end - mark - 1 condition-block: parse copy/part at condition mark end "|" vprint mold condition-block either all [front-anchor end-anchor] [ match: candidate ][ either not all [front-anchor end-anchor] [ return false ] [ if (length? parse candidate ".") = 1 [return false] match: do either front-anchor [ :first ] [ :second ] parse candidate "." ] ] check-block: foreach option condition-block [append [] (= match option)] vprint mold check-block either use-negate [ return not all check-block ] [ return any check-block ] ] ;- note that I've added a caret "^^": userlist: {^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$} current-user: "bobr" excluded-files: {^^(?!(notxt|ask_new|only_owner_may_edit))} print [ "is-memberof-re userlist current-user:" is-memberof-re userlist current-user ] print [ "is-memberof-re excluded-files myfavoritemartian.html:" is-memberof-re excluded-files "myfavoritemartian.html" ] ;- end script Sample run: >> do %bob-match.r Script: "Untitled" (none) is-memberof-re userlist current-user: true is-memberof-re excluded-files myfavoritemartian.html: false >> >how do I look in a string to see it matches >a simple regular expression >where the regular expression >is coming from buffers/inputs and not part of the compiled script? >by simple I mean that only >^ (front anchor - missing front tests for suffixes) >$ (end anchor - missing end tests for prefixes) >| (alternates) >?! (not) >and () are used in the app being ported. > > >sample initial conditions: > >userlist: {^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$} >current-user: "bobr" >excluded-files: {^(?!(notxt|ask_new|only_owner_may_edit))} > > >is-memberof-re userlist current-user >>> true > >is-memberof-re excluded-files "myfavoritemartian.html" >>> false > > > ;- Elan >> [: - )]
[REBOL] Openletter to Rebol HQ. Re:(2)
[EMAIL PROTECTED] wrote: > My vote (were this a democracy) would be to have the implementors > mainly working on REBOL/View, but reserving some of their time to > support the documentation team, who would be heads-down on getting > full-blown REBOL/Core documentation out the door -- including lots > more explanations, rationale, and here's-what-we-had-in-mind kinds > of stuff. Quite a number of examples of the need for fuller and > deeper documentation have been discussed -- some at GREAT length -- > in this mailing list since I've been involved. > > -jn- As a lurker and relative newcomer to Rebol, I STRONGLY AGREE with the above vote. I currently have 879 filed email messages in my Rebol folder, being extended discussions of features/behaviour/workarounds that constitute for me the missing documentation that would make learning Rebol a lot easier. There are some incredibly curious and patient people on this list who go to great lengths to understand and explain Rebol behaviour, and the quality of explanation/debate is always stimulating. Thank you all. Regards, -- Richard Laing Vancouver, CANADA [EMAIL PROTECTED] [EMAIL PROTECTED] http://members.tripod.com/rlaing/index.htm * "Much may be made of a Scotchman if he be caught young." Samuel Johnson (1709-1784) *
[REBOL] Openletter to Rebol HQ. Re:(4)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 19, 2000 10:42 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] Openletter to Rebol HQ. Re:(3) > I would really be interested in knowing > how many people interested in Rebol > are *truly* interested in an alternative > to Perl, Tcl, or say Python out of the > gate, vs. say Java / C++ / VB with a > primary focus on Internet programming ? Hi, referencing JBones long posting and his feeling about his decisions as CTO I can say that I have made the same experience. There was never a tool available which I didn't brought to the limit and it took quite some time to fix this or get enough knowledge on my side to get around it... leading to a tool-hopper approach with not much success. So tools are just that: Tools! For me two things are needed: 1. A compiler language for native and fast code. That's C++ 2. A scripting language to glue a lot of different things together, giving people in the fields the possibility to alter functionality without having to call me. With this approach less-is-more! I really don't want to have to use a couple of different scripting languages etc. Before Rebol this was sometimes needed but Rebol is the best I have seen so far. Robert
[REBOL] How do I test for simple regex from external string Re:(3)
some clarification is in order. At 08:00 PM 1/19/00 -0800, [EMAIL PROTECTED] wrote: >This solution doesn't use regular expressions or parsing. But it's far >easier to see what the intent of the code is. Parsing is my second >solution... >I did it this way, because the (^) caret[?sp] in REBOL strings is the >escape character for encoding special characters in strings. Note that the >"^" disappears from bobr's original code: oops! >>> userlist >== {(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$} > > >>> User_List: ["ted" "admin" "bobr" "andrew" "elan" "keith" "cheryl" "joel" >"brady"] >== ["ted" "admin" "bobr" "andrew" "elan" "keith" "cheryl" "joel" "brady"] >>> Current_User: "bobr" to go from ^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$ which is what is literally in the input stream/file to ["ted" "admin" "bobr" "andrew" "elan" "keith" "cheryl" "joel" "brady"] needs to be explained. the rest using 'find is trivial. (though you don't cover excluded values or prefixes or suffixes) I too saw that ^ was special and tried to use {} to hint that the buffer contents were to be taken literally. my apologies. I guess we could strip them [ ^ and $ ] but I would still need to go from (a|b) form to ["a" "b" ] form. I do have alt2600 cracker types who will try: ^(bobr|me" halt "pi|andrew)$ just to pull my goatee with a denial of service attack. reading ahead there is even worse stuff with ^(bobr|me"hum"m^(q)|andrew)$ to be dealt with. [on mozilla the 'kids' do try and pick perverse names knowing the database will copy them about] >A similar procedure will work for file names as well. it is not important that the names are files, they could as easily be record identifiers in a database. what is critical is that it is a list of prefixes to be excluded from selection. the other important thing is that the list is coming from a stream or string buffer. IE something that was typed in by a human. it is not a compiled rebol expression unless you show me the lines that compile/eval it. these simplified re's constitute a special purpose dialect used to describe something well known to an existing group of people. you were correct in using 'ask to pick it up as that pretty closely resembles a stream. >Or for another approach, using 'parse: > >>> userlist: ask "Please enter users: " >Please enter users: ^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$ >== {^^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$} > >Users: make object! [ > Names: make block! 10 > Name: make string! 30 > Name_Rule: [ > copy Name [to "|" | to ")"] (append Names Name) [thru "|" | thru ")"] > ] > Parse_Names: func [Simple_RegExp [string!]] [ > clear Names clear Name > parse/all Simple_RegExp ["^^(" some Name_Rule thru "$" to end] > ] > ] > 'parse used above comes close but does this solution handle negated match expressions? prefixes? suffixes? maybe if I exposed more context to where these are used it would help. here is the perl code I was trying to replace. sub userInList { my ($user, $userlist) = @_; $user =~ s/$userlist//; # a perfect match erases all chars return ( $user eq "" ) ? 1 : 0; } I realize this perl is compact. I know it won't do prefixes. normally, $userlist contains ^(ted|admin|bobr|andrew|elan|keith|cheryl|joel|brady)$ we are not permitted to change the syntax to a "block" form because we want to show off that rebol can seamlessly displace the perl and not require users (non programmers) of the app to learn new syntax (dialect) just because implementation language changed. replacement of the syntax would mean changing the strings in thousands of data records. too much work. we can change local copies but that is it. the other case for the file prefixing and suffixing was this (simplified) perl snippet: sub filesList { local( $pat, $sortage, $foo) = @_; opendir(DIR,"$textLocation/$wdb"); @filesset = grep( /$pat/ && !/^\./ && /$txt/, readdir(DIR)); closedir(DIR); $foo = "%" . join("% %", @filesset) . "%"; if ( $foo eq "%%" ) { return ""; } $foo =~ s@:@/@g; if ( $sortage eq "" ) { $foo =~ s/$txt%/%/g; return $foo; } ... it is rife with all kinds of accreted violations of pure/ideal code. it is an example of what the dirty real world is running on and a chunk of code I must eventually displace. I am appealing to the list because if I do it will balloon up to hundreds of special cased lines and take a long time. I think you cats can knick the bloatware element. FYI: if you want to try and code up the whole function here is its 'spec' for the above snip. the variables brought-in from external scope are: $txt - file type suffix like \.gz, \.jpg, \.html but not limited to $wdb - database dir or image-file-dir $textLocation - root of all data files for this app instance the function is (usually) called with one of those simple REs to be used to match files. $ans = filesLis
[REBOL] Openletter to Rebol HQ. Re:(4)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 19, 2000 9:31 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] Re: Openletter to Rebol HQ. Re:(2) > > It is surely platform-independent, as long as you use Windows and > InternetExplorer. > ;-) That's what you face if you start with HTML as GUI. I'm working on a project (which uses Rebol as generator) to handle exactly this and I can tell you, if you know how to do it you can get it completely portable but it's very tricky and one needs a lot of know how about different browsers etc. But the idea is to collect this knowledge once in a Rebol script and let others use it. > Maybe you're right, and I'm just not that good in creating HTML > documents (are they documents or GUI descriptors? ;^) ), but I > disagree. The problem is that people are fighting HTML and browser discrepancies and don't make it to the level where the application is the main point... I'm trying to change this and for this Rebol is the tool to use. But the scripts are becoming quite complicated and big (see the OA web-site is completely done with Rebol and is about 120 K, and the site isn't that big). Robert
[REBOL] Wishlist (was Openletter to Rebol HQ.) Re:(3)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 19, 2000 10:37 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] Wishlist (was Openletter to Rebol HQ.) Re:(2) > > (7) Big-ass kit of Web gizmos > Also a good candidate for OpenSource advocates. This one has taken off already, see www.openip.org. And as I'm trying to implement this currently, I faced some problems starting this long thread here... Robert
[REBOL] Rebol CGIs on Personal Web Server (Win98)?
Hi all you little list people, I've been trying to get Rebol CGI scripts running on a Microsoft Personal Web Server, but it just won't work. It just pops up a window (like it's downloading) for about 1 sec, then it closes it and nothing else happens. I tried to look in the Help files and I've come to the conclusion that I need to "Set Application Mappings", however, this option seems to be available only to IIS servers. Anyone got any idea of how to make it work with PWS? Best Regards Stefan Falk ([EMAIL PROTECTED]) Scandinavian Leisure Group IT Support Phone: +46-8-55513449 Mobile: +46-709513449
[REBOL] local vars - did I miss something?? Re:(2)
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 19, 2000 9:08 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] local vars - did I miss something?? Re: Thanks to all for clarifying things up! My Rebol inbox is approaching 10.000 postings and it seems my long-term-memory hasn't all threads in scope ;-)). Again thanks a lot. Robert
[REBOL] REBOL/View vs. OpenAmulet? Re:
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 19, 2000 8:44 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] REBOL/View vs. OpenAmulet? > something that doesn't fit in my mind all that smoothly: Hi, than let's see if I can explain ;-) > Why would some one who regularly signs off his email saying: > > >Use the free portable GUI Library > >OpenAmulet from http://www.openip.org > > want to discourage REBOL Tech from publishing REBOL/View? First I don't want to discourage them, but I would like to ask that the Core and Command stuff is getting higher priority. I use scripting languages as glue-code in everyday work. Further scripting languages are very good suited for all kind of generators etc. > Certainly your sign off suggests that you are well aware of the need > for portable GUI interfaces, no? Yes I'am. And you can be sure that I know it can be a pain in the ... to get it run right. OpenAmulet isn't a me-too GUI library, the main advantage it has is that its based on constraint solving... makes GUI programming very easy. The project is about 130 KLOC, supports about 8 eight different compilers, 3 main platforms with different sub-platforms, has a 400 pages documentation etc. etc. and that's just needed for the GUI part !! Ok, it might be possible to optimize the stuff but I think we are pretty good with it. As I know how much resources can be put just to the GUI aspect I'm a bit afraid that the other parts are getting behind, as these parts are not sexy but they are the core of a scripting-language. > I think that promoting a portable GUI Library and in the same > breath (same email) discouraging REBOL/View requires some explaining. However, time changes and as I stated in my posting, I think about 50% of the everyday applications can be converted to HTML, JavaScript and a good web-server implementation. This model for applications hasn't taken off so much yet, as it's not so easy to get right but it's definitely the way to go! I see OpenAmulet and Rebol/View positioned in different ways. OpenAmulet is more for GUI intensive things, we have OpenGL support, C++ source-code which makes it easier to use in C++ projects, network support (at least very rudimentary), and an other concept to approach GUI development. Rebol/View will be more like a HTML replacement... but let's face it, Rebol is still quite fancy out there (I don't have a problem with this and I'm evangelizing people to use it) and it's hard to push something new into corporate development-lines. Hope this clarifies some things. If not don't hesitate to ask me. Robert M. Muench, Karlsruhe, Germany ==> ask for PGP public-key <== When do you want to reboot today? Use the free portable GUI Library OpenAmulet from http://www.openip.org
[REBOL] OpenSource REBOL Re:(10)
I think a real problem is that /COMMAND has put the community into Fear Uncertainty and Doubt mode. Because /COMMAND is coming no one wants to work on /COMMAND, but /COMMAND never comes. The Web site says: { REBOL/Command will be released soon. It is for commercial users who require additional features to access business systems or legacy applications, including database connectivity or native API access } Does this mean it will include connectivity with mySQL? Dunno. After the /VIEW beta hits the street, and the RT guys take a much deserved rest, I think we need to make a concerted effort to get some official high-level details about /COMMAND. For example, what databases it will connect to and what the API interface will look like? If we knew that much, then some work at least could be done on complementary products. This would also be helpful in testing /VIEW. The most obvious niche for /VIEW is business applications, which often depend on database connectivity. With at least the API specification, we might be able to try dummy programs to see well they would hook up to the API. Meanwhile, a few of us have started work on turning REBOL.ORG into a user-supported Web site. One of the things we will do is manage the scripts used on the Web site as open source. We also have RT's blessing to form a working group to enhance SELMA. If we can show how well this community can work together on open source scripts, perhaps it will help shake loose the /CORE code. -Ted.