On 5/14/2023 1:46 AM, J-P. Rosen wrote:
> Le 13/05/2023 à 18:53, Niklas Holsti a écrit :
>> for Pascal.
>>
>> Early LISP languages did not have record types, AFAIK. But you could of
>> course use lists to program record-like data structures.
> Of course, in LISP there is only one structure, for data and programs
> alike: the list!
>
This is similar to Mathematica. I programmed a little in lisp,
and it was kinda fun.
In Mathematica, its main data struct is also the list
and list of lists and list of list of lists and so on.
a={1,2,3};
a={{1,2,3},{4,5,6}};
Everything in Mathematica is pretty much build using lists.
Few years ago, Wolfram introduced Association, which
acts like a RECORD. It is really like a dictionary. It has
key->value pairs so one can do:
myData = <| "name"->"me","age"->99 |>
To read value of a field one uses myData["name"] or myData["age"].
It is amazing how people can program so much code
using only just a list as the main basic data structure
and be able to get away with it :)
I think RECORD is the most important data structure myself.
Without a RECORD (called struct in C), programming
is much harder. This is what Java and Python have discovered
just now. I guess the language designers of these
languages never bothered to look at Pascal or Ada before.
But better late than never I guess.
--Nasser