GithubHelp home page GithubHelp logo

Tracks on Tracks on Tracks: Incorrect implementation of task 4 passes test for task 4, but fails test for task 6 about clojure HOT 3 CLOSED

angelikatyborska avatar angelikatyborska commented on May 25, 2024
Tracks on Tracks on Tracks: Incorrect implementation of task 4 passes test for task 4, but fails test for task 6

from clojure.

Comments (3)

bobbicodes avatar bobbicodes commented on May 25, 2024

I'm actually in the process of rewriting this exercise because there are several problems with it. It was the first concept exercise anyone made and we didn't know what we were doing yet.

I'm actually confused why it didn't work with pop. In fact, folks use it all the time for that function as it differs from rest only in its handling of the empty list.

The exercise is also out of place, because there's an elegant way to do the composition in the final task (threading macros), but it hasn't been taught yet. Since there's a better exercise for teaching lists (Card Games, I think?), so I think I'm going to port that one, and rework this exercise to teach function composition, which is what task 6 is really asking for.

from clojure.

tasxatzial avatar tasxatzial commented on May 25, 2024

pop isn't incorrect here. add-language takes an argument of type PersistentList (the initial empty list) and returns a Cons object. pop works by employing a cast of its argument to IPersistentStack but a Cons object isn't a subclass of that interface so it throws an error. In other words pop and cons don't mix.

Changing cons to conj, should fix the error.

from clojure.

bobbicodes avatar bobbicodes commented on May 25, 2024

Closing this because the exercise was deprecated (see #584). This exercise will confuse students no more :)

from clojure.

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.