Then, we define L as a list contains one list as an entire list expression:
(list 1 2 (list 3 4) 5)
so the first element of the list (first L) should be 1.
The model for a list is the element, and element is independent whether the element is a list or a number. For example, if there is a list looks like: (list 1 2 (list 3 4) 5), then the third element of this list is (list 3 4), and this inner list is considered as a single element of the whole list. Also, (list 3 4) could also be defined as L1 and represented in the list using L1 instead of (list 3 4), and people will know that L1 refers to this list.
Professor uses box as an example for us to think back to real life.
This is very interesting!
==============================================
On Friday, I asked the TA about the filter that we had for the quiz.
I was confused about the alphabetical order definition:
; word-L is a list of words
(define word-L
(list "how" "now" "brown" "cow"))
; less than gnu?: string->boolean
; Is w less than "gnu" in alphabetical order?
; (check-expect (less-than-gnu? "aardvark") true)
(define (less-than-gnu? w) (string<? w "gnu"))
The TA explains to me that, when you have the filter function, then you apply the first character to "gnu", and when you find it is in front of "g", then it is filtered. If is not, then goes to the next character which is n. So if filter "less-than-gnu", it would comes out: brown and cow.