On Tue, 1 Feb 2022, 14:32:43 +10 Henry Rich wrote:
> Many ideas have been aired.  But please, every now and again address the
> questions I need answers for:
> 
> 1. What is a Dictionary, EXACTLY?

1.1. Dictionary (I prefer shorter term: "map") is a data structure 
establishing a discrete surjective mapping with finite set of arguments.

1.2. Dictionary consists of keys and values.
     1.2.1. A pair (key,value) is a mapping establishing structure.
     1.2.2. A mapping from key to value is denoted as: {key -> value}.

1.3. Keys are considered as unordered set.
     1.3.1. A key is an input datum, an argument.
     1.3.2. An index error is thrown in unexpected cases.

1.4. A value is an output datum, a result.

1.5. Concrete mapping variant depends on the following:
     1.5.1. Are keys homogeneous or heterogeneous in datatype and shape?
     1.5.2. Are values homogeneous or heterogeneous in datatype and shape?

1.6. Variants based on different underlying data structure:
       mapFXB.ijs  Map noun to boxed noun
       mapFZB.ijs  Map non-negative integer to boxed noun
       mapOIN.ijs  Map integer to number
       mapOIX.ijs  Map integer to noun
       mapOXX.ijs  Map noun to noun
       mapOZN.ijs  Map non-negative integer to number
       mapOZX.ijs  Map non-negative integer to noun

> 2. What operations can be performed on a Dictionary?

2.1. Basic operations:
  init    Init map
  keyset  Get used keys set
  has     Check whether the key given is used
  get     Get the value by key
  put     Put the value at key
  del     Delete the pair by key
  dump    Helper procedure to dump map nouns

2.2. Additional operations for variants based on locales:
  create   Construct map object
  destroy  Destroy map object
  reset    Reset map

2.3. Additional operations:
  chk  Check the key
  kio  Transcode the key to/from IO key

-- 
Regards
Igor


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

Reply via email to