jed-users mailing list

[2013 Date Index] [2013 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [Jed-users-l] slang function debugging?


Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:
> This eliminates the error
>
> Unable to typecast Integer_Type to String_Type
>
> but I do not understand why it has occured?

Does the *traceback* buffer give a hint?

> Ok, there is a value on the stack left, but why does ot harm?

  Consider this:

     define make_world ()
     {
        system ("echo make_world called");
	return "bar";
     }

     define concat_strings (a, b)
     {
        return a + b;
     }

     concat_strings ("hello", make_world ());

>>    require ("process");
>>    define make_backup_filename (dir, file)
>>    {
>>       variable f = path_concat (dir, file);
>>       () = new_process(["vv", "-s", f]; stdout="/dev/null").wait();
>>       return "";
>>    }
>
> I get an error:
[...]
> pipe cannot be re-defined
> /sw/ubuntu-10.04/jed-0.99-19/jed/lib/defaults.sl:779:<top-level>:Duplicate Definition
> Traceback: evalfile
> /sw/ubuntu-10.04/jed-0.99-19/jed/lib/site.sl:3304:<top-level>:Duplicate Definition

In that case, process will need to be loaded into a separate namespace:

    require ("process", "process");
    define make_backup_filename (dir, file)
    {
       variable f = path_concat (dir, file);
       () = process->new_process(["vv", "-s", f]; stdout="/dev/null").wait();
       return "";
    }

I hope this helps.
--John
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


[2013 date index] [2013 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]