Hi there,

Thanks for checking.

The problem is with the definition of a monadic tact verb numCols  but 
accidentally trying to use it dyadically.  No problem with amend adverb.

PEBCAS !

Ian

  

-----Original Message-----
From: General [mailto:[email protected]] On Behalf Of Ian 
Shannon
Sent: Monday, 5 December 2016 5:58 PM
To: [email protected]
Subject: Re: [Jgeneral] Possible bug in AMEND

Hi there Brian,

Thank for testing it out.  Yes there is an error executing the gerund with 
amend.


What I found was
0:  _99 newData data
will deliver new data correctly

1:   numCols data
returns the required index for amend

2: I get an error when I put those together with ] into a gerund for left arg 
of amend as in dataD =: _99 (newData`numCols`] }) data

It is not a problem with gerunds attached to amend because I can evaluate
  numCols data
and make into a constant verb as in
indexes =: (numCols data) "_
and replace verb numCols by verb indexes in the gerund where it succeeds as in 
dataA =: _99 (newData`indexes`] }) data

If everything worked OK then
data1 -: data2
data1 -: data3
data1 -: data4

=========


Hi there Pascal Jasmin,

I copied and pasted a script that I can run in J805 and J701 to demonstrate the 
error.

Additionally I supplied it as an attachment which may well have been stripped 
off.

Re: lines in emails.  Sorry I have only m$ outlook to use on our corporate 
network and I find it somehow manages to incorrectly second guess what is 
required, especially with fixed spaced fonts.

Thanks for looking at my problem,

Ian

Ian Shannon
Science Strategy Branch, Science Division Office of Environment & Heritage



-----Original Message-----
From: General [mailto:[email protected]] On Behalf Of Brian 
Schott
Sent: Monday, 5 December 2016 4:30 PM
To: General forum <[email protected]>
Subject: Re: [Jgeneral] Possible bug in AMEND

In the future it would be easier to read and later test your email if there 
were no extra lines. At least with gmail this can be accomplished by using 
"paste special" instead of "paste".

When I attempt to execute your code, I do not get an error at first, when I use 
your first definition of numCols, but then I get domain error when I use your 
second definition of numCols.

   numCols =: [: <@:(a:&;) [: i.&.:(-&3) [: {:@:$ ]
   _99 (newData`numCols`] }) data
+-+-+-+--+--+---+
|a| |d|10|11|12 |
+-+-+-+--+--+---+
|f|g|h|13|99|15 |
+-+-+-+--+--+---+
|j|k|z|99|17|18 |
+-+-+-+--+--+---+
|x|c|v|19|20|21 |
+-+-+-+--+--+---+
|b|n|m|22|23|_99|
+-+-+-+--+--+---+

   numCols =: [: < (<a:) replaceEmpty (_1 * #@:$) {. [: <  [: i.&.:(-&3) [:
{:@:$ ]
   _99 (newData`numCols`] }) data
    |domain error: numCols
|   _99    (newData`numCols`]})data



--
(B=) <-----my sig
Brian Schott
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
This email is intended for the addressee(s) named and may contain confidential 
and/or privileged information. 
If you are not the intended recipient, please notify the sender and then delete 
it immediately.
Any views expressed in this email are those of the individual sender except 
where the sender expressly and with authority states them to be the views of 
the NSW Office of Environment and Heritage.

PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
This email is intended for the addressee(s) named and may contain confidential 
and/or privileged information. 
If you are not the intended recipient, please notify the sender and then delete 
it immediately.
Any views expressed in this email are those of the individual sender except 
where the sender expressly and with authority states them to be the views of 
the NSW Office of Environment and Heritage.

PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to