In Clojure, it's possible to read a whole s-expression with (read). Is there some way to read just one token at a time? So calling (read-token "(read)") would return something like ["(", "read", ")"].
"tokens" are not something that the clojure reader works with: it doesn't have distinct lex/parse phases like languages with more complicated grammars often do. Of course you can write your own grammar for clojure forms, call ( an OPEN_PAREN token and so on, but there's no built-in support for it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With