Hello Matthias, It was a short Python hacking, it turned out that I did not like it myself too :-)
#py simply triggers the eval code in the patched amforth-shell.py. Yes, the code sent to the device is being modified by the shell according to the python expression that is embedded in the frt code. This brings me to a more fundamental question which you, as Amforth's BDFL, I feel, need to address. Amforth-shell.py turns the use of frt "&34 constant PORTA" definitions in the code unnecessary as the shell script does these substitutions for you (and saves flash memory). It is great for educational purposes but it creates dependence on loading of the code through amforth-shell.py only. I think Forth tradition is against that, it was supposed to be self contained and operated through a simple terminal... What is your recommended practice? Thanks, Enoch. On 10/11/2012 12:49 PM, Matthias Trute wrote: > Enoch, > >> Please find attached a patch to Keith's shell script for your >> consideration. I took the lazy approach of using Python's eval() option >> and it was quite easy: > > I've difficulties to understand you approach. Do you change > the forth code, that gets sent to the controller with the > conditionals? The #py directive has what purpose? I'm puzzled... > > Where do you store the mappings? Looks like you're using > the script itself. IMHO not the best place to keep the data.. > > You introduce a return code in addition to the exception, why? > Keith makes an intelligent use of exceptions in his code, I'd > keep that design whenever possible. > > Matthias > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev _______________________________________________ Amforth-devel mailing list for http://amforth.sf.net/ Amforth-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amforth-devel