Clojure-Intro-Course / babel

MIT License
2 stars 0 forks source link

Figure out a way to print a function arg for case #16

Open elenam opened 4 years ago

elenam commented 4 years ago

The message for case is a run-time regular message and is passed as a string. Current handling:

babel.middleware=> (case map)
Execution error (IllegalArgumentException) at sun.reflect.NativeConstructorAccessorImpl/newInstance0 (REPL:-2).
The 'case' input clojure.spec.test.alpha$spec_checking_fn$fn__3026@42056813 didn't match any of the options.

The difficulty is that we don't know if the argument is a function, so we'd need to figure out a way to resolve it. It may also be a string with spaces:

babel.middleware=> (case "Hi there")
Execution error (IllegalArgumentException) at sun.reflect.NativeConstructorAccessorImpl/newInstance0 (REPL:-2).
The 'case' input Hi there didn't match any of the options.
stanislowskij commented 3 weeks ago

This commit was transferred from the legacy repository as part of our Fall 2024 housekeeping effort. The issue has been removed from the legacy repository.