[REBOL] parse question Re:

2000-09-14 Thread jeff
Howdy, Terrence: Neat stuff. Planning on making web page out of the result? > In order to improve my skills with the REBOL parse word, I thought I would go > through "Mastering Regular Expressions" by Jeffrey Freidl and do all the > examples in REBOL. Here is my first attemp

[REBOL] parse question Re:

2000-09-14 Thread princepawn
using thru did not result in correct parsing >= Original Message From [EMAIL PROTECTED] = >terrence-brannon wrote: >> rules: [ >> to "resetsize" (size-cmds: size-cmds - 1) >> | >> to "setsize" (size-cmds: size-cmds + 1) >> ] > >Try 'thru instead of 'to. > >Note that "setsize" is equal to

[REBOL] parse question Re:

2000-09-14 Thread Al . Bri
terrence-brannon wrote: > rules: [ > to "resetsize" (size-cmds: size-cmds - 1) > | > to "setsize" (size-cmds: size-cmds + 1) > ] Try 'thru instead of 'to. Note that "setsize" is equal to last seven letters of "resetsize". Me: [ "Andrew Martin" ICQ: 26227169 http://members.ncbi.com/

[REBOL] parse question

2000-09-14 Thread princepawn
In order to improve my skills with the REBOL parse word, I thought I would go through "Mastering Regular Expressions" by Jeffrey Freidl and do all the examples in REBOL. Here is my first attempt and it does not work. The script is supposed to take a list of files and indicate whether the word

[REBOL] parse question Re:(3)

1999-11-30 Thread bo
Ingo, I noticed several people had posted parse versions, so I'm sure you'll see them by the time you see this mail. If not, let me know and I'll write one. I'm pretty sure Elan wrote one at least. Later! On 24-Nov-1999/13:51:44+1:00, [EMAIL PROTECTED] wrote: >Hi Bo, > >I am a bit behind with

[REBOL] parse question Re:(2)

1999-11-24 Thread ingo
Hi Bo, I am a bit behind with reading my email, so this solution seems perfect, but I also want to learn something about parse, so if you please could the parse version, too? thanks Ingo Those were the words of Bohdan Bo Lechnowsky: > > Ingo, > > Assuming your input line looks like this: >

[REBOL] parse question Re:(2)

1999-11-22 Thread icimjs
Hi Ingo, you wrote: >Now here's a real life example ... > >Just a descriptive line that noone needs >NOTU=6, NLOC=15, NALL=5; >(fortran format string) The following works rather painlessly. Is it possible to reduce the size using parse? Hmmm, don't know! data: {Just a descriptive line that noon

[REBOL] parse question Re:

1999-11-22 Thread ingo
Hi Allen, Elan and all, sorry for the late answer, but I had no net-access the last days. I see, it is not easy to give a short, but thorough description, So let me try again :-) The data is used to describe the format of an input file, to compute genetic data, that I don't at all understand. I

[REBOL] Parse question Re:

1999-10-08 Thread tomc
On Fri, 8 Oct 1999 [EMAIL PROTECTED] wrote: > Hi > The question: > > Why if > parse "the radio" ["the" "radio"] > parse "the radio" ["the" "radio"] > parse " the radio" ["the" "radio"] > > are all true, > > parse " the radio " ["the" "

[REBOL] Parse question Re:(2)

1999-10-08 Thread SButler
t;all" refinement makes the parse command whitespace-sensitive. There's also a "case" refined to make comparisons case-sensitive. Note that I'm using ? and + as part of the words s? and s+, they aren't reserved as "operators" as they may be in other language

[REBOL] Parse question Re:(2)

1999-10-08 Thread Russ
These cases might also be informative: >> parse " the radio " ["the" "radio" any space] == true >> parse " the radio " [thru "the" "radio" to end] == true >> parse " the big radio " [thru "the" "radio" to end] == false Seems (to me) when there is no space following "radio" (in the string be

[REBOL] Parse question Re:

1999-10-08 Thread Petr . Krenzelok
[EMAIL PROTECTED] wrote: > Hi > The question: > > Why if > parse "the radio" ["the" "radio"] > parse "the radio" ["the" "radio"] > parse " the radio" ["the" "radio"] > > are all true, > > parse " the radio " ["the" "radio"] > >

[REBOL] Parse question

1999-10-08 Thread lmarzulli
Hi The question: Why if parse "the radio" ["the" "radio"] parse "the radio" ["the" "radio"] parse " the radio" ["the" "radio"] are all true, parse " the radio " ["the" "radio"] is false? Thank you -- Luis Marzulli e-mail: [

[REBOL] Parse Question: Why Doesn't This Work? Re:(10)

1999-09-29 Thread Al . Bri
> > > > Have a nice day/night/evening/morning! > > > Considering the 'random/seed help' thread: Is this a path? ;-) > > > If so the order confuses me a little... > > > > It's function refinements... ^_^ > > And morning! is a new datatype? Just different dialects for the 'net and rebol

[REBOL] Parse Question: Why Doesn't This Work? Re:(9)

1999-09-29 Thread timewarp
[EMAIL PROTECTED] wrote: > > > > Have a nice day/night/evening/morning! > > Considering the 'random/seed help' thread: Is this a path? ;-) > > If so the order confuses me a little... > > It's function refinements... ^_^ And morning! is a new datatype?

[REBOL] Parse Question: Why Doesn't This Work? Re:(8)

1999-09-29 Thread Al . Bri
> > Have a nice day/night/evening/morning! > Considering the 'random/seed help' thread: Is this a path? ;-) > If so the order confuses me a little... It's function refinements... ^_^ Andrew Martin [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ Online @ 33,600 Baud! -><-

[REBOL] Parse Question: Why Doesn't This Work? Re:(7)

1999-09-29 Thread t_degrav
[EMAIL PROTECTED] wrote: ... > Have a nice day/night/evening/morning! Considering the 'random/seed help' thread: Is this a path? ;-) If so the order confuses me a little... Tom

[REBOL] Parse Question: Why Doesn't This Work? Re:(7)

1999-09-29 Thread Russ
Personally, I've found restarting REBOL to be a very healthy thing to do... when it's not doing what seems reasonable. I'm sure some of the newbie things I ask of it drive IT's "mind" insane! :) Taking breaks is also good medicine.. sigh, when one can tear themselves away from a notion and MAKE

[REBOL] Parse Question: Why Doesn't This Work? Re:(6)

1999-09-29 Thread Al . Bri
Sometimes it's good to take a break, and restart REBOl. ^_^ Have a nice day/night/evening/morning! Andrew Martin [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ Online @ 33,600 Baud! -><- -- > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: [R

[REBOL] Parse Question: Why Doesn't This Work? Re:(5)

1999-09-29 Thread timewarp
... so you only need word: :word if you want to go back to the index of the beginning of the sought after characters. Parse automagically moves the index just beyond the set of characters in the parse statement ... Hrrrmm Cheerfulness,

[REBOL] Parse Question: Why Doesn't This Work? Re:(5)

1999-09-29 Thread timewarp
[EMAIL PROTECTED] wrote: > I didn't follow the conversation but: > Why traverse the string again? You already traversed it by "--- ".. then you can > leave out the mark: :mark clause.. also you should use [thru newline] to prevent > another 'dumb' loop of the parser... > > rule: [ > "==="

[REBOL] Parse Question: Why Doesn't This Work? Re:(4)

1999-09-29 Thread oosterve
I didn't follow the conversation but: Why traverse the string again? You already traversed it by "--- ".. then you can leave out the mark: :mark clause.. also you should use [thru newline] to prevent another 'dumb' loop of the parser... rule: [ "===" copy header thru newline

[REBOL] Parse Question: Why Doesn't This Work? Re:(3)

1999-09-29 Thread timewarp
[EMAIL PROTECTED] wrote: > > EAT, I think this is what you need: > > headrule: [ > some [ > thru "=== " copy head to newline ( > append head " (FIRST LEVEL)" append full-contents head > ) > | >

[REBOL] Parse Question: Why Doesn't This Work? Re:(6)

1999-09-28 Thread giesse
[EMAIL PROTECTED] ha scritto: > > Near as I can tell, this rule matches the principle shown in Carl's > stuff below: > > headrule: [ some [newline | > "===" [[copy header to newline] > ( append header " (FIRST LEVEL)" > append full-contents header)]

[REBOL] Parse Question: Why Doesn't This Work? Re:(4)

1999-09-28 Thread petr . krenzelok
[EMAIL PROTECTED] wrote: > I hope this helps! > > >> str: "--- three dash!" > == "--- three dash!" > >> ble: copy "" > == "" > >> parse str [some [thru "---" copy rest to end (ble: rest) | thru > "===" copy rest to end (ble: rest)]] Marking the input? 1) if str is some 100 and more kbs of mem

[REBOL] Parse Question: Why Doesn't This Work? Re:(2)

1999-09-28 Thread Al . Bri
EAT, I think this is what you need: headrule: [ some [ thru "=== " copy head to newline ( append head " (FIRST LEVEL)" append full-contents head ) | thru "--- " copy head to newline (

[REBOL] Parse Question: Why Doesn't This Work? Re:(3)

1999-09-28 Thread Al . Bri
I hope this helps! >> str: "--- three dash!" == "--- three dash!" >> ble: copy "" == "" >> parse str [some [thru "---" copy rest to end (ble: rest) | thru "===" copy rest to end (ble: rest)]] == true >> ble == " three dash!" >> str: "=== three equals!" == "=== three equals!" >> parse str [some [t

[REBOL] Parse Question: Why Doesn't This Work? Re:(6)

1999-09-28 Thread Al . Bri
e parts done] > write join file ".html" html Write the file. > quit Stop! Andrew Martin [EMAIL PROTECTED] http://members.xoom.com/AndrewMartin/ Online @ 33,600 Baud! -><- -- > From: [EMAIL PROTECTED] > To: [EMAIL PROTECTED] > Subject: [REBOL

[REBOL] Parse Question: Why Doesn't This Work? Re:(2)

1999-09-28 Thread timewarp
Andrew, By the time I posted that, my various combinations involved in trying to make it work were getting a bit convoluted. It's called "desperation". I want to understand how this works BADLY. It's been gnawing away at me to sit down and figure it out one of these days... So, with docs

[REBOL] Parse Question: Why Doesn't This Work? Re:(5)

1999-09-28 Thread timewarp
Near as I can tell, this rule matches the principle shown in Carl's stuff below: headrule: [ some [newline | "===" [[copy header to newline] ( append header " (FIRST LEVEL)" append full-contents header)] | "---" [[copy header to newline]

[REBOL] Parse Question: Why Doesn't This Work? Re:(5)

1999-09-28 Thread timewarp
Petr, Thanks, actually dug that post up already and been trying to decypher it... My closest approximations still aren't working. Perhaps someone will be kind enough to do a full step by step breakdown of the stuff below? Feel like I understand it pretty well, it's just not working w

[REBOL] Parse Question: Why Doesn't This Work? Re:(4)

1999-09-28 Thread petr . krenzelok
[EMAIL PROTECTED] wrote: > [EMAIL PROTECTED] wrote: > > > Okay, granted. Here's the same rule with a different word... > > > > headrule: [some > > [thru "=== " copy header to newline > > ( append header " (FIRST LEVEL)" > > append full-contents header)

[REBOL] Parse Question: Why Doesn't This Work? Re:(4)

1999-09-28 Thread timewarp
> Aha, so I am sorry as I am not too skilled in grammar creation. The problem > seems to be with "find this value OR that value", as string will be parsed > thru first occurance of "===", and if "---" occured first, it will not be > reflected. That would require some "parralel" searching for pars

[REBOL] Parse Question: Why Doesn't This Work? Re:

1999-09-28 Thread Al . Bri
EAT wrote: > Here's the question. Why does the above only find and append to full-contents lines with "=== " and completely ignore lines with "--- "? ^_^ Because that's the way you wrote it? headrule: [ some [ [

[REBOL] Parse Question: Why Doesn't This Work? Re:(3)

1999-09-28 Thread petr . krenzelok
[EMAIL PROTECTED] wrote: > Okay, granted. Here's the same rule with a different word... > > headrule: [some > [thru "=== " copy header to newline > ( append header " (FIRST LEVEL)" > append full-contents header)| > thru "--- " copy head

[REBOL] Parse Question: Why Doesn't This Work? Re:(2)

1999-09-28 Thread timewarp
Okay, granted. Here's the same rule with a different word... headrule: [some [thru "=== " copy header to newline ( append header " (FIRST LEVEL)" append full-contents header)| thru "--- " copy header to newline ( append h

[REBOL] Parse Question: Why Doesn't This Work? Re:

1999-09-28 Thread petr . krenzelok
[EMAIL PROTECTED] wrote: > Okay, question is simple: > > Here's my rule: > > headrule: [some [ > [thru "=== " copy head to newline > ( append head " (FIRST LEVEL)" > append full-contents head) ] | > some > [thru "--- " copy he

[REBOL] Parse Question: Why Doesn't This Work?

1999-09-28 Thread timewarp
Okay, question is simple: Here's my rule: headrule: [some [ [thru "=== " copy head to newline ( append head " (FIRST LEVEL)" append full-contents head) ] | some [thru "--- " copy head to newline ( append head "

[REBOL] parse question Re:

1999-01-17 Thread bo
Ingo, Assuming your input line looks like this: inline: "a1=1, a2=2, a3=3, a4" Here is a one-line solution to do what you want: do replace replace/all replace/all inline "," " " "=" ": " "a4" "a4: true" It works for any ordering of inline, and also if the values are separated by spaces, comm

[REBOL] parse question Re:

1999-01-16 Thread icimjs
At 11:41 PM 11/18/99 +0100, you wrote: >I've got a little parse problem. I try to parse something like >a1=1, a2=2, a3=3, a4 >where a1 to a3 have to be present, a4 may or may not be there, >it is unspecified, which is at which position, and they may be >on subsequent lines, without the commas sepe

[REBOL] parse question Re:

1999-01-16 Thread icimjs
At 11:41 PM 11/18/99 +0100, you wrote: >I've got a little parse problem. I try to parse something like >a1=1, a2=2, a3=3, a4 >where a1 to a3 have to be present, a4 may or may not be there, Two questions: 1. If we have a1= does the next digit have to be 1, or could we have: a1=2, a2=3, a3=8 ...?

[REBOL] parse question

1999-01-16 Thread ingo
Hi Rebols, I've got a little parse problem. I try to parse something like a1=1, a2=2, a3=3, a4 where a1 to a3 have to be present, a4 may or may not be there, it is unspecified, which is at which position, and they may be on subsequent lines, without the commas seperating them. Any ideas on how t