candid82 / joker

Small Clojure interpreter, linter and formatter.
https://joker-lang.org/
Eclipse Public License 1.0
1.64k stars 67 forks source link

Invalid use of / in symbol name #483

Closed txgruppi closed 2 years ago

txgruppi commented 2 years ago

Sorry if this is not an issue, I'm new to lisp.

I have this source code:

(var t 0)
(var x 96)
(var y 24)

(fn _G.TIC []
  (when (btn 0) (set y (- y 1)))
  (when (btn 1) (set y (+ y 1)))
  (when (btn 2) (set x (- x 1)))
  (when (btn 3) (set x (+ x 1)))
  (cls 0)
  (spr (+ 1 (* (// (% t 60) 30) 2))
       x y 14 3 0 0 2 2)
  (print "HELLO WORLD!" 84 84)
  (set t (+ t 1)))

and when I run joker --format colorsort.fnl I get the following error:

colorsort.fnl:11:19: Read error: Invalid use of / in symbol name

Can't // be allowed as a symbol name?

candid82 commented 2 years ago

This doesn't look like Clojure code. Is this some other Lisp-like language? Joker doesn't format any Lisp code, only Clojure specifically. You may want to find a formatter for this language specifically. You can also try https://github.com/candid82/cljf, which is also a Clojure formatter but with more permissive reader that may work for your language.

txgruppi commented 2 years ago

Thank you!