"ComeFrom:" lol... I hadn't heard of that. Yes... a highly impractical, but at the same time it "helped" in some way.
my casual inverting programs thought related to J's Under / Inverse function... and also, David Gries is from the Proof Of Correctness school. The book has a foreward from Dijkstra. I read somewhere that Arthur Whitney cites Proof Of Correctness as an influence for the K language. I was just relating back to the original work. Arthur also implemented Prolog interpreters years ago (i.e. every function is recursive). Yet recursion is banned in APL (I like that... now... mostly). The gist of that book said that for every function there should be a pre-condition and a post-condition. These conditions should be expressed in a predicate calculus -- Gries' predicate calculus has some list concepts... hmmm, so does APL. The Extreme Programming discipline seems to focuss *only* on expressions of the post condition (+ success/fail reports on this). My last impractical thought for today: people often reach for and invent similar things, and yet in the process lose touch. -Steven On 21 February 2011 19:22, <[email protected]> wrote: > Send Programming mailing list submissions to > [email protected] > > To subscribe or unsubscribe via the World Wide Web, visit > http://jsoftware.com/cgi-bin/mailman/listinfo/programming > or, via email, send a message with subject or body 'help' to > [email protected] > > You can reach the person managing the list at > [email protected] > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Programming digest..." > > > Today's Topics: > > 1. Re: J embedded in Excel (Graham Parkhouse) > 2. Re: J embedded in Excel (Eric Iverson) > 3. Re: J embedded in Excel (David Mitchell) > 4. Re: Inverting Programs (Devon McCormick) > 5. Re: Critique please! (Devon McCormick) > 6. Re: Inverting Programs (David Ward Lambert) > 7. Re: J embedded in Excel (David Mitchell) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 21 Feb 2011 18:11:05 -0000 > From: "Graham Parkhouse" <[email protected]> > Subject: Re: [Jprogramming] J embedded in Excel > To: <[email protected]> > Message-ID: <001a01cbd1f2$b6148500$223d8f00$@[email protected]> > Content-Type: text/plain; charset="us-ascii" > > I didn't use cmd.exe the first time: I have now, but I still get the same > error message when I run your macro, and it stops on the same line. I've > only done it with J701 and everything is 32 bit. > > I have been looking up a lot of stuff on the internet, but am not greatly > encouraged. It seems you have to register every macro, and then only if its > written in C++, C#, F# or Jscript, and NOT the J script I'm looking for! I > was hoping I could attach a script file to a directory containing my Excel > file and get ready access to the functions in J. OK, I expect to reference > each function, with name in Excel, name in J, argument types etc - no > problems. But this seems beyond my reach at the moment. > > Gratefully > > Graham > > David Mitchell wrote: > > > > Graham, > > > > You are welcome. > > > > The Excel help search shows several possible explanations for error > > 429. > > > > I suspect that the most likely cause is that you may not have the > > correct > > version of J7 J.DLL registered for the version of Excel you are > > running. > > > > All of the versions I currently have of Excel are 32 bit versions. I > > did use a > > beta version of 64 bit Excel for a while, but it expired. > > > > So, I make sure that I have registered the current 32 bit version of > > J.DLL when > > I use Excel. > > > > I believe you can register both the 32 and 64 bit version of J.DLL and > > Win7 will > > figure out which to use, but it has been a while since I tried that. > > > > So, the safest way is to make sure that the last version of J.DLL you > > register > > matches your version of Excel. > > > ------------------------------ > > > > Message: 2 > > Date: Mon, 21 Feb 2011 10:45:30 -0500 > > From: David Mitchell <[email protected]> > > Subject: Re: [Jprogramming] J embedded in Excel > > To: Programming forum <[email protected]> > > Message-ID: <[email protected]> > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > One more thought. I always use a cmd window with Administrator > > authority to run > > regsvr32. > > > > On Win7, you can type > > > > cmd.exe > > > > in the search window of the command window. When you see cmd.exe show > > up at the > > top of the search window, right-click it and select "Run as > > administrator". > > > > After answering Yes to the UAC prompt, you can then cd to the J bin > > directory > > and run regsvr32. > > > > > > ------------------------------ > > Message: 2 > Date: Mon, 21 Feb 2011 13:20:24 -0500 > From: Eric Iverson <[email protected]> > Subject: Re: [Jprogramming] J embedded in Excel > To: Programming forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > An important point you might have missed in the advice given so far is that > regsvr32 must be run as admin to work. Run as a normal task it > unfortunately > lies and reports success when nothing as been done. > > On Mon, Feb 21, 2011 at 1:11 PM, Graham Parkhouse < > [email protected]> wrote: > > > I didn't use cmd.exe the first time: I have now, but I still get the same > > error message when I run your macro, and it stops on the same line. I've > > only done it with J701 and everything is 32 bit. > > > > I have been looking up a lot of stuff on the internet, but am not greatly > > encouraged. It seems you have to register every macro, and then only if > its > > written in C++, C#, F# or Jscript, and NOT the J script I'm looking for! > I > > was hoping I could attach a script file to a directory containing my > Excel > > file and get ready access to the functions in J. OK, I expect to > reference > > each function, with name in Excel, name in J, argument types etc - no > > problems. But this seems beyond my reach at the moment. > > > > Gratefully > > > > Graham > > > > David Mitchell wrote: > > > > > > > Graham, > > > > > > You are welcome. > > > > > > The Excel help search shows several possible explanations for error > > > 429. > > > > > > I suspect that the most likely cause is that you may not have the > > > correct > > > version of J7 J.DLL registered for the version of Excel you are > > > running. > > > > > > All of the versions I currently have of Excel are 32 bit versions. I > > > did use a > > > beta version of 64 bit Excel for a while, but it expired. > > > > > > So, I make sure that I have registered the current 32 bit version of > > > J.DLL when > > > I use Excel. > > > > > > I believe you can register both the 32 and 64 bit version of J.DLL and > > > Win7 will > > > figure out which to use, but it has been a while since I tried that. > > > > > > So, the safest way is to make sure that the last version of J.DLL you > > > register > > > matches your version of Excel. > > > > > ------------------------------ > > > > > > Message: 2 > > > Date: Mon, 21 Feb 2011 10:45:30 -0500 > > > From: David Mitchell <[email protected]> > > > Subject: Re: [Jprogramming] J embedded in Excel > > > To: Programming forum <[email protected]> > > > Message-ID: <[email protected]> > > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > > > One more thought. I always use a cmd window with Administrator > > > authority to run > > > regsvr32. > > > > > > On Win7, you can type > > > > > > cmd.exe > > > > > > in the search window of the command window. When you see cmd.exe show > > > up at the > > > top of the search window, right-click it and select "Run as > > > administrator". > > > > > > After answering Yes to the UAC prompt, you can then cd to the J bin > > > directory > > > and run regsvr32. > > > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ------------------------------ > > Message: 3 > Date: Mon, 21 Feb 2011 13:23:11 -0500 > From: David Mitchell <[email protected]> > Subject: Re: [Jprogramming] J embedded in Excel > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Well, I suspect it could be simpler than you outline, but perhaps not as > simple > as it might be. > > What version of Windows and Excel are you using? It might be possible for > me to > duplicate your error if I can try it in an environment more similar to > yours. > > On 2/21/2011 13:11, Graham Parkhouse wrote: > > I didn't use cmd.exe the first time: I have now, but I still get the same > > error message when I run your macro, and it stops on the same line. I've > > only done it with J701 and everything is 32 bit. > > > > I have been looking up a lot of stuff on the internet, but am not greatly > > encouraged. It seems you have to register every macro, and then only if > its > > written in C++, C#, F# or Jscript, and NOT the J script I'm looking for! > I > > was hoping I could attach a script file to a directory containing my > Excel > > file and get ready access to the functions in J. OK, I expect to > reference > > each function, with name in Excel, name in J, argument types etc - no > > problems. But this seems beyond my reach at the moment. > > > > Gratefully > > > > Graham > > > > David Mitchell wrote: > > > > > >> Graham, > >> > >> You are welcome. > >> > >> The Excel help search shows several possible explanations for error > >> 429. > >> > >> I suspect that the most likely cause is that you may not have the > >> correct > >> version of J7 J.DLL registered for the version of Excel you are > >> running. > >> > >> All of the versions I currently have of Excel are 32 bit versions. I > >> did use a > >> beta version of 64 bit Excel for a while, but it expired. > >> > >> So, I make sure that I have registered the current 32 bit version of > >> J.DLL when > >> I use Excel. > >> > >> I believe you can register both the 32 and 64 bit version of J.DLL and > >> Win7 will > >> figure out which to use, but it has been a while since I tried that. > >> > >> So, the safest way is to make sure that the last version of J.DLL you > >> register > >> matches your version of Excel. > >> > > ------------------------------ > >> > >> Message: 2 > >> Date: Mon, 21 Feb 2011 10:45:30 -0500 > >> From: David Mitchell<[email protected]> > >> Subject: Re: [Jprogramming] J embedded in Excel > >> To: Programming forum<[email protected]> > >> Message-ID:<[email protected]> > >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >> > >> One more thought. I always use a cmd window with Administrator > >> authority to run > >> regsvr32. > >> > >> On Win7, you can type > >> > >> cmd.exe > >> > >> in the search window of the command window. When you see cmd.exe show > >> up at the > >> top of the search window, right-click it and select "Run as > >> administrator". > >> > >> After answering Yes to the UAC prompt, you can then cd to the J bin > >> directory > >> and run regsvr32. > >> > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ------------------------------ > > Message: 4 > Date: Mon, 21 Feb 2011 13:29:52 -0500 > From: Devon McCormick <[email protected]> > Subject: Re: [Jprogramming] Inverting Programs > To: Programming forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > There has been talk, usually on April 1st, of augmenting standard computer > language instructions like "goto" with ones such as "comefrom". > > More seriously, I've noticed that debugging often consists of tracing > backwards through a program from the point at which an incorrect result > appears to get back to the point of the error. This is where good > modularization - especially avoidance of globals - and the ability to cut > back the calling stack greatly helps this kind of detective work. It would > be handy to be able to run backwards while displaying selected values to > automate some of these manual debugging steps. > > The problem of automatically computing the inverse program seems > potentially > unsolvable in the general sense. > > On Mon, Feb 21, 2011 at 1:16 AM, Steven Taylor <[email protected]> wrote: > > > Hi, > > > > Just sharing a thought. > > > > I was flicking through this old text book "The Science Of Programming" by > > David Gries (1981), while thinking that it was one of the few I > remembered > > -- it made an impression on me. > > > > Here's a quote: "Wouldn't it be nice to be able to run a program > backwards > > or, better yet, to derive from one program P a second program P-1 that > > computes the inverse of P? That means that running followed by P-1 would > be > > the same as not running any program at all! Also, if we had the result of > > executing P, but had lost the input, we could execute P-1 to determine > that > > input. " > > > > -Steven > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > -- > Devon McCormick, CFA > ^me^ at acm. > org is my > preferred e-mail > > > ------------------------------ > > Message: 5 > Date: Mon, 21 Feb 2011 13:58:28 -0500 > From: Devon McCormick <[email protected]> > Subject: Re: [Jprogramming] Critique please! > To: Programming forum <[email protected]> > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > Intuitively, I would think of negative numbers as indicating the past but > maybe that's just me. > > On Sat, Feb 19, 2011 at 1:35 AM, Ric Sherlock <[email protected]> wrote: > > > I'm interested in suggested improvements or alternative approaches. > > > > ... > > > > sayDiffNow _2 0 0.05 0.1 0.5 1 13 22 32 > > in the future > > less than an hour ago > > ... > > > > -- > Devon McCormick, CFA > ^me^ at acm. > org is my > preferred e-mail > > > ------------------------------ > > Message: 6 > Date: Mon, 21 Feb 2011 14:13:57 -0500 > From: David Ward Lambert <[email protected]> > Subject: Re: [Jprogramming] Inverting Programs > To: [email protected] > Message-ID: <1298315637.1924.600.camel@lambertdw> > Content-Type: text/plain; charset="UTF-8" > > Wikipedia: > "In computer programming, COMEFROM (or COME FROM) is an obscure control > flow structure used in some programming languages, originally as a > joke." > See also assigned come from and DON'T statements. > > > Date: Mon, 21 Feb 2011 06:16:32 +0000 > > From: Steven Taylor <[email protected]> > > Subject: [Jprogramming] Inverting Programs > > To: [email protected] > > Message-ID: > > <[email protected]> > > > > ------------------------------ > > Message: 7 > Date: Mon, 21 Feb 2011 14:21:23 -0500 > From: David Mitchell <[email protected]> > Subject: Re: [Jprogramming] J embedded in Excel > To: Programming forum <[email protected]> > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > I created a Module in an Excel workbook with this definition: > > Public Function FIB(arg As Integer) As String > Dim jObject As New JDLLServerLib.JDLLServer > Dim rObject As Variant > > Rem f0a from > http://www.jsoftware.com/jwiki/Essays/Fibonacci%20Sequence > Status = jObject.Do("f0a=: 3 : 'if. 1<y do. (y-2) +&f0a (y-1) else. y > end.' > M.") > Status = jObject.DoR("f0a " & Str(arg), rObject) > FIB = Str(rObject) > jObject.Quit > End Function > > I saved it and went back to the workbook. I entered > > 16 > > in A1. I entered > > =FIB(A1) > > In A2. > > I entered > > =FIB(A2) > > in A3. Here is the content of A1:A3 > > 16 987 8.34288E+205 > > This is presented as an example of what can be done. It is probably not > the > best way to do it. > > On 2/21/2011 13:11, Graham Parkhouse wrote: > > I didn't use cmd.exe the first time: I have now, but I still get the same > > error message when I run your macro, and it stops on the same line. I've > > only done it with J701 and everything is 32 bit. > > > > I have been looking up a lot of stuff on the internet, but am not greatly > > encouraged. It seems you have to register every macro, and then only if > its > > written in C++, C#, F# or Jscript, and NOT the J script I'm looking for! > I > > was hoping I could attach a script file to a directory containing my > Excel > > file and get ready access to the functions in J. OK, I expect to > reference > > each function, with name in Excel, name in J, argument types etc - no > > problems. But this seems beyond my reach at the moment. > > > > Gratefully > > > > Graham > > > > David Mitchell wrote: > > > > > >> Graham, > >> > >> You are welcome. > >> > >> The Excel help search shows several possible explanations for error > >> 429. > >> > >> I suspect that the most likely cause is that you may not have the > >> correct > >> version of J7 J.DLL registered for the version of Excel you are > >> running. > >> > >> All of the versions I currently have of Excel are 32 bit versions. I > >> did use a > >> beta version of 64 bit Excel for a while, but it expired. > >> > >> So, I make sure that I have registered the current 32 bit version of > >> J.DLL when > >> I use Excel. > >> > >> I believe you can register both the 32 and 64 bit version of J.DLL and > >> Win7 will > >> figure out which to use, but it has been a while since I tried that. > >> > >> So, the safest way is to make sure that the last version of J.DLL you > >> register > >> matches your version of Excel. > >> > > ------------------------------ > >> > >> Message: 2 > >> Date: Mon, 21 Feb 2011 10:45:30 -0500 > >> From: David Mitchell<[email protected]> > >> Subject: Re: [Jprogramming] J embedded in Excel > >> To: Programming forum<[email protected]> > >> Message-ID:<[email protected]> > >> Content-Type: text/plain; charset=ISO-8859-1; format=flowed > >> > >> One more thought. I always use a cmd window with Administrator > >> authority to run > >> regsvr32. > >> > >> On Win7, you can type > >> > >> cmd.exe > >> > >> in the search window of the command window. When you see cmd.exe show > >> up at the > >> top of the search window, right-click it and select "Run as > >> administrator". > >> > >> After answering Yes to the UAC prompt, you can then cd to the J bin > >> directory > >> and run regsvr32. > >> > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ------------------------------ > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > End of Programming Digest, Vol 65, Issue 49 > ******************************************* > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
