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

In this particular lisp's case, the interpretList function contains:

    if (list[0] instanceof Function) {
      return list[0].apply(undefined, list.slice(1));
    } else {
      return list;
    }
Or in other words, a list is interpreted as a call if it starts with a function, or else it's interpreted as just the list as data. (1 2) is the latter case, since 1 is not a function.


That's actually how Picolisp functions, and is quite convenient.




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

Search: