because that's actually what we want here: we want to *reference* other immutable lists in our own, so that we don't have to create them twice. in the previous attempts, any "list construction" using other lists would move that list, which isn't what we want. we also need references both in the data structure *and* the functions using them, to be able to apply those functions and still be able to use the arguments we used afterwards. also, the lifetime annotations are quite tricky. now, should we *still* use boxes inside the references? if references are really allocated on the stack, then we probably should. but i think if we let users box the list heads themselves, it's better, because we don't want to dictate where to allocate things.
|
||
| 114 | 114 |
|
| 115 | 115 |
|
| 116 | 116 |
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 125 |
|
|
| 126 |
|
|
| 127 |
|
|
| 128 |
|
|
| 129 |
|
|
| 130 |
|
|
| 131 |
|
|
| 132 |
|
|
| 133 |
|
|
| 134 |
|
|
| 135 |
|
|
| 136 |
|
|
| 137 |
|
|
| 138 |
|
|
| 139 |
|
|
| 117 | 140 |
|
| 118 | 141 |
|
| 119 | 142 |
|
| 120 | 143 |
|
| 121 | 144 |
|
| 145 |
|
|
| 122 | 146 |
|