top | item 47094367

(no title)

ecto | 9 days ago

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]]

discuss

order

grimgrin|9 days ago

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

shawn_w|9 days ago

There's a few lispy languages that support using square brackets as an alternative to parens. Racket even has curly braces too.

The above really reminds me of tcl, though, which uses square brackets to force evaluation of the command they wrap.