Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted non-comment result indicators to comments #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions structured-data.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ Write the function `(cutify v)` that takes a vector as a parameter and adds
`"<3"` to its end.

~~~{.clojure}
(cutify []) => ["<3"]
(cutify [1 2 3]) => [1 2 3 "<3"]
(cutify ["a" "b"]) => ["a" "b" "<3"]
(cutify []) ;=> ["<3"]
(cutify [1 2 3]) ;=> [1 2 3 "<3"]
(cutify ["a" "b"]) ;=> ["a" "b" "<3"]
~~~

<!-- "> -->
Expand Down Expand Up @@ -282,13 +282,13 @@ Write the functions `(height rectangle)` and `(width rectangle)` that return
the height and width of the given rectangle. Use destructuring.

~~~{.clojure}
(height (rectangle [1 1] [5 1])) => 0
(height (rectangle [1 1] [5 5])) => 4
(height (rectangle [0 0] [2 3])) => 3
(height (rectangle [1 1] [5 1])) ;=> 0
(height (rectangle [1 1] [5 5])) ;=> 4
(height (rectangle [0 0] [2 3])) ;=> 3

(width (rectangle [1 1] [5 1])) => 4
(width (rectangle [1 1] [1 1])) => 0
(width (rectangle [3 1] [10 4])) => 7
(width (rectangle [1 1] [5 1])) ;=> 4
(width (rectangle [1 1] [1 1])) ;=> 0
(width (rectangle [3 1] [10 4])) ;=> 7
~~~
</exercise>

Expand All @@ -310,10 +310,10 @@ Write the function `(area rectangle)` that returns the area of the given
rectangle.

~~~{.clojure}
(area (rectangle [1 1] [5 1])) => 0
(area (rectangle [0 0] [1 1])) => 1
(area (rectangle [0 0] [4 3])) => 12
(area (rectangle [3 1] [10 4])) => 21
(area (rectangle [1 1] [5 1])) ;=> 0
(area (rectangle [0 0] [1 1])) ;=> 1
(area (rectangle [0 0] [4 3])) ;=> 12
(area (rectangle [3 1] [10 4])) ;=> 21
~~~
</exercise>

Expand Down Expand Up @@ -413,8 +413,8 @@ the collection and returns the value associated with it.

~~~{.clojure}
(count [1 2 3]) ;=> 3
(count {:name "China Miéville", :birth-year 1972}) => 2
(count ":)") => 2
(count {:name "China Miéville", :birth-year 1972}) ;=> 2
(count ":)") ;=> 2
~~~

As we can see, `count` tells the amount of keys for a map and the
Expand Down Expand Up @@ -819,7 +819,7 @@ And here's another with `concat`:
More generally, `apply` works like this:

~~~{.clojure}
(apply function [arg1 arg2 arg3 ...]) => (function arg1 arg2 arg3 ...)
(apply function [arg1 arg2 arg3 ...]) ;=> (function arg1 arg2 arg3 ...)
~~~

<exercise>
Expand Down