Git Product home page Git Product logo

Comments (4)

bhb avatar bhb commented on August 24, 2024

@jefffriesen It's a good idea! I do think examples would be really useful in this context, especially for beginners who may have less familiarity with the spec syntax.

This isn't well documented in Expound currently (hmm, maybe I need to use Dynadoc to document the API 😄 ), but it's possible to modify the default Expound printer, so any user could add extra info like the defexample to the output.

Unfortunately, right now the information that spec returns does not include the symbol of the function that was called, so there is no way to look up the example (which requires knowing the namespace and function name). The issue tracking this is https://dev.clojure.org/jira/browse/CLJ-2166 (please log in and vote for it! 😄 )

Once that fix makes it into Clojure spec, I will write up some example code of how to include examples defined via defexample. At some point in the future, I may include this by default, or at least as an option in Expound. I'm hesitant to add dependencies until it's clear that most users would like the functionality built in. Let's leave this issue open for now and see if it attracts upvotes 😄 .

from expound.

jefffriesen avatar jefffriesen commented on August 24, 2024

Sounds like a great plan.
(I've voted for that Jira issue 😄)

from expound.

marco-m avatar marco-m commented on August 24, 2024

FYI https://dev.clojure.org/jira/browse/CLJ-2166 has been resolved on 2018-06-26 and is available in clojure.spec release 0.2.168

from expound.

bhb avatar bhb commented on August 24, 2024

Thanks again for the idea! Since I haven't seen a wide adoption of examples, I'm going to close this for now. If examples turn up in say, cljdoc and more people use them, I'd reconsider, but for now, I'm not inclined to add an additional dependency on expound.

from expound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.