So, I'm updating ghilfe to use GTK2, and I'm getting the following error:
Bad argument 1 to indices(). Expected string|array|mapping|multiset| object|program|function. Unknown program: indices(0) /usr/local/pike/7.6.66/lib/modules/Tools.pmod/Hilfe.pmod:1810: /home/riffraff/bin/at()->MyEvaluator()->parse_expression(Tools.Hilfe.Expre ssion(({ /* 4 elements */ "int", " ", "i", ";" }))) /usr/local/pike/7.6.66/lib/modules/Tools.pmod/Hilfe.pmod:1481: /home/riffraff/bin/at()->MyEvaluator()->add_buffer("int i;") at.pike:101: /home/riffraff/bin/at()->run(@0=GTK2.Entry,@0) _static_modules.Builtin()->Backend: Pike.Backend(0)->`()()
This is from the function run(), where it calls:
eval->add_buffer(what);
This is in parse_expression (as shown above), at the statement:
rel_parser(expr, (multiset)(indices(variables)) );
The problem is, variables is only initialized if you load a program first (with ghilfe). If you don't, variables is 0, an uninitialized mapping.
So, I think perhaps it might need to be modified to:
if (mappingp(variables)) rel_parser(expr, (multiset)(indices(variables)) );
Hilfe was more or less rewritten from scratch after ghilfe was made, so there might be some substantial differences. Do whatever you want to do to make it work with GTK2.
so ghilfe could be rewritten too to be based on the new hilfe. should not be that hard to do, you can feed the code to the hilfe instance one line at a time, so all you need to do is to recreate the gui, that handles input, history and output and what not, and then take the input, feed it to hilfe, get the output and display. done.
greetings, martin.
On Fri, 2006-01-27 at 16:43 +0100, Martin =?unknown-8bit?Q?B=E4hr?= wrote:
so ghilfe could be rewritten too to be based on the new hilfe. should not be that hard to do, you can feed the code to the hilfe instance one line at a time, so all you need to do is to recreate the gui, that handles input, history and output and what not, and then take the input, feed it to hilfe, get the output and display. done.
That's basically what I've done, but there seem to be some differences in the way hilfe works from before, so I have to look into the code and see what I have to do differently. I've got the entire ui done with GTK2 (and GTK2Support), I just have to do the interface to hilfe.
pike-devel@lists.lysator.liu.se