functional-koans / functional-koans/clojure-koans
confusion regarding "you can use a list as a stack to get the first element" koan.
Open
- Dominant language
- Clojure
- Stars
- 3.8k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
I have a question regarding the following koan:
"You can use a list like a stack to get the first element"
(= :a (peek '(:a :b :c :d :e)))
I believe this should be a queue instead of a stack, since a stack is last in first out. Since '(:a :b :c :d :e) the last element is :e this should be returned. A queue is first in first out so we pop the first element put in which would be :a. Please correct me if i'm wrong.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.