press ctrl+f then alt+r 2012/2/22 Linda Alvord <lindaalv...@verizon.net>
> For This Challenge Only! This is for Raul, Ric and others. You may > respond > immediately. The embargo is lifted. Work together, ask questions, compare > strategies, ask for advice and share your code at will. > > Use whatever will work most efficiently. No holds barred. Do not hold > back > if you are a very experienced programmer, rather join in the fun. > > > > Here's the problem: design a function pw for powerwash. Apply pw to any > legacy script which is a mess and made you mad when two changes were made. > It is a script that you miss but you moved on without it because it took > too > much effort and you abandoned it. The errors all came from a small change > of > arguments x. becoming x and y. becoming y > > > > So here is what is needed. Apply powerwash to the offending .ijs > > > > pw 'legacymessedup.ijs' > > > > The function or several functions taken together will powerwash your code > in four ways. > > > > 1. It will find all instances of x and replace them with xx > > 2. It will find all instances of y and replace them with yy > > 3. It will find all instances of x. and replace them with x > > 4. It will find all instances of y. and replace them with y > > > > This will not insure that your legacymessedup script will work. But it > will prevent the madness of having to do it yourself every time. > > > > This one is for my own use and is beyond my skill or energy to tackle. I > imagine there will be others out there who might appreciate it too. We > thank you in advance. Also this may have been done since 2001 and I never > saw it in which case we will move on to Challenge 8. > > > > Linda > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Björn Helgason, Verkfræðingur Fornustekkum II 781 Hornafirði, t-póst: gos...@gmail.com gsm: +3546985532 twitter: @flugfiskur http://groups.google.com/group/J-Programming Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans góður kennari getur stigið á tær án þess að glansinn fari af skónum /|_ .-----------------------------------. ,' .\ / | Með léttri lund verður | ,--' _,' | Dagurinn í dag | / / | Enn betri en gærdagurinn | ( -. | `-----------------------------------' | ) | (\_ _/) (`-. '--.) (='.'=) ♖♘♗♕♔♙ `. )----' (")_(") ☃☠ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm