; PRINT_FUNC - print function in range [-1; 1] with step 0.1
(define print_func (lambda (f)
(letrec
; list of lets
((print_line (lambda (x y) (begin (display x) (display " : ") (display y) (newline))))
(scan (lambda (x)
(if (>= x 1.0) #t
(begin (print_line x (f x)) (scan (+ x 0.1)))))))
; using of these lets
(scan -1.0))))
; OSCILLATOR
(define oscillator (lambda (x) (if (= x 0) 1 (/ (sin x) x) )))
; Using it
(display "Oscillator for [-1; 1]")
(print_func oscillator)
Под guile вроде работает, а umb-scheme - падает... Хочется понять -
почему...
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Форум Emacs, добавление заголовка к ссылке в org-mode (2) (2024)
- Форум Выясняем с помощью Emacs, какой ЯП лучше (2024)
- Форум Dependently-Typed Metaprogramming (2013)
- Форум Systemd «скролинг» (2022)
- Форум [scheme][haskell][oop][fp] Мысли вслух (2012)
- Форум Начал изучать openGL (2009)
- Форум picom прозрачность шрифта, как убрать? (2021)
- Форум picom i3 и лаги (2023)
- Форум slime Coonection part (2023)
- Форум Забавный развод на kickstarer (2019)