Aktuelle Änderungen Printable View Änderungen Bearbeiten
PythonHacking > PythonIDE > PythonIDEs > PythonIdioms > PythonImageLibrary > PythonInTheEnterprise > PythonServerPages > PythonToJavascript > PythonUnicode > PythonWin > PythonWindowsProgramming > QuaSar > QuotesFromUnmaintainableCode > RDBMS > RelationalDatabaseManagementSystem > REPL > ReadEvalPrintClear Trail(loop (print (eval (read))))
A read-eval-print loop (REPL) is a simple, interactive computer programming environment. The term is most usually used to refer to a Lisp interactive environment, but can be applied to the similar environments for Python, BASIC, or other languages as well.
The REPL is commonly misnamed an interpreter. This is an erroneous usage, since many programming languages that use compilation (including bytecode compilation) have REPLs, such as Common Lisp and Python.
Enter a dynamic language. Enter its REPL. When you have a, say, Lisp interpreter at your disposal you don’t write your code first and load it later (that’s what i was doing at first). You enter your code piecewise, function by function, variable by variable at that innocent looking prompt. You develop incrementally, and, at every single moment, your objects and functions are alive: you can access them, inspect them, modify them. Your code becomes an organic creature, plastic. Its almost not programming, but experimenting.
While exec executes a command, eval evaluates an expression and returns its value. [...]generally you will use eval strictly for the expression's return value. [1]
2f) debugging and testing with the read-eval-print-loop (REPL). Like the gdb prompt for evaluating code, but you can use the native language and you have the full language. Or better like a shell where thing's aren't echoed in ASCII and need to be re-parsed, but you get the real objects you can play with (send message as defined in your system). The debuggers in Allegro and CMUCL are rather crappy, IMHO, but the REPL and ultra-fast re-compilation and loading of single functions (standard feature of every Lisp) -used for debugging print statements- make more than up for that.[2]