~xerool

Trackers

~xerool/fennel-ls

Last active a month ago

#251 (case) pattern matching edge case 5 days ago

macros added by ~xerool on ~technomancy/fennel

#242 fnlfmt - Support additional body forms and macros 5 days ago

bug added by ~xerool on ~technomancy/fennel

#242 fnlfmt - Support additional body forms and macros 5 days ago

fnlfmt added by ~xerool on ~technomancy/fennel

#245 fnlfmt doesn't allow comments between let bindings 5 days ago

bug added by ~xerool on ~technomancy/fennel

#245 fnlfmt doesn't allow comments between let bindings 5 days ago

fnlfmt added by ~xerool on ~technomancy/fennel

#251 (case) pattern matching edge case 5 days ago

bug added by ~xerool on ~technomancy/fennel

#250 searcher: don't check module-name as-is before converting `.` to path separator 5 days ago

bug added by ~xerool on ~technomancy/fennel

#251 (case) pattern matching edge case 6 days ago

Ticket created by ~xerool on ~technomancy/fennel

The pattern (where (or [x &as y] [x &as y])) should compile. Even though the symbol &as appears in both the patterns, symbols-in-pattern should probably ignore it, like it does to or and nil symbols.

We also have the dual issue. If a symbol in (or) doesn't appear in all the patterns, case will never try to bind it, so invalid symbols can be present. Eg, the pattern (where (or &invalid&symbol& or 1)) pattern should not compile.

;; should compile but doesn't
(case [1]
  ;; &as is used in every subpattern: does not compile
  (where (or [x &as y] [x &as y])) y)
;; shouldn't compile, but does
(case 1
  ;; (or) sees that `&invalid&symbol&` isn't in all the patterns and never binds it
  (where (or &invalid&symbol& or 1)) 1)

#249 macro hygiene: generated symbols can be referenced 22 days ago

bug added by ~xerool on ~technomancy/fennel

#249 macro hygiene: generated symbols can be referenced 22 days ago

Ticket created by ~xerool on ~technomancy/fennel

Imagine I have this macro that injects a symbol into its environment.

(macro inject [] `(local foo# 10))
(inject)

;;prints 10, but *should* be `unknown identifier: foo_2_auto` or print `nil`
(print foo_2_auto)

I'm not an expert on macro hygenics, but in my mental model, I would expect foo# to be in scope, but be unnameable and inaccessible. Unexpectedly, if you can predict the generated name, (in this case foo_2_auto) you can gain access to the local.