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

And now styles work, so this:

  (append document.body
    (div style (height          50px
                width           50px
                backgroundColor black)

         on    (click (e)
                 (alert "foo")))

    (div style (height          50px
                width           50px
                backgroundColor green)

         on    (click (e)
                 (alert "bar"))))
Is compiled into this:

  document.body.appendChild((function (self) {
      self.style.height = "50px";
      self.style.width = "50px";
      self.style.backgroundColor = "black";
      self.addEventListener("click", (function (e) {
          return alert("foo");
      }), true);
      return self;
  })(document.createElement("div")));
  
  document.body.appendChild((function (self) {
      self.style.height = "50px";
      self.style.width = "50px";
      self.style.backgroundColor = "green";
      self.addEventListener("click", (function (e) {
          return alert("bar");
      }), true);
      return self;
  })(document.createElement("div")));