I agree Robert, symbols are a logical fit if hash tables are implemented.


Symbols are a regular part of my diet (small size and quick checking of 
equality). The closest need to hash tables I have come across is looking up 
data in a table where one column is a symbol. Usually I look-up many items in 
one go, so overheads are not an issue and arrays are fine.





De : 'robert therriault' via Programming <[email protected]>
À : programming <[email protected]>
Sujet : Re: [Jprogramming] Hashing primitives WAS: Farewell for now!
Date : 14/04/2021 17:10:08 Europe/Paris

I don't want to create unnecessary noise, but where could symbols fit into 
this? 

I have never been clear on their function within the language and so I have not 
used them. I do know that they also involve hash table look up. 

Is it possible to provide some verbs that can manipulate the Global Symbol 
Table?

Cheers, bob

> On Apr 14, 2021, at 07:56, Henry Rich <[email protected]> wrote:
> 
> Let's get a spec for what we need before we implement.
> 
> 1. What datatypes are needed?
> * Dictionary
> 
> 2. What operations are needed?
> * Add key/value pairs
> * return value for a given key
> 
> 3. What are the types of key and value?
> * they can have any type
> * perhaps the keys have to have all the same type, values likewise
> 
> Please fill this out. This is as far as I got, and for that I think the 
> Dictionary type could just be a numbered locale with a few methods.
> 
> Henry Rich
> 
> 
> 
> On 4/14/2021 10:47 AM, Raul Miller wrote:
>> Conceptually, here, you're probably thinking about using hashes of
>> character strings as array indices.
>> 
>> A character string, in J, is either a boxed rank 1 list of characters
>> or a rank 1 member of a higher dimensional character array which has
>> been padded on the right hand side with spaces.
>> 
>> Since all of the current array index primitives throw an error when we
>> try to use characters to index them, I think that we would not need
>> any new primitives -- we would "only" need to characterize the
>> normalization process used to convert arbitrary character arrays or
>> boxed character arrays to array indices.
>> 
>> That said, these hashed arrays would also be sparse. And, it would be
>> desirable to support boxed items and boxed hashes. And that gets into
>> some issues which are ... rather involved, if we think about the
>> existing sparse array implementation.
>> 
>> So ... when estimating this task it might be best to think of it as
>> "re-implementing sparse arrays from the ground up"?
>> 
>> Thanks,
>> 
> 
> 
> -- 
> 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

----------------------------------------------------------------------
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