Comments (3)
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.
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.
Closing this because the exercise was deprecated (see #584). This exercise will confuse students no more :)
from clojure.
Related Issues (20)
- User is not told what the error is when a runtime error occurs HOT 1
- Rotational Cipher Tests differ from description HOT 2
- Broken URL in strings concept
- Elyses Destructured Enchantments: Tests mix up Expected and Actual results HOT 1
- Complex Numbers: Tests mix up Expected and Actual results, and unclear about requiring floats rather than rationals HOT 1
- Implement new learning exercise: Protocols
- Bank Account problem under wrong concept? HOT 2
- Implement new learning exercise: Atoms HOT 1
- Difficult to reproduce tests locally HOT 2
- test HOT 1
- New concept: deriving new functions from existing functions (partial, comp, memoize) HOT 8
- Building a training set of tags for clojure HOT 21
- The specification of 'memoize-transform' in the coordinate-transformation exercise can be made more precise HOT 1
- Leap 48in24 approaches HOT 1
- Reverse-string 48in24 approaches HOT 3
- Exercises to port HOT 4
- Approaches for raindrops HOT 1
- Error in test for Card Games exercise, 6. More averaging techniques HOT 1
- No function found on command line or in :exec-fn during test execution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clojure.