[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Paul Graham's PyCon Keynote
Kimberley Burchett <kimbly@cybercom.net> wrote:
>I've been playing with the idea of a language where even the difference
>between data structures and functions is erased.
>
>You can think of an n-ary function as a simple n-ary array of values. If
>you allow assigning to the result of a function (meaning that the function
>should return the assigned value the next time it's called), then
>functions can take the place of data structures, and vice versa.
>Here, get(int) and size() are basically N-array arrays -- they have no
>side-effects, and their value is simply determined by whatever value was
>assigned to them last. I usually assume a semantics where functions are
>initially undefined everywhere, and attempting to read an undefined value
>results in an error (so get(0) would assert if you hadn't called append
>yet).
I've been reading Leslie Lamport's _Specifying Systems: The TLA+
Language and Tools for Hardware and Software Engineers_, and I think
that is the approach he takes for TLA+. It's not a programming
language, but the idea is not as weird as it first seems. (Well, ok,
maybe it is.)
Tommy McGuire