Skip to content

Commit

Permalink
Equality concept write-up was wrong about equal and arrays
Browse files Browse the repository at this point in the history
Arrays are only equal if the arrays are eq. (Except for
strings which are already mentioned; and vectors which will need their
own concept)

Fixes #696
  • Loading branch information
verdammelt committed Nov 22, 2023
1 parent b49abd6 commit 1162ab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions concepts/equality/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ A quick set of definitions (leaving out a few details) are as follows:
(eql #\a #\A) ; => NIL
```

- `equal`: defines equality as meaning: two lists are `equal` if each element is also `equal`; two arrays are `equal` if each element is `eq`; two strings are `equal` if each element is `eql`; everything else is `equal` if they are `eql`.
- `equal`: defines equality as meaning: two lists are `equal` if each element is also `equal`; two strings are `equal` if each element is `eql`; two arrays are `equal` if they are `eq`; everything else is `equal` if they are `eql`.
_e.g._:

```lisp
(equal (list 1 2) (list 1 2)) ; => T
(equal #(1 2) #(1 2)) ; => T
(equal #(1 2) #(1 2)) ; => NIL
(equal "foo" "foo") ; => T
```

Expand Down
4 changes: 2 additions & 2 deletions exercises/concept/key-comparison/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ A quick set of definitions (leaving out a few details) are as follows:
(eql #\a #\A) ; => NIL
```

- `equal`: defines equality as meaning: two lists are `equal` if each element is also `equal`; two arrays are `equal` if each element is `eq`; two strings are `equal` if each element is `eql`; everything else is `equal` if they are `eql`.
- `equal`: defines equality as meaning: two lists are `equal` if each element is also `equal`; two strings are `equal` if each element is `eql`; two arrays are `equal` if they are `eq`; everything else is `equal` if they are `eql`.
_e.g._:

```lisp
(equal (list 1 2) (list 1 2)) ; => T
(equal #(1 2) #(1 2)) ; => T
(equal #(1 2) #(1 2)) ; => NIL
(equal "foo" "foo") ; => T
```

Expand Down

0 comments on commit 1162ab2

Please sign in to comment.