Конкатенация

This commit is contained in:
2022-05-12 19:07:59 +03:00
parent 0bc1280929
commit 9a0e65632e
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
(define (concat li1 li2)
(if (empty? li2)
li1
(concat (append li1 (list (car li2))) (cdr li2))
)
)
(writeln (concat (list 1 2 3) (list 3 4 5)))

View File

@@ -0,0 +1,8 @@
# Конкатенация
## Ссылка на видеоразбор
https://youtu.be/UCdiG5nTiFY
## Код из книги
#let rec append l1 l2 =
match l1 with
[] -> l2
| (h::t) -> h::(append t l2);;