Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

By your definition of lists, misc uses lists to represent maps?


I guess it can do so. I don't really understand why one would want to ‘base’ the language on maps to promptly go back to lists for putting these integer-keyed maps in. Where's the ‘based on maps’ part then?

It would be really map-based, in my book, if it used named arguments for every function—though that would be incredibly cumbersome (ahem ObjC cough). As it is, it's just regular Lisp but with map keys having colons on the right instead of the left.


A map with integer keys is closer to an array than a list.

I'm not sure I follow your arguments - you seem to be talking of "lists" as some sort of string syntax, possibly as some form of abstract syntax - but either way separate from the abstract data structure?

That's not how I read the comment from the misc page - they seem to be talking about the ADT - much like clojure chose to not use lists made from cons pairs?


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.


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

As for collections within collections, python allows for that in "lists" (arrays) and "dictionaries" (maps).


That'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, ...]?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: