Talk:Interactive programming (repl): Difference between revisions

Line 66:
::"Command line interpreters do not create functions, they interpret and execute commands"
:In Python, a language with a CLI, when in its CLI, the creation of a function is a command that is immediately executed. The action of the interpretation of the text typed in that happens to represent a function definition is to create a function 'internally'. You seem to think that a CLI's task is restricted to executing expressions with an immediate visual output, or are you merely pointing out that the notion of a CLI is not as clear cut in Basic and forth as you use the same included editor as a CLI but in different ways when not needing longer-term storage of a program? if the latter then in Basic, if you have to add line numbers at the command line to store any function to memory then I would just go ahead and show typing in of the line numbers in the function definition, and presumably leaving off the line numbers when you want the immediate effect of calling the function with arguments so that it prints a result. You could do something similar for Forth I guess. --[[User:Paddy3118|Paddy3118]] 14:03, 13 April 2009 (UTC)
 
::I did not say that execution would require visual output. Where did you get that idea? The keyword here is ''execute'', whether it is some calculation or controlling a device or whatever. It seems that you do not understand the difference between '''executing''' code and '''editing''' a program. You seem to think that defining a function executes something. It does not. Defining a function means that you add the function code into the program. That is editing. Even if it is done with a line editor. And even if some pre-compilation is done. (The line editors of most Basic interpreters actually pre-compile each line that is inserted into the program.) --[[User:PauliKL|PauliKL]] 15:46, 15 April 2009 (UTC)
Anonymous user