ra’s avatarra’s Twitter Archive—№ 39,164

    1. pretty excited about this: i managed to get a basic macro expander working in jn! theyre implemented in F# as a stopgap (like the rest of the standard library) but they totally work in principle. this is a big step towards being a real lisp and not just c# with parentheses!
  1. …in reply to @ra
    syntactic conveniences were left out of the special forms on purpose to keep the compiler simple. for example, the only special form that accepts a variable number of expressions is do. its up to macros to wrap user code in do when appropriate. here's a clojure-style defn!
    oh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their API
    1. …in reply to @ra
      macros also allow for variable length expressions like + and *. they expand to nested calls to jn.core/add and jn.core/multiply which are regular jn functions that take exactly two arguments. the calls are inlined away in these examples.
      oh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their API
      1. …in reply to @ra
        finally, what i am most excited about, is that macros can selectively analyze parts of their inputs and have as much information as the compiler does to make expansion decisions - notable expression types. here doeach is generating different code for arrays and enumerables.
        oh my god twitter doesn’t include alt text from images in their APIoh my god twitter doesn’t include alt text from images in their API
        1. …in reply to @ra
          i meant "notably expression types" i am very excited