|
19 | 19 | [(:: x xs) |
20 | 20 | (pair x xs)] |
21 | 21 | [(nil) |
22 | | - (pair 0 (nil))])) |
| 22 | + (pair (the Integer 0) (nil))])) |
23 | 23 |
|
24 | 24 | (example (list-to-pair (list))) |
25 | 25 | -- => |
26 | 26 | -- (pair 0 (nil)) |
27 | 27 |
|
28 | | -(example (list-to-pair (list 1 2 3))) |
| 28 | +(example (list-to-pair (list (the Integer 1) 2 3))) |
29 | 29 | -- => |
30 | 30 | -- (pair 1 (list 2 3)) |
31 | 31 |
|
|
332 | 332 | -- => |
333 | 333 | -- (lambda (x xs) (:: x xs)) |
334 | 334 |
|
335 | | -(example (cons-lambda 1)) |
| 335 | +(example (cons-lambda (the Integer 1))) |
336 | 336 | -- => |
337 | 337 | -- (lambda (xs) (:: 1 xs)) |
338 | 338 |
|
339 | | -(example (cons-lambda 1 (list 2 3))) |
| 339 | +(example (cons-lambda (the Integer 1) (list 2 3))) |
340 | 340 | -- => |
341 | 341 | -- (list 1 2 3) |
342 | 342 |
|
|
381 | 381 | -- => |
382 | 382 | -- (lambda (x xs) (:: x xs)) |
383 | 383 |
|
384 | | -(example (cons 1)) |
| 384 | +(example (cons (the Integer 1))) |
385 | 385 | -- => |
386 | 386 | -- (lambda (xs) (:: 1 xs)) |
387 | 387 |
|
388 | | -(example (cons 1 (list 2 3))) |
| 388 | +(example (cons (the Integer 1) (list 2 3))) |
389 | 389 | -- => |
390 | 390 | -- (list 1 2 3) |
391 | 391 |
|
392 | 392 | (example |
393 | | - (case (list 1 2 3) |
| 393 | + (case (list (the Integer 1) 2 3) |
394 | 394 | [(cons x xs) |
395 | 395 | (pair x xs)])) |
396 | 396 | -- => |
397 | 397 | -- (pair 1 (list 2 3)) |
398 | 398 |
|
399 | 399 | -- All right, we can finally test eta-case and eta-case-aux! |
400 | 400 | (example |
401 | | - ((eta-case-aux (list 1 2 3) |
| 401 | + ((eta-case-aux (list (the Integer 1) 2 3) |
402 | 402 | (cons) |
403 | 403 | (pair) |
404 | | - [(nil) (pair 0 (nil))]) |
| 404 | + [(nil) (pair (the Integer 0) (nil))]) |
405 | 405 | (cons))) |
406 | 406 | -- => |
407 | 407 | -- (pair 1 (list 2 3)) |
408 | 408 |
|
409 | 409 | (defun eta-list-to-pair (xs0) |
410 | 410 | (eta-case xs0 |
411 | 411 | [(cons) (pair)] |
412 | | - [(nil) (pair 0 (nil))])) |
| 412 | + [(nil) (pair (the Integer 0) (nil))])) |
413 | 413 |
|
414 | 414 | (example (eta-list-to-pair (list))) |
415 | 415 | -- => |
416 | 416 | -- (pair 0 (nil)) |
417 | 417 |
|
418 | | -(example (eta-list-to-pair (list 1 2 3))) |
| 418 | +(example (eta-list-to-pair (list (the Integer 1) 2 3))) |
419 | 419 | -- => |
420 | 420 | -- (pair 1 (list 2 3)) |
0 commit comments