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: joel:neely:fedex at: 16-Apr-2002 7:21

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 ]