This is really too soon. We haven't even found and fixed all existing
uses of those words.

That said, what would they be used to do?

As Henry mentioned in another message, locales already supply the
"get/fetch" semantics.

What he didn't mention is that you can use i. in conjunction with {
and } to do something quite similar, already. So what we're talking
about is potential optimizations.

Basically, though, I think we're talking about using character lists
as array indices.  So how might that work?

Imagine if we could do things like ('key' { array) or (value 'key'}
array) and have that "just work". What would that be like?

One issue: we need to think about keys of differing lengths. So we'd
need some kind of rule to eliminate padding from keys when they're
used.

Another issue: boxing already has meaning in the context of { and }
array indices. Could we get away with just a rule that if the index
type is literal we expect the indices to be rank 1 instead of rank 0?

But here's another issue: these kinds of arrays are sparse. So maybe
what we're really talking about is a variation on sparse arrays with
all dimensions being sparse indices? And, maybe, with arbitrary rank
(implicitly: the rank of the array would be the length of the longest
key and all keys would be padded to that length when used)?

Which brings me back to my previous question: what would they be used to do?

Thanks,

-- 
Raul

On Sun, Nov 17, 2019 at 10:29 PM 'Jon Hough' via Programming
<programm...@jsoftware.com> wrote:
>
>  Since d. /D. are being retired (for derivative usage), why not use them for 
> an inbuilt dictionary type?
> I think J would be better with some kind of hashmap / dictionary (O(1) lookup 
> time), and d./D. already match
> the first letter of "dictionary", so it's the perfect fit.
>      On Monday, November 18, 2019, 12:25:27 PM GMT+9, bill lam 
> <bbill....@gmail.com> wrote:
>
>  key/value dictionary can be done in addon, but I think better
> implemented in C for efficieny because it contains loops.
>
>
> Sun, 17 Nov 2019, Henry Rich написал(а):
> > In J I find myself coming back to simple arrays for most data structures.
> >
> > Trees can be represented as boxes containing subtrees.  That works, but is
> > usually more trouble than simply managing an array.
> >
> > Linked lists are used only for efficiency, and in the cases where that
> > matters you can easily have a list of indexes to an array of data items.
> >
> > Stacks are just lists, as Devon said.
> >
> > The datatype I really want is a directory object that acts as an efficient
> > and easy-to-use associative memory.  You put key/values in and then retrieve
> > a value by presenting its key.  Has anyone written an addon for that?
> >
> > (Note: the primitive 128!:8 (create a hash for a noun) was added to J9.01
> > with this in mind)
> >
> > Henry Rich
> >
> > On 11/17/2019 8:16 PM, 'Bo Jacoby' via Programming wrote:
> > >  I failed to communicate the links before, but here they are. Ordinal 
> > > fractions are somewhat like infinite-dimensional arrays.
> > > https://www.academia.edu/10031088/ORDINAL_FRACTIONS_-_the_algebra_of_data
> > >
> > >
> > > http://www.statemaster.com/encyclopedia/Ordinal-fraction
> > > Bo.
> > >
> > >      Den søndag den 17. november 2019 22.07.28 CET skrev Devon McCormick 
> > > <devon...@gmail.com>:
> > >  Trees are simple to implement in J -
> > > https://code.jsoftware.com/wiki/User:Devon_McCormick/Trees - as are graphs
> > > -
> > > https://code.jsoftware.com/wiki/NYCJUG/2009-11-10/BreadthFirstGraphTraversal
> > >  .
> > > A stack is simple to implement too but I'm not sure why you would want to
> > > as it's simply a vector with very restrictive rules to manipulate it.
> > > Linked lists make no sense in a language with dynamic arrays for much the
> > > same reason since a linked list is mainly a way of implementing dynamic
> > > arrays but has benefit only in a language which lacks these natively.
> > >
> > > On Sun, Nov 17, 2019 at 8:24 AM 'Bo Jacoby' via Programming <
> > > programm...@jsoftware.com> wrote:
> > >
> > > >    ORDINAL FRACTIONS - the algebra of data
> > > >
> > > >
> > > >
> > > > |
> > > > |
> > > > |
> > > > |  |  |
> > > >
> > > >    |
> > > >
> > > >    |
> > > > |
> > > > |  |
> > > > ORDINAL FRACTIONS - the algebra of data
> > > >
> > > > This paper was submitted to the 10th World Computer Congress, IFIP 1986
> > > > conference, but rejected by the referee....
> > > >    |
> > > >
> > > >    |
> > > >
> > > >    |
> > > >
> > > >
> > > >
> > > >
> > > >      Den søndag den 17. november 2019 07.12.02 CET skrev Raul Miller <
> > > > rauldmil...@gmail.com>:
> > > >
> > > >    Arrays are roughly analogous to computer memory.
> > > >
> > > > Put different: I think you are asking the wrong question.
> > > >
> > > > (Partially: it's worth thinking about why you pick whichever data
> > > > structures...)
> > > >
> > > > ((It can also sometimes be useful to look on rosettacode for examples of
> > > > various daya structure handling mechanisms.))
> > > >
> > > > Thanks,
> > > >
> > > > --
> > > > Raul
> > > >
> > > > On Sat, Nov 16, 2019 at 6:00 PM Jimmy Gauvin <jimmy.gau...@gmail.com>
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > when dealing with data structures other than arrays such as trees,
> > > > graphs,
> > > > > stacks, linked lists what other programming language do you resort to 
> > > > > ?
> > > > >
> > > > > Or do stick with J for all endeavours?
> > > > >
> > > > >
> > > > > Jimmy
> > > > > ----------------------------------------------------------------------
> > > > > 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
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> ----------------------------------------------------------------------
> 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

Reply via email to