From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Shann Newsgroups: gmane.lisp.guile.user Subject: Trouble with returning parameters passed in to C primitives. Date: Thu, 06 Dec 2012 11:20:36 +0000 Message-ID: <1354792836.2049.220.camel@debian-box.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354831130 24871 80.91.229.3 (6 Dec 2012 21:58:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2012 21:58:50 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Dec 06 22:59:04 2012 Return-path: Envelope-to: guile-user@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 1TgjTC-00018d-0K for guile-user@m.gmane.org; Thu, 06 Dec 2012 22:59:02 +0100 Original-Received: from localhost ([::1]:60922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgj5Z-00078f-BO for guile-user@m.gmane.org; Thu, 06 Dec 2012 16:34:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgZXE-0004nA-6d for guile-user@gnu.org; Thu, 06 Dec 2012 06:22:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgZXD-0001ED-3y for guile-user@gnu.org; Thu, 06 Dec 2012 06:22:32 -0500 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:52489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgZXC-0001Dw-Tl for guile-user@gnu.org; Thu, 06 Dec 2012 06:22:31 -0500 Original-Received: by mail-bk0-f41.google.com with SMTP id jg9so2857146bkc.0 for ; Thu, 06 Dec 2012 03:22:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:subject:from:to:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding:x-gm-message-state; bh=02eJah0ceBePB6JKFaipj7EJfh4+q0QXn9y4BD3ffrw=; b=cVUy4wlf2lgDYN8t9OSfwFrzirKi/tTfCo7PLYZ90Dn2c99YxbmXAUqdW2bc55bB7U sROrJhxs/zLYICgFMDGrqgve46LAlo7AyzUORsdUJkv5hjyniH/+xgNGpiTSX3eUKY7w d8I/6V1LrrKJ7lGexRJ4N59O4qkKj3VMTpWjXp3Dk58s5YliS/GyWrmZ12Si1krgsu68 9v3Jb+wK9Ldt7Q1zHszk7dTcJxVm/N8aJlbaGHdFbdMvu/MklXRAuS10hCx1/KItTTh8 MRZDkbk9LKalwliFsTmug1jgzPYX8tYAfFYlkeJLcXZRXS4ttRiiWni5y3Aubs+7S0uM 0ZcA== Original-Received: by 10.204.147.143 with SMTP id l15mr447228bkv.28.1354792949479; Thu, 06 Dec 2012 03:22:29 -0800 (PST) Original-Received: from (know-mailgateway-3.server.virginmedia.net. [62.254.26.105]) by mx.google.com with ESMTPS id hm8sm6040000bkc.10.2012.12.06.03.22.27 (version=SSLv3 cipher=OTHER); Thu, 06 Dec 2012 03:22:28 -0800 (PST) Original-Received: from source ([146.90.23.75]) by smtp.virginmedia.com with SMTP; Thu, 06 Dec 2012 11:22:28 +0000 (GMT) X-ProxyUser-IP: 146.90.23.75 X-Mailer: Evolution 2.30.3 X-Gm-Message-State: ALoCoQlGCXzmaJm24w8Ssd0vzHy4Mo1mm33VMFOB9ZvxqmkZH/kaG7ZWpyFXS0jodCY5R4M/utIo X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.214.41 X-Mailman-Approved-At: Thu, 06 Dec 2012 16:34:34 -0500 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9739 Archived-At: In GNU/Denemo we have been calling functions written in C from scheme by defining procedures via scm_c_define_gsubr. Recently I have tried returning one of the parameters passed (more exactly, the scm_list_ref of a scm_car() of one of the parameters) and I have run into trouble. If I pass 'a in as a parameter I get something back which prints on the console as (quote a) but which is not eq? to 'a I can pass in a string and get an equal? string back. But what I really want to do is pass in a procedure and execute it if I get it back, thus (set! choice (d-PopupMenu (list '("Offset Position" . do-offset)))) (if choice (choice)) where do-offset is defined as (define (do-offset) (display "hello world")) and d-PopupMenu is my C-primitive which gets a choice from the user. If the user cancels choice is #f and all is well, if he accepts the one option on the menu, do-offset is returned but I get the error message (#f Wrong type to apply: ~S (do-offset) #f) (BTW I can't find a blow by blow explanation of this error message anywhere, I see some discussion of earlier versions of it on the net...) Anyone able to help? Richard Shann