Re: sorted?
Jeremy Korwin-Zmijowski <[email protected]>
| Newsgroups | gmane.lisp.guile.user |
|---|---|
| Message-ID | <[email protected]> |
>> No problem---I'm too. >> >> Think about it this way: >> >> How would you sort this list of numbers: 7 1 3 8 2 1 4 ? >> >> It's 1 1 2 3 4 7 8, right? That is what we want (sort '(7 1 3 8 2 1 4)) to >> output (+ the parentheses of course). >> >> Now, `sorted?' returns true if its input is what `sort' would have >> produced as output, otherwise false. >> >> Don't confused by the "less" that you pass in as second argument to > `sort'. That is something you are *required* to pass to sort for it to > function as expected. It is something that `sort' uses. This explanation does make sense to me and so made me realized I was not using `sorted?` as it is intended to. I will think about another strategy. Thank you all for your time and words. Jérémy