bakpakin / Fennel

Lua Lisp Language
https://fennel-lang.org
MIT License
2.43k stars 124 forks source link

Adding hashfn missing example #419

Closed gbaptista closed 2 years ago

gbaptista commented 2 years ago

While upgrading my syntax highlighting package, I missed this example of possible hashfn literal in the reference:

#{:a $1 :b $2 :c $3}

(local fennel (require :fennel))

(-> [2 4 6]
  (table.unpack)
  (#{:a $1 :b $2 :c $3})
  (fennel.view)
  (print)) ; => {:a 2 :b 4 :c 6}
technomancy commented 2 years ago

Thanks! I merged this in fcfcb8d but it looks like Github doesn't realize it's the exact same patch.