Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: My function seems to have no effect

From: richard::coffre::francetelecom::com at: 16-Apr-2002 14:55

Hi, Can you give more explanation about the boilerplate. I believe that gap is not a refinement of parse but I don't really understand the link between the boilerplate and the parse command : how can Rebol use the whitespace definition into parse ... ??? :-O -----Message d'origine----- De : Joel Neely [mailto:[joel--neely--fedex--com]] Envoy=E9 : mardi 16 avril 2002 14:21 =C0 : [rebol-list--rebol--com] Objet : [REBOL] Re: My function seems to have no effect Hi, Richard, In that case... COFFRE Richard FTO wrote:
> Hi Joel, > > Indeed, the lines I need to "clean" look like > Call ("GetOCode:initData") > where I need to delete "Call ("" and the final "). >
Some sample data: bletch: { Call ("Get0Code:initData") call ("TestFunc:blahblah") call("Quux:flarp") call("Quux:spoo") call ( "Layout:spaceObsessively" ) CALL ( "The:end" ) } Some generic boilerplate: whitespace: charset { ^-^/} gap: [any whitespace] The real work happens here: parse/all bletch [ any [ {call} gap {(} gap {"} copy fn to {"} {"} gap {)} ( print fn ) | skip ] ] This produces the following output: Get0Code:initData TestFunc:blahblah Quux:flarp Quux:spoo Layout:spaceObsessively The:end You can, of course, do something inside the parens more interesting than just print out to the console... HTH! -jn- -- ; Joel Neely joeldotneelyatfedexdotcom REBOL [] do [ do func [s] [ foreach [a b] s [prin b] ] sort/skip do function [s] [t] [ t: "" foreach [a b] s [repend t [b a]] t ] { | e s m!zauafBpcvekexEohthjJakwLrngohOqrlryRnsctdtiub} 2 ]