guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating New Scope


From: Neil Jerram
Subject: Re: Creating New Scope
Date: Tue, 31 Oct 2006 21:43:20 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Volkan YAZICI <address@hidden> writes:

> Hi all,
>
> This may look a little bit similar to my previous question but, I
> couldn't figure out a solution and thought it'd be best to hear your
> opinions about the problem: How can I create a new [for instance (let
> ...)] scope within my C code? By using such a method, after the
> execution of the scope, I'll be sure that any definitions special to the
> scope will get freed. I hope, I managed to explain my question.

I'm not sure what you mean by a new scope in C code.  C code must
always obey C's rules, of course.

Perhaps you mean that the C code has some Scheme code that it wants to
eval, but that it doesn't want it to make any lasting bindings.

Then I guess you could do something like

  scm_eval_string (scm_string_append (scm_list_3
     (scm_from_locale_string ("(let () "),
      scm_from_locale_string (code_to_eval),
      scm_from_locale_string (")"))));

Does that help at all?

Regards,
     Neil





reply via email to

[Prev in Thread] Current Thread [Next in Thread]