From unknown Tue Jun 24 10:33:37 2025 X-Loop: help-debbugs@gnu.org Subject: bug#10922: procedure-argumets does not work with advanced evaled lambdas Resent-From: Stefan Israelsson Tampe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 01 Mar 2012 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10922 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 10922@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.133063919318903 (code B ref -1); Thu, 01 Mar 2012 22:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Mar 2012 21:59:53 +0000 Received: from localhost ([127.0.0.1]:57978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3E2N-0004ua-Oq for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56198) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3E26-0004u6-9S for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3E1c-0005IU-L4 for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3E1c-0005IJ-FA for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3E1a-0002G8-Nf for bug-guile@gnu.org; Thu, 01 Mar 2012 16:59:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3E1Y-0005Hz-Q5 for bug-guile@gnu.org; Thu, 01 Mar 2012 16:58:58 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:64059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3E1Y-0005Gi-Ga for bug-guile@gnu.org; Thu, 01 Mar 2012 16:58:56 -0500 Received: by eeke53 with SMTP id e53so431310eek.0 for ; Thu, 01 Mar 2012 13:58:54 -0800 (PST) Received-SPF: pass (google.com: domain of stefan.itampe@gmail.com designates 10.213.7.144 as permitted sender) client-ip=10.213.7.144; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefan.itampe@gmail.com designates 10.213.7.144 as permitted sender) smtp.mail=stefan.itampe@gmail.com; dkim=pass header.i=stefan.itampe@gmail.com Received: from mr.google.com ([10.213.7.144]) by 10.213.7.144 with SMTP id d16mr800963ebd.54.1330639134001 (num_hops = 1); Thu, 01 Mar 2012 13:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=heBYVIjxCi4Cc7OZh3dn2B4YbITTXCYPhfyNwLiQrtc=; b=OfodRX46wVpsUyPNzVqDsYlSWgqwLSokx7qZYCmgVCWpg83rA2/cAW8D7sJP1t/yQX xWrGXpXa+wvsAla8zEPivYoxuBFLXfQF7yzwDw58FKdPRggE3AS11CyfaKQorkUviR4Z s6J1DJm3coFD8kDriEqFHhQA5HG/wB4gooZfR32RZKHGYDdtTrG8wxPp+SY0NHVw3zmF cEuiPlqCvqGebuF08KhOPCI3qoQQ10nCWAPq0bPYRFsus5fP6fYDZ0mBrn+Ig2b2Fs/p PjEbEXd62RjVHGv+guBE8TCb7dumdrpSGs13iNJBH/2EPXeNTAxhQA2pOMsmd0mejzxf o3pw== MIME-Version: 1.0 Received: by 10.213.7.144 with SMTP id d16mr608783ebd.54.1330639133851; Thu, 01 Mar 2012 13:58:53 -0800 (PST) Received: by 10.213.7.4 with HTTP; Thu, 1 Mar 2012 13:58:53 -0800 (PST) Date: Thu, 1 Mar 2012 22:58:53 +0100 Message-ID: From: Stefan Israelsson Tampe Content-Type: multipart/alternative; boundary=0015174bdb74e5c14f04ba359093 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -1.1 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) --0015174bdb74e5c14f04ba359093 Content-Type: text/plain; charset=ISO-8859-1 Here is a transcript of the problem scheme@(guile-user)> (define f (lambda* (#:key x) x)) scheme@(guile-user)> (procedure-arguments f) $53 = ((required) (optional) (keyword (#:x . 0)) (allow-other-keys? . #f) (rest . #f)) scheme@(guile-user)> (define f (eval '(lambda* (#:key x) x) (current-module))) scheme@(guile-user)> (procedure-arguments f) $54 = ((required) (optional) (keyword) (allow-other-keys? . #f) (rest . %args)) Why is this important. As an example trying to port rackets contract you have functions that take a function and return a new function with checks according to a contract added. the functionality is the same but input and output is checked. Now to use this, information about the keywords are needed in order to do some sanity checks that can be done at construction time. But if we eval a lambda and use that, we saw above that the information is not added. and the nice idea with contracts is broken. Solution idea: mod eval.scm and as described in session.scm make sure to add a 'arglist procedure-property to the newly constructed lambda with the appropriate information added. Regards Stefan --0015174bdb74e5c14f04ba359093 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here is a transcript of the problem

scheme@(guile-user)> (define = f (lambda* (#:key x) x))
scheme@(guile-user)> (procedure-arguments f)=

$53 =3D ((required) (optional) (keyword (#:x . 0)) (allow-other-key= s? . #f) (rest . #f))

scheme@(guile-user)> (define f (eval '(lambda* (#:key x) x) (cur= rent-module)))
scheme@(guile-user)> (procedure-arguments f)

$5= 4 =3D ((required) (optional) (keyword) (allow-other-keys? . #f) (rest . %ar= gs))

Why is this important.

As an example trying to port rackets cont= ract you have functions that take a function
and return a new function w= ith checks according to a contract added. the functionality
is the same = but input and output is checked. Now to use this, information about the
keywords are needed in order to do some sanity checks that can be done at c= onstruction
time. But if we eval a lambda and use that, we saw above tha= t the information is not added.
and the nice idea with contracts is brok= en.


Solution idea:

mod eval.scm and as described in session.scm = make sure to add a 'arglist procedure-property
to the newly construc= ted lambda with the appropriate information added.

Regards
Stefan=
--0015174bdb74e5c14f04ba359093-- From unknown Tue Jun 24 10:33:37 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Israelsson Tampe Subject: bug#10922: closed (Re: bug#10922: procedure-argumets does not work with advanced evaled lambdas) Message-ID: References: <877guh19a0.fsf@pobox.com> X-Gnu-PR-Message: they-closed 10922 X-Gnu-PR-Package: guile Reply-To: 10922@debbugs.gnu.org Date: Fri, 06 Jul 2012 12:17:06 +0000 Content-Type: multipart/mixed; boundary="----------=_1341577026-9706-1" This is a multi-part message in MIME format... ------------=_1341577026-9706-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #10922: procedure-argumets does not work with advanced evaled lambdas which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 10922@debbugs.gnu.org. --=20 10922: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10922 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1341577026-9706-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 10922-done) by debbugs.gnu.org; 6 Jul 2012 12:16:32 +0000 Received: from localhost ([127.0.0.1]:51557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sn7SY-0002U4-Kr for submit@debbugs.gnu.org; Fri, 06 Jul 2012 08:16:32 -0400 Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:36875 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sn7SW-0002Tx-Bm for 10922-done@debbugs.gnu.org; Fri, 06 Jul 2012 08:16:28 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 60015B3B5; Fri, 6 Jul 2012 08:11:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=nbOoKNxxJcdwMUEeLH1OfQ8k78M=; b=TJ6q7I wfUfgbbqZgi1+quEGF58KO4mk7cKYAvyFxDrR0fqWNXeJFRzJVxnn2LzAbWF5hAF l5UEeTE1s7EX3L+ulstxgHcQrxYSsLXdIjxLv5zR8MF2d9kK8dv95wYKm1EVarsc VN4HKMW+NvNmxMq1ji3PQbQgVQwKglHCeCmwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=HDGOEhEoYISckhsb10w6gQ0Q3VWTIzom wYL10Pq5QwvnyIinFBh7CuYHCPi/dt2YX/XAt5bChgYbzdtqHLz+8UCbM6t1NBN1 oo6nkM6q4868IfrCHLJkBx2xfUnN3gbYf7TJv1VVCrcGwdKHxeuVtVvUmU16wcdj wyISSXGnpkI= Received: from b-pb-sasl-sd. (unknown [127.0.0.1]) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 569B6B3B1; Fri, 6 Jul 2012 08:11:30 -0400 (EDT) Received: from badger (unknown [89.131.176.233]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by b-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id BA30DB3B0; Fri, 6 Jul 2012 08:11:29 -0400 (EDT) From: Andy Wingo To: Stefan Israelsson Tampe Subject: Re: bug#10922: procedure-argumets does not work with advanced evaled lambdas References: Date: Fri, 06 Jul 2012 12:19:51 +0200 In-Reply-To: (Stefan Israelsson Tampe's message of "Thu, 1 Mar 2012 22:58:53 +0100") Message-ID: <877guh19a0.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: B7EAED02-C763-11E1-AD36-FA6787E41631-02397024!b-pb-sasl-sd.pobox.com X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 10922-done Cc: 10922-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Fixed in fc835b1b, thanks for the report. Andy -- http://wingolog.org/ ------------=_1341577026-9706-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Mar 2012 21:59:53 +0000 Received: from localhost ([127.0.0.1]:57978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3E2N-0004ua-Oq for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:53 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56198) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1S3E26-0004u6-9S for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3E1c-0005IU-L4 for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3E1c-0005IJ-FA for submit@debbugs.gnu.org; Thu, 01 Mar 2012 16:59:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:41234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3E1a-0002G8-Nf for bug-guile@gnu.org; Thu, 01 Mar 2012 16:59:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3E1Y-0005Hz-Q5 for bug-guile@gnu.org; Thu, 01 Mar 2012 16:58:58 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:64059) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3E1Y-0005Gi-Ga for bug-guile@gnu.org; Thu, 01 Mar 2012 16:58:56 -0500 Received: by eeke53 with SMTP id e53so431310eek.0 for ; Thu, 01 Mar 2012 13:58:54 -0800 (PST) Received-SPF: pass (google.com: domain of stefan.itampe@gmail.com designates 10.213.7.144 as permitted sender) client-ip=10.213.7.144; Authentication-Results: mr.google.com; spf=pass (google.com: domain of stefan.itampe@gmail.com designates 10.213.7.144 as permitted sender) smtp.mail=stefan.itampe@gmail.com; dkim=pass header.i=stefan.itampe@gmail.com Received: from mr.google.com ([10.213.7.144]) by 10.213.7.144 with SMTP id d16mr800963ebd.54.1330639134001 (num_hops = 1); Thu, 01 Mar 2012 13:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=heBYVIjxCi4Cc7OZh3dn2B4YbITTXCYPhfyNwLiQrtc=; b=OfodRX46wVpsUyPNzVqDsYlSWgqwLSokx7qZYCmgVCWpg83rA2/cAW8D7sJP1t/yQX xWrGXpXa+wvsAla8zEPivYoxuBFLXfQF7yzwDw58FKdPRggE3AS11CyfaKQorkUviR4Z s6J1DJm3coFD8kDriEqFHhQA5HG/wB4gooZfR32RZKHGYDdtTrG8wxPp+SY0NHVw3zmF cEuiPlqCvqGebuF08KhOPCI3qoQQ10nCWAPq0bPYRFsus5fP6fYDZ0mBrn+Ig2b2Fs/p PjEbEXd62RjVHGv+guBE8TCb7dumdrpSGs13iNJBH/2EPXeNTAxhQA2pOMsmd0mejzxf o3pw== MIME-Version: 1.0 Received: by 10.213.7.144 with SMTP id d16mr608783ebd.54.1330639133851; Thu, 01 Mar 2012 13:58:53 -0800 (PST) Received: by 10.213.7.4 with HTTP; Thu, 1 Mar 2012 13:58:53 -0800 (PST) Date: Thu, 1 Mar 2012 22:58:53 +0100 Message-ID: Subject: procedure-argumets does not work with advanced evaled lambdas From: Stefan Israelsson Tampe To: bug-guile@gnu.org Content-Type: multipart/alternative; boundary=0015174bdb74e5c14f04ba359093 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.1 (-) --0015174bdb74e5c14f04ba359093 Content-Type: text/plain; charset=ISO-8859-1 Here is a transcript of the problem scheme@(guile-user)> (define f (lambda* (#:key x) x)) scheme@(guile-user)> (procedure-arguments f) $53 = ((required) (optional) (keyword (#:x . 0)) (allow-other-keys? . #f) (rest . #f)) scheme@(guile-user)> (define f (eval '(lambda* (#:key x) x) (current-module))) scheme@(guile-user)> (procedure-arguments f) $54 = ((required) (optional) (keyword) (allow-other-keys? . #f) (rest . %args)) Why is this important. As an example trying to port rackets contract you have functions that take a function and return a new function with checks according to a contract added. the functionality is the same but input and output is checked. Now to use this, information about the keywords are needed in order to do some sanity checks that can be done at construction time. But if we eval a lambda and use that, we saw above that the information is not added. and the nice idea with contracts is broken. Solution idea: mod eval.scm and as described in session.scm make sure to add a 'arglist procedure-property to the newly constructed lambda with the appropriate information added. Regards Stefan --0015174bdb74e5c14f04ba359093 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Here is a transcript of the problem

scheme@(guile-user)> (define = f (lambda* (#:key x) x))
scheme@(guile-user)> (procedure-arguments f)=

$53 =3D ((required) (optional) (keyword (#:x . 0)) (allow-other-key= s? . #f) (rest . #f))

scheme@(guile-user)> (define f (eval '(lambda* (#:key x) x) (cur= rent-module)))
scheme@(guile-user)> (procedure-arguments f)

$5= 4 =3D ((required) (optional) (keyword) (allow-other-keys? . #f) (rest . %ar= gs))

Why is this important.

As an example trying to port rackets cont= ract you have functions that take a function
and return a new function w= ith checks according to a contract added. the functionality
is the same = but input and output is checked. Now to use this, information about the
keywords are needed in order to do some sanity checks that can be done at c= onstruction
time. But if we eval a lambda and use that, we saw above tha= t the information is not added.
and the nice idea with contracts is brok= en.


Solution idea:

mod eval.scm and as described in session.scm = make sure to add a 'arglist procedure-property
to the newly construc= ted lambda with the appropriate information added.

Regards
Stefan=
--0015174bdb74e5c14f04ba359093-- ------------=_1341577026-9706-1--