help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: pymacs


From: daniel
Subject: Re: pymacs
Date: Mon, 10 Jun 2013 11:54:01 +0100

2013/6/10 Eric Abrahamsen <eric@ericabrahamsen.net>

>
> What else do you need to know?
>
>
In Ubuntu it is easy to install Pymacs because it is on the standard
repository.

The question is about passing values from python and elisp and the opposite
way.

# A function that receives a elisp variable name and returns it's value:
from pymacs import lisp
def tvar(n):
    return lisp[n].value()


AND IN ELISP:

(pymacs-load "pymacs_teste")

(setq PTEST "string")
(pymacs-teste-tvar "PTEST") ;; returns "string" Ok!

(setq PTEST (list 1 2 3))
(pymacs-teste-tvar "PTEST") ;; returns (lambda (&rest arguments)
(pymacs-apply (quote (pymacs-python . 4543)) arguments))

When python calls lisp[n].value() it returns a kind of wrapper which works
well inside python. But if I return it back to elisp, it doesn't work.

If I do instead
def tvar(n):
    return list( lisp[n].value() )

It works perfectly.

But I don't know what to do if PTEST contains a elisp symbol.


reply via email to

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