logoalt Hacker News

ectotoday at 9:40 PM1 replyview on HN

loon is a lisp! https://github.com/ecto/loon

  [type Shape
    [Circle Float]
    [Rect Float Float]]
  
  [fn area [s]
    [match s
      [Circle r]  => [* 3.14 r r]
      [Rect w h]  => [* w h]]]
  
  [area [Circle 5.0]]

Replies

grimgrintoday at 9:48 PM

idk how I haven't crossed a lisp with square brackets but dang I am sorta stunned at how I've never even envisioned it? thanks

show 1 reply