From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: daniel Newsgroups: gmane.emacs.help Subject: Re: pymacs Date: Mon, 10 Jun 2013 11:54:01 +0100 Message-ID: References: <877gi27j5h.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1370861676 7620 80.91.229.3 (10 Jun 2013 10:54:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Jun 2013 10:54:36 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 10 12:54:37 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UlzkC-0004uS-AR for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Jun 2013 12:54:36 +0200 Original-Received: from localhost ([::1]:48612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlzkC-0006ou-0r for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Jun 2013 06:54:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulzk1-0006no-B3 for help-gnu-emacs@gnu.org; Mon, 10 Jun 2013 06:54:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ulzjz-000615-7X for help-gnu-emacs@gnu.org; Mon, 10 Jun 2013 06:54:25 -0400 Original-Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:36267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulzjz-00060r-12 for help-gnu-emacs@gnu.org; Mon, 10 Jun 2013 06:54:23 -0400 Original-Received: by mail-pa0-f45.google.com with SMTP id bi5so4327537pad.18 for ; Mon, 10 Jun 2013 03:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=IiQ9fKhsxAzKKU7/SgBpipCXT8BOlSMnTd1uRSCLKUQ=; b=rGudPnnGnk9djDh8gfJGjp4ai09eVbpgqADS0ftxX/50d95JqHl0mr9bMxD0Tk8tkT qmYp7xQMU6CjHEG5ti5zoznADh4C7TR48aEGx3d/aBuiqUE2TqOB1b9j/Ut3bHUarSR8 uuuuAJwILMorINXrdDbgeoRKIiVOM8q/zKAbL6ZDEpHA4GgOOXZ9lTGesjWEI6dRC3OE 7Mtkba7G2gPw3yc91DKGXAqXUwWh0dl7ugvrwKdpMD18xIAgulitbh88KpDJnMM5nQvZ wb10M1WwMxd54gEYs7/oBJ3LURHcCRM/8FMd7CnVA7vNJAmkpcYaLOXeoH9r6qTvWtZQ Nj5Q== X-Received: by 10.68.12.165 with SMTP id z5mr9267945pbb.172.1370861661916; Mon, 10 Jun 2013 03:54:21 -0700 (PDT) Original-Received: by 10.70.55.69 with HTTP; Mon, 10 Jun 2013 03:54:01 -0700 (PDT) In-Reply-To: <877gi27j5h.fsf@ericabrahamsen.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:91431 Archived-At: 2013/6/10 Eric Abrahamsen > > 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.