in reply to Representing all data as Lists (Perl7?)

Why stop with lists?

You can make your data type even more elegant and inefficient by constructing everything from sets. The mathematics of set theory is rock solid, and it's what mathematicians actually use as their theoretical underpinnings for almost all of mathematics.

Sets will give you what you seem to be looking for; maximum theoretical abstraction, with a minimum of real world application. As a mathematician, I'm not fond of excessive abstraction. You just have to abstract back up the chain to build up useful abstractions again, like complex numbers, addition, subtraction, and so forth. Few mathematicians bother to describe addition in terms of the underlying set theory, except to prove that it can actually be done.

Real world applications need useful data types. Strings should always be a built in data type; any language that lacks strings as a built-in data type ends up building them right back into the language again using some sort of standard library. From a practical standpoint, the only real difference between a feature that's in the core language and a feature that's in a core library is the extra commands required to include the library, and how awkward the syntax is.

--
Ytreq Q. Uiop

Replies are listed 'Best First'.
Re^2: Representing all data as Lists
by rje (Deacon) on Sep 20, 2005 at 17:34 UTC
    It seems like you're talking about LISP. Isn't a Cons a simple pair set? And wasn't LISP originally simply a mathematical proof? (Forgive my naivetie, I don't know much about LISP, and have used it only in mutant forms).

    "From a practical standpoint, the only real difference between a feature that's in the core language and a feature that's in a core library is the extra commands required to include the library, and how awkward the syntax is."

    I'm not exploring what happens to the language when things are removed from the core, but rather if anything useful can happen to programmers and the way they program when the internal representation changes.

    But actually, I'm not even exploring that. I'm trying to figure out what Perl programmers can do if Perl represented scalars and hashes as lists.