slang-users mailing list

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

Re: [slang-users] SLang_restart - clear globals?


Jeremy Cowgar <jc@xxxxxxxxxx> wrote:
>Does SLang_restart(1) clear global variables? functions defined in the
>SLang environment? Such as:

No.  It simply resets the interpreter to a runnable state.  It does
not clear any definitions.  SLang 2 will support such a function.

>void my_function()
>{
>  SLang_load_file("hi.sl");
>  
>  // ---- hi.sl:
>  variable name = "Jeremy";
>  define say_hi(how)
>  {
>    print(how+" "+name);
>  }
>  SLang_restart(1);
>}
>.. will the function say_hi() and variable name be available next time
>I call load_file? What about if it's a different file, such as bye.sl?
>Will name and say_hi be available?

Your mixing of C and slang confused me a bit but I understand what you
are asking.  Yes, both say_hi and name will be available.  Are you
asking if a memory leak will be created by this process?  The answer
to that is no.  Reloading hi.sl a second time will free any memory
associated with the first instance.

--John

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


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