Skip to content

Comment on Lisp moving Forth moving Lisp

Comments

I'm not fluent enough in Common Lisp for that book, but the patterns in Let over Lambda translate cleanly to Julia. You can have "Let over Lambda", "Let over Lambda over Let over Lambda", "Anaphoric Macros" (though you have to break hygiene with esc(), and in practice should just use the native julia do block), "Reader Macros" (via String Macros), "Pandoric Macros", and so on.

the patterns in Let over Lambda translate cleanly to Julia

I would be curious to see such a translation.

Take for instance Pandoric Macros that allow you to peek inside the hidden state of a closure:

  # Traditional Let over Lambda
  counter = let x = 100
    () -> x += 1
  end
  counter() # 101
  
  # Pandoric Macro
  captured_x_ref = Core.getfield(counter, :x)
  println("The hidden state is: ", captured_x_ref.contents) # Outputs: 101
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.