More interactive environments are easier to learn, but the text based ones I have seen lately don't let you change your mind.
I have used Read–Eval–Print Loop (REPL) environments. However these are not suitable, as it is not possible to edit or view code that one wrote earlier.
In [1]: a=5
In [2]: b=a/3
In [3]: b
Out[3]: 1.6666666666666667
In [4]:
they are of some value. However it becomes less useful when creating something big, when creating routines.
I want to be able to create sub-routines interactively, and then be able to inspect them, and edit them. It also needs to be easy enough for teaching beginners.
In [4]: def double(a):
...: return 3*a
...:
In [5]: show double
def double(a):
return 3*a
In [7]: show --all
def double(a):
return 3*a
def oneMoreThan(a):
return a+1
I am not too worried about language. I am just looking for a nice interactive learning environment, that combines the best of REPL and editing. Can you tell me of anything that you use or know of?
I will add an answer that shows what I have found, but it is not an acceptable answer as I don't think it is easy enough.
listings/1
orlistings/0
predicates. You can also modify them usingassert
/retract
(more info here: learnprolognow.org/… ). I'm using Prolog (SWI) from Emacs, but there must be other editors, perhaps less scary to beginners. SWI also hasqsave_program/2
to save program image, but I don't think it's ISO Prolog. Lisps typically offer the same, but some source code entered interactively may be actually lost. $\endgroup$