Reasoning: I'm trying to convert a large library from Scheme to Python
Are there any good strategies for such a conversion? In particular, the cross-paradigm in this case, since Python is larger than OO, and the circuit is functional.
Totally subjective, so I make it a community wiki
( , , , ). .
, , - .
. , , , python.
, , :
def test_f(): assert_equal(library.f(42), reference_implementation('(f 42)'))
, , , , .
, , , , ...
. Python. , @PaulHankin, Python
, , , .
Python , , , , . , , .
Write a Python interpreter in Scheme and directly translate your program to this :-) You can start with def:
def
(define-syntax def (syntax-rules () ((def func-name rest ...) (define func-name (lambda rest ...))))) ;; test (def sqr (x) (* x x)) (sqr 2) => 4