Interactive programming (repl): Difference between revisions

(→‎{{header|Quackery}}: add task requirement)
Line 1,148:
 
=={{header|Phix}}==
The repl has been significantly improved for version 0.8.4+ so it is now usable, although not thoroughly tested or widely used yet.
{{todo|Phix|Loads of stuff!}}
There is a barely adequate repl: Phix compiles/optimises things (even when "interpreting"), such as omitting
unused routines/code and unnecessary tests (usually via type inference), and generally assumes it can mangle
the symtab as part of generating executable machine code. It does not, therefore, fare very well (as yet) if
and when it is asked to compile "a few more lines" of code. Theoretically, however, it is just a relatively
simple matter of figuring out precisely what to save/restore and at exactly which points, and avoiding some
of the optimisations (/type inferences) when in repl mode.
 
<pre>
C:\Program Files (x86)\Phix>p -repl
Line 1,161 ⟶ 1,154:
Enter a statement such as "?remainder(floor(250/8),8)" or "puts(1,"Hi")"
 
>function f(string a,b,c) return a&c&c&b end function ?f("Rosetta","Code",":")
"Rosetta::Code"
Warning: the repl is brand new, experimental, incomplete, and liable to crash!
Enter a statement such as "?remainder(floor(250/8),8)" or "puts(1,"Hi")"
 
>?f("Rosetta","Code",":")
"Rosetta::Code"
 
>quit
?f("Rosetta","Code",":")
C:\Program Files (x86)\Phix>
^ undefined identifier f
 
Press Enter, or d for diagnostics...
</pre>
As you can see, it all-too-quickly "forgots" f, or rather does not save/restore the right things.<br>
Each time I come back to this, I usually make significant (but still small) headway, before getting stuck(/bored) yet again.
 
=={{header|PicoLisp}}==
7,813

edits