Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clojure.pprint is missing code-dispatch #1446

Closed
ghost opened this issue Dec 9, 2022 · 3 comments
Closed

clojure.pprint is missing code-dispatch #1446

ghost opened this issue Dec 9, 2022 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 9, 2022

[ To keep development of this project going, consider sponsoring. If you are
already a sponsor, thank you! ]

version: 1.0.168

[ Please specify which version of babashka you're using. You can find this with babashka --version. The documentation on the master branch may be ahead of the most released version. ]

platform: MacOS 12.6.1 on an M1 Mac.

[ Please specify which platform you are using babashka on, so you can test a
new binary when the issue is resolved. ]

problem: it’s missing

[ Please provide a short and to the point description of the problem ]

repro:

➜ bb
Babashka v1.0.168 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (require '[clojure.pprint :as pp])
nil
user=> pp/code-dispatch
Could not resolve symbol: pp/code-dispatch [at <repl>:5:-16]

[ Please provide a minimal working reproduction of the problem ]

expected behavior: I expected the namespace to include the var with its value being the function from the Clojure stdlib.

[ What is the behavior you expected to see? Please provide a minimal working example ]

➜  clj
Clojure 1.11.1
user=> (require '[clojure.pprint :as pp])
nil
user=>  pp/code-dispatch
#object[clojure.lang.MultiFn 0x3153ddfc "clojure.lang.MultiFn@3153ddfc"]
@borkdude
Copy link
Collaborator

borkdude commented Dec 9, 2022

Will add. Can you give some examples of how you'd use this?

@ghost
Copy link
Author

ghost commented Dec 9, 2022

Thanks!

Example:

  (pp/with-pprint-dispatch pp/code-dispatch
    (binding [pp/*print-right-margin* 80]
       (pp/pprint generated-code-or-parsed-edn-etc))))

@borkdude
Copy link
Collaborator

borkdude commented Dec 9, 2022

@aviflat You can install the latest dev-build with:

bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir /tmp

This install the bb binary in /tmp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant