3 ms·
> functional, OO and imperative programming when needed Please tell me how to get a reasonable implementation of list or tree values in JavaScript, without res
by catnaroek 9y ago
> functional, OO and imperative programming when needed
Please tell me how to get a reasonable implementation of list or tree values in JavaScript, without resorting to Gödel encodings or gentlemen agreements not to query object identities.
Now recall that functions are mappings from values to values. How are we supposed to express computation as function evaluation without a rich set of values to work with?
That's how well JavaScript (or Lisp, for that matter) supports functional programming. (I can't comment on object orientation support because I don't know of a logically consistent theory of objects.)
> JavaScript has fixed S-expressions
Weird. Lisps are traditionally semantically a mess (Scheme less so than Common Lisp, though), but the syntax, allowing for relatively easy metaprogramming, is their main saving grace.
> Macros are harmful to programming in the large.
Just because you don't understand macros, it doesn't mean other people can't put them to good use.
> JavaScript got rid of linked lists (that are awkward and impractical for everyday use) and introduced hash-tables into the language.
Practical Lisps provide several useful data structures out of the box. In any case, this is a matter of standard library design, not language design.
- deleted 9y ago[deleted]