[Jprogramming] Challenge 7 March Bad Mess
Raul Miller
rauldmiller at gmail.com
Wed Feb 22 22:45:14 HKT 2012
Unfortunately, I do not have any such scripts.
If they mattered to me, I have fixed them so long ago that I do not
remember the event.
Perhaps it matters that I view programming as an activity rather like
inhaling. Inhaling is an important part of breathing, but if you
never exhale you will not do so well.
Put differently, I think there is an activity related to programming
which involves discarding code that's not useful. Code is easy to
generate...
Finally, one of the things I most value about J is that it's concise
enough that I can do useful transformations on bodies of code with
relatively low amounts of keyboarding. I can think of all sorts of
automated transforms, but ultimately it's my understanding that's the
valuable thing for me.
--
Raul
On Wed, Feb 22, 2012 at 4:54 AM, Linda Alvord <lindaalvord at verizon.net> wrote:
> 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
More information about the Programming
mailing list