I agree with Raul about discarding code. With the move to J7, I'm making an effort to reduce the size of my old personal utilities script because it's full of things that are in standard libraries or that I seldom use. So far, I've retained only about 200 out of 1200 lines of code. Looking over these 200 lines, the largest amount of code deals with numeric validation and conversion, so I suspect much of this could be eliminated by getting better acquainted with some of the standard libraries.
Also, there's a chunk of initialization code subsumed into the .cfg files now used by J7. This is a better way to handle the customizations of globals like Public_j_ and UserFolders_j_ but I still have a little code to retain compatibility between J6 and J7 and between XP and Windows 7. On Wed, Feb 22, 2012 at 10:27 AM, Dan Bron <j...@bron.us> wrote: > Personally, [. was removed during my "J lifetime", but before I'd developed > the skills needed to take advantage of it. > > More generally, I think one of the reasons it was removed is it hadn't see > wide adoption. So I imagine its excision was less painful than the > disinflection of argument names. > > But if [. were reinstated, along with the (parts of the) trains table needed > to make it useful, you can be sure I'd be first in line to buy one. > > This is one of the many things I'd play with in the J source, if I had the > time. > > -Dan > > > -----Original Message----- > From: programming-boun...@jsoftware.com > [mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller > Sent: Wednesday, February 22, 2012 10:08 AM > To: Programming forum > Subject: Re: [Jprogramming] Challenge 7 March Bad Mess > > Or [. > > -- > Raul > > On Wed, Feb 22, 2012 at 9:56 AM, Dan Bron <j...@bron.us> wrote: >> The Wiki has a long memory: http://www.jsoftware.com/jwiki/Scripts/Fixargs >> . >> >> (Fortunately for we tacit weirdos, this has never been an issue. Now, if we >> changed the spelling of @ .... ) >> >> -Dan >> >> -----Original Message----- >> From: programming-boun...@jsoftware.com >> [mailto:programming-boun...@jsoftware.com] On Behalf Of Raul Miller >> Sent: Wednesday, February 22, 2012 9:45 AM >> To: Programming forum >> Subject: Re: [Jprogramming] Challenge 7 March Bad Mess >> >> 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 <lindaalv...@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 >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm