Skip to content

Commit

Permalink
Update lists concept (#689)
Browse files Browse the repository at this point in the history
* lists concept: Correct terminology

* update config

* add links for all functions

* correct terminology for the 'rest' function

* update links.json

* revert rest definition

* remove sequences link as it's no longer needed
  • Loading branch information
tasxatzial authored Jan 5, 2025
1 parent a5486a7 commit 240eccc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
9 changes: 8 additions & 1 deletion concepts/lists/.meta/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"blurb": "Lists are immutable, sequential collections representing function calls unless quoted.",
"authors": ["porkostomus", "bemself", "cstby"]
"authors": [
"porkostomus",
"bemself",
"cstby"
],
"contributors": [
"tasxatzial"
]
}
21 changes: 10 additions & 11 deletions concepts/lists/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
## Key Learnings

- Lists are collections.
- Lists can be created using `list` or by using a single quote.
- Lists can be created using [`list`][list] or by using a single quote.
- Clojure will try to evaluate lists, treating the first item as a function.
- Core functions:
- `cons` returns a list with the new item added to beginning.
- `first` returns the first item from a list.
- `rest` returns the list without the first item.
- `count` returns the number of items in the list.
- `conj` returns a list with items appended in it.
- [`first`][first] returns the first item in the list.
- [`rest`][rest] returns a list of all items of the list except the first.
- [`count`][count] returns the number of items in the list.
- [`conj`][conj] adds one or more items to the beginning of the list.

## Additional Resources

- [list - clojure.core | ClojureDocs](https://clojuredocs.org/clojure.core/list)
- [Data Structures](https://clojure.org/reference/data_structures)
- [Lists in Clojurescript](https://cljs.github.io/api/syntax/list)
[list]: https://clojuredocs.org/clojure.core/list
[first]: https://clojuredocs.org/clojure.core/first
[rest]: https://clojuredocs.org/clojure.core/rest
[count]: https://clojuredocs.org/clojure.core/count
[conj]: https://clojuredocs.org/clojure.core/conj
8 changes: 0 additions & 8 deletions concepts/lists/links.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
[
{
"url": "https://clojuredocs.org/clojure.core/list",
"description": "list - clojure.core | ClojureDocs"
},
{
"url": "https://clojure.org/reference/data_structures",
"description": "Data Structures"
},
{
"url": "https://cljs.github.io/api/syntax/list",
"description": "Lists in Clojurescript"
}
]

0 comments on commit 240eccc

Please sign in to comment.