Arc Forumnew | comments | leaders | submitlogin
1 point by Pauan 4696 days ago | link | parent

And now things like `assign`, `if`, and `is` work. Which means that the `in` macro also works:

  (in x "foo" "bar" "qux")
Becomes:

  (function (g1585) {
      return (function (g1586) {
          return (g1586 ? g1586 : (function (g1587) {
              return (g1587 ? g1587 : (function (g1588) {
                  return (g1588 ? g1588 : undefined);
              })((g1585 === "qux")));
          })((g1585 === "bar")));
      })((g1585 === "foo"));
  })(x)
Atrociously inefficient and verbose, obviously, but it does work. And when I add in `or` it should become clearer.

---

EDIT: I just added in `or`. Now the output is a lot more readable:

  (function (g1590) {
      return ((g1590 === "foo") || (g1590 === "bar") || (g1590 === "qux"));
  })(x)
Also, you may have noticed that the output includes the actual gensym name. This is unfortunate, but JS doesn't have gensyms, so it's the best we can do.