Giter Club home page Giter Club logo

Comments (5)

verdammelt avatar verdammelt commented on June 23, 2024

That sounds like an interesting implementation and I'd love to see it. (It does sound like it might go against my "don't be clever in example.lisp" pseudo-rule though...)

If setting *print-circle* to nil fixes it then do it in xlisp-test - perhaps under a feature test for ECL.

from common-lisp.

wobh avatar wobh commented on June 23, 2024

Let me know if you think it's too clever.

wobh@1982134

I also added a bunch of tests.

from common-lisp.

wobh avatar wobh commented on June 23, 2024

It's definitely ECL's load with the :print option and setting *print-circle* to t makes it work as expected. Reviewing the spec for *print-circle* http://l1sp.org/cl/*print-circle* it seems like it would be fine to set it to t generally, and perhaps even a good idea.

from common-lisp.

wobh avatar wobh commented on June 23, 2024

A passing build: https://travis-ci.org/wobh/xlisp/jobs/83063702

I have two ideas here based on the same foundation.

First add some constants to label the verbosity levels. This takes care of an irksome remainder I decided not to do initially for some reason, but also makes distinguishing the two solutions a easier.

Solution 1. Set *print-circle* to t in the lexical scope of load-package. This is a minimal typing solution and the passing build above is the prime-factors exercise rebased onto that branch. At the bottom you can see the circular list printed correctly. The rationale here is that whatever the load outputs, it should be safe, so just set it to t and be done.

Solution 2. Set *print-circle* to the outcome of (verbosity-p +debug+) in the lexical scope of load-package and set the load :print argument to the same. This is a minimal effect solution, observing that the extra output of load with :print is not strictly desirable for general testing, and *print-circle* doesn't need to be any value not required.

I prefer solution 1 for the time being, but I think considering what solution 2 does for us is worth thinking about more generally. If/when we find another place to set *print-circle* to t or have to set it's dynamic value in test-exercises we can do so by verbosity level required with verbosity-p.

from common-lisp.

verdammelt avatar verdammelt commented on June 23, 2024

I agree - it looks like setting *print-circle* to t is a good idea. It is a good thing for a testing harness to do - given that there may be circular data - we'd want the harness to be able to handle and report on that without it having its own problems.

I go with solution 1. If we tied it to verbosity then we should consider the other *print-x* settings which might also be needed/useful. But I think the simpler approach is better for now.

from common-lisp.

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.