Re: [Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread Henry Rich
Yes, you're right, I misanalyzed. It goes like this: 1 2 3 starts with a usecount of 1, and a mark to indicate that the usecount should be decremented when the sentence completes. [When the usecount is decremented to 0 the block is freed]. Assignment to (a) increments the usecount, giving (

Re: [Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread 'Pascal Jasmin' via Programming
this didn't seem to work in beta 12 (latest all in one installer) - Original Message - From: Henry Rich To: [email protected] Sent: Tuesday, October 4, 2016 10:14 PM Subject: Re: [Jprogramming] Early assignment WAS: Non-mutable arrays Yes, this is executed in-place. In genera

Re: [Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread Henry Rich
Yes, this is executed in-place. In general, an assignment to a name whose value is not in use in another name causes that value to become eligible for in-place execution (with the possibility of early assignment) as long as the execution stack contains nothing beyond the value to be assigned.

Re: [Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread 'Pascal Jasmin' via Programming
I made different suggestions in my beta post. namely, this expression should also be optimized: a=: ('b' ,~ 4,~])a =: 1 2 3 if possible, early assignment should also apply in scripts (even if through tacit expressions). In general though, I think the advice "assign to new name to be safe", w

Re: [Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread bill lam
IMO the dependence of so many preconditions that affects the behavior is convoluted and unhelpful. Or at least these preconditions should be fine tuned or overrided by some 9!:53 options. On Oct 5, 2016 7:25 AM, "Henry Rich" wrote: > The whole point of operation in place is to avoid having to

Re: [Jprogramming] Non-mutable arrays

2016-10-04 Thread Xiao-Yong Jin
> On Oct 4, 2016, at 2:01 PM, Louis de Forcrand wrote: > > Maybe add a third setting to 9!:53 which copies a at the start of a tacit > verb involving in place operations? This is a good compromise between speed and sensible intuition. I guess a memcpy only when in-place-operation is detected w

Re: [Jprogramming] Fwd: ddins mangling SQL table name?

2016-10-04 Thread bill lam
or check the various forums archives, eg http://jsoftware.com/pipermail/programming/ -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] Fwd: ddins mangling SQL table name?

2016-10-04 Thread chris burke
> I apologize if this is a repeat. I am a subscriber to this list and didn't see my post, so I feared maybe no one else did either. There was only one such post. You can check the forum archives at www.jsoftware.com/forumsearch, which are updated every 5 minutes. Just click Search to see the most

Re: [Jprogramming] assert and assert.

2016-10-04 Thread 'Pascal Jasmin' via Programming
a better version of assert assert2 =: ]`([ 13!:8 (12"_))@.(0 e.]) assert 3 4 NB. returns nothing assert 3 4 0 |assertion failure: assert 'bad' assert 3 4 0 |bad: assert | 'bad'assert 3 4 0 what makes assert2 useful is that it raises an error if result includes 0 (can also be easil

Re: [Jprogramming] Fwd: ddins mangling SQL table name?

2016-10-04 Thread bill lam
The syntax is incorrect for ddins. It expected a select statement. see http://code.jsoftware.com/wiki/ODBC/Methods/Bulk_Insert you may also try ddparm/ddsparm On Oct 5, 2016 6:26 AM, "Michael Berry" wrote: > Hello All, > > I apologize if this is a repeat. I am a subscriber to this list and di

Re: [Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread Raul Miller
Whatever you go with, I think the dictionary should be updated to describe the new behavior. Perhaps we need a new supplement to the parsing&execution appendix? Thanks, -- Raul On Tue, Oct 4, 2016 at 7:25 PM, Henry Rich wrote: > The whole point of operation in place is to avoid having to cop

Re: [Jprogramming] Non-mutable arrays

2016-10-04 Thread Henry Rich
In J8.04, an in-place operation can be vetted before it is executed, and will have no effect if it fails. Henry Rich On 10/4/2016 3:01 PM, Louis de Forcrand wrote: I second Raul; the behaviour described is very counter-intuitive. Maybe add a third setting to 9!:53 which copies a at the start

[Jprogramming] Early assignment WAS: Non-mutable arrays

2016-10-04 Thread Henry Rich
The whole point of operation in place is to avoid having to copy an in-placeable argument; copying the argument would not be a good solution. After hearing the screams and dodging the dead cats, I have some proposals: 1. Early assignment (which is what we'll call the act of assigning an interm

Re: [Jprogramming] assert and assert.

2016-10-04 Thread Don Guinn
assert. can only be used in an explicit definition. On Oct 4, 2016 3:59 PM, "Michael Berry" wrote: > It certainly does! I had no idea there were so many debugging facilities. > > On Tue, Oct 4, 2016 at 5:49 PM, Raul Miller wrote: > > > assert is based on 13!:8 http://www.jsoftware.com/help/ >

[Jprogramming] Fwd: ddins mangling SQL table name?

2016-10-04 Thread Michael Berry
Hello All, I apologize if this is a repeat. I am a subscriber to this list and didn't see my post, so I feared maybe no one else did either. I am having trouble doing a bulk insert using ddins from the J ODBC library. The error message is "Invalid object name" and the object name included in the

Re: [Jprogramming] assert and assert.

2016-10-04 Thread Michael Berry
It certainly does! I had no idea there were so many debugging facilities. On Tue, Oct 4, 2016 at 5:49 PM, Raul Miller wrote: > assert is based on 13!:8 http://www.jsoftware.com/help/ > dictionary/dx013.htm > > assert. is documented at http://www.jsoftware.com/help/ > dictionary/cassert.htm > >

Re: [Jprogramming] assert and assert.

2016-10-04 Thread Raul Miller
assert is based on 13!:8 http://www.jsoftware.com/help/dictionary/dx013.htm assert. is documented at http://www.jsoftware.com/help/dictionary/cassert.htm One significant difference is that you can turn off assert. after you are done testing (if the performance cost becomes significant) using 9!:3

[Jprogramming] assert and assert.

2016-10-04 Thread Michael Berry
Is there something I can read to understand the difference between the control structure assert. and the standard library function assert and when one or the other might be preferable? -Michael -- For information about J forums se

Re: [Jprogramming] Non-mutable arrays

2016-10-04 Thread Louis de Forcrand
I second Raul; the behaviour described is very counter-intuitive. Maybe add a third setting to 9!:53 which copies a at the start of a tacit verb involving in place operations? Also, what is the current (j804) behaviour when an in-place ammend fails? Since there's only one operation, if it fails

Re: [Jprogramming] Non-mutable arrays

2016-10-04 Thread Erling Hellenäs
The J exception handling is not used? If the input variables are destroyed it could mean you are not able to recover? It is also a complex behavior the programmer has to be aware of? /Erling On 2016-10-04 04:21, bill lam wrote: 9!:53 [ 0 is the old (safe) behavior 9!:53 [ 2 is the new (p