3 ms·
Now your distinctions seem foreign to me. Let's look at this structure in Python: ["qwe", 1.1, True, None, [], var1] Is this an array, a linked list or what?
by aasasd 7y ago
Now your distinctions seem foreign to me.
Let's look at this structure in Python:
["qwe", 1.1, True, None, [], var1]
Is this an array, a linked list or what? Can an integer-indexed map be mapped onto this structure?
To me it looks perfectly cromulent for making a Lisp.
- e12e 7y agoSince there isn't any traversal when looking up an element n, I guess the best "short hand" would be to call it an array - it's an array of pointers to objects on the heap. https://www.laurentluce.com/posts/python-list-implementation/ https://www.laurentluce.com/posts/python-list-implementation... As for collections within collections, python allows for that in "lists" (arrays) and "dictionaries" (maps).
- kazinator 7y agoThat's not a structure in Python; that's a piece of program syntax which constructs one. Python is confused between the two, but here we have a telltale detail that tells us which this is: the presence of var1. Can you write a Python function which returns a list that contains var1 as an element, so that it prints exactly as [... ,var1, ...]?