Re: [Jgeneral] NuVoc wordings

2022-06-09 Thread Henry Rich
The premise is false.  Copies of the inputs are rarely made, usually 
only when conversion is required.  When possible, the argument is 
operated on inplace with the result occupying the same memory as the 
argument.


Art does have a point about the Nub documentation, but it is important 
that the opening lines of the NuVoc entry focus on answering the 
question "What does ~. y do?" without repeating boilerplate to the 
effect that the result is distinct from the argument.  Nobody expects -5 
to change the value of 5, or ~.a to change the value of a.  IMO that 
entry is OK as it stands.


Henry Rich



On 6/9/2022 6:09 AM, Arthur Anger wrote:

All--
Each non-assigment step in a computation produces copies(!) of its inputs, 
selected and arranged in various specified ways, awaiting disposition--in 
another step, in assignment to storage, in output, or in discard.

At the very least, any recipe for processing an array should begin with some version of 
"Take a copy of y, then...", and consistently refer to that copy, rather than 
to y.

As an example, the page for Nub currently contains the following statements:
   Removes duplicates from a list 
.

   More generally, removes any item 
 of an array 
 that matches a preceding item.

   1. Remove duplicate values 
 from a lis 
t

   2. Remove duplicate rows from a table 

I recommend replacing them with:
   Copies items from a list, omitting duplicates.
   More generally, omits any item 
 of an array 
 that matches a preceding item.
   1. Omit duplicate values 
 from a lis 
t
   2. Omit duplicate rows from a table 


The language used to describe a verb often suggests that its result will 
somehow replace the values being operated on, which will be (nearly) accurate 
only if followed immediately by re-assignment to the same, named, argument.

I urge that any new documentation observe this distinction, and that any 
definition being updated follow this pattern.  If there is a consensus that 
this is a worthy cause, I shall be willing to propose such changes where I may 
encounter them in coming months.
--Art



--
For information about J forums see http://www.jsoftware.com/forums.htm



--
This email has been checked for viruses by AVG.
https://www.avg.com

--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jgeneral] NuVoc wordings

2022-06-09 Thread Raul Miller
On Thu, Jun 9, 2022 at 12:14 AM Arthur Anger  wrote:
> Each non-assigment step in a computation produces copies(!) of its inputs, 
> selected and arranged in various specified ways, awaiting disposition--in 
> another step, in assignment to storage, in output, or in discard.

In addition to the points Chris Burke raised, in a practical sense
this is either a very difficult concept, or a misleading concept.

Consider, for example:

   spacex=: 7!:2
   spacex 'i.1e5'
1049376
   spacex '1+i.1e5'
1049376
   spacex '2+1+i.1e5'
1049376
   spacex '2*1+i.1e5'
1049376
   spacex '3^2*1+i.1e5'
2098048
   spacex '4+3^2*1+i.1e5'
2098432

   JVERSION
Engine: j904/j64avx2/windows
Beta-d: commercial/2022-05-19T20:39:35
Library: 9.04.01
Qt IDE: 2.0.3/6.2.4(6.2.4)
Platform: Win 64
Installer: J904 install
InstallPath: c:/other/j904
Contact: www.jsoftware.com

FYI,

-- 
Raul
--
For information about J forums see http://www.jsoftware.com/forums.htm


Re: [Jgeneral] NuVoc wordings

2022-06-08 Thread chris burke
I am opposed to this for several reasons, e.g.

I disagree that verb descriptions suggest that results will somehow
replace the values being operated on.

Experienced users don't think this way, and beginners will quickly follow suit.

It makes any explanations longer. We expect users to understand J
syntax without constant reminder of it.

By starting with "takes a copy of" this suggests that something
unusual is being done. So the natural question would then be what if I
don't want to "take a copy of".

On Wed, Jun 8, 2022 at 9:14 PM Arthur Anger  wrote:
>
> All--
> Each non-assigment step in a computation produces copies(!) of its inputs, 
> selected and arranged in various specified ways, awaiting disposition--in 
> another step, in assignment to storage, in output, or in discard.
>
> At the very least, any recipe for processing an array should begin with some 
> version of "Take a copy of y, then...", and consistently refer to that copy, 
> rather than to y.
>
> As an example, the page for Nub currently contains the following statements:
>   Removes duplicates from a list 
> .
>
>   More generally, removes any item 
>  of an array 
>  that matches a 
> preceding item.
>
>   1. Remove duplicate values 
>  from a lis 
> t
>
>   2. Remove duplicate rows from a table 
> 
> I recommend replacing them with:
>   Copies items from a list, omitting duplicates.
>   More generally, omits any item 
>  of an array 
>  that matches a 
> preceding item.
>   1. Omit duplicate values 
>  from a lis 
> t
>   2. Omit duplicate rows from a table 
> 
>
> The language used to describe a verb often suggests that its result will 
> somehow replace the values being operated on, which will be (nearly) accurate 
> only if followed immediately by re-assignment to the same, named, argument.
>
> I urge that any new documentation observe this distinction, and that any 
> definition being updated follow this pattern.  If there is a consensus that 
> this is a worthy cause, I shall be willing to propose such changes where I 
> may encounter them in coming months.
> --Art
>
>
>
> --
> For information about J forums see http://www.jsoftware.com/forums.htm
--
For information about J forums see http://www.jsoftware.com/forums.htm


[Jgeneral] NuVoc wordings

2022-06-08 Thread Arthur Anger
All--
Each non-assigment step in a computation produces copies(!) of its inputs, 
selected and arranged in various specified ways, awaiting disposition--in 
another step, in assignment to storage, in output, or in discard.

At the very least, any recipe for processing an array should begin with some 
version of "Take a copy of y, then...", and consistently refer to that copy, 
rather than to y.

As an example, the page for Nub currently contains the following statements:
  Removes duplicates from a list 
.

  More generally, removes any item 
 of an array 
 that matches a preceding 
item.

  1. Remove duplicate values 
 from a lis 
t

  2. Remove duplicate rows from a table 

I recommend replacing them with:
  Copies items from a list, omitting duplicates.
  More generally, omits any item 
 of an array 
 that matches a preceding 
item.
  1. Omit duplicate values 
 from a lis 
t
  2. Omit duplicate rows from a table 


The language used to describe a verb often suggests that its result will 
somehow replace the values being operated on, which will be (nearly) accurate 
only if followed immediately by re-assignment to the same, named, argument.

I urge that any new documentation observe this distinction, and that any 
definition being updated follow this pattern.  If there is a consensus that 
this is a worthy cause, I shall be willing to propose such changes where I may 
encounter them in coming months.
--Art



--
For information about J forums see http://www.jsoftware.com/forums.htm