5 ms·
a List is a generalization of a Pair - it could be empty, while a Pair cannot (logically). Apart from that, a Non-empty List could be viewed as a self-referenti
by dschiptsov 13y ago
a List is a generalization of a Pair - it could be empty, while a Pair cannot (logically). Apart from that, a Non-empty List could be viewed as a self-referential (recursive) Pair or a chain of Pairs. So, technically, List is the same ADT as Pair (cond/car/cdr) plus explicit null? and list? functions.
Yes, they could, but it is more reasonable to split the code, so you could dlload or statically link the pure code independently from unsafe code.
- Peaker 13y agoA list is not a "generalization" of a pair. If anything that used something else was a "generalization" of that other thing, things would get confusing. Why is it more reasonable to split the code? You get the safety from the type-system, so you don't need extra splitting in obj files. Such splitting would complicate matters, and have no extra gain.
- dschiptsov 13y agoA list is not a "generalization" of a pair. - a lot of good people think otherwise: http://www.youtube.com/watch?v=QV0A_hFPCnw http://www.youtube.com/watch?v=QV0A_hFPCnw
- Peaker 13y agoAgain, please mention a specific quote and time... Or do you expect me to invest 50 minutes finding that quote in there?