From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Thompson, David" Newsgroups: gmane.lisp.guile.devel Subject: Re: Attempting to unbox struct fields Date: Sun, 28 Feb 2016 16:30:21 -0500 Message-ID: References: <8737scubaj.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=94eb2c0b12ae50bcdd052cdb3d28 X-Trace: ger.gmane.org 1456695028 1925 80.91.229.3 (28 Feb 2016 21:30:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2016 21:30:28 +0000 (UTC) Cc: Andy Wingo To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Feb 28 22:30:28 2016 Return-path: Envelope-to: guile-devel@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 1aa8v5-0003VQ-J2 for guile-devel@m.gmane.org; Sun, 28 Feb 2016 22:30:27 +0100 Original-Received: from localhost ([::1]:60708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aa8v4-0008D9-Sa for guile-devel@m.gmane.org; Sun, 28 Feb 2016 16:30:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aa8v1-0008Cf-I7 for guile-devel@gnu.org; Sun, 28 Feb 2016 16:30:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aa8v0-0004Nx-EM for guile-devel@gnu.org; Sun, 28 Feb 2016 16:30:23 -0500 Original-Received: from mail-yk0-x234.google.com ([2607:f8b0:4002:c07::234]:33000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aa8v0-0004Ns-6U for guile-devel@gnu.org; Sun, 28 Feb 2016 16:30:22 -0500 Original-Received: by mail-yk0-x234.google.com with SMTP id z13so55629887ykd.0 for ; Sun, 28 Feb 2016 13:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=LlB3hGC0EtqE7DElFKgU3+2MxOCeLMGpkOlxujjA0zA=; b=ksMWaW9f6LqTOKKw2exs9A3o9erH+eWEvAPHx7u2A+5nvGUggYPTXmH4JAs8epebef DzgyJscFsKVDuPYFBqsQ0Eo2bj2FuCAX9bZIuYX0PWNxRzu0nchPn8vvnmYtaM7v/E0j iUrNyHlkhC9P2yW4CbEDnbaKkzu7iX1nyG79XE8G+7S+ZZb9PvcAGCuzutpjcl+GnodU xDk6rEDx+8mqq9e8iuQmw9smAyvzbIs5Au8dk24hP2JUFbufhCPrT8RX2KVcnDzPzni1 padGo6TnWPphacOKK2ORDffUHkzusHJYnJXtX7X2Q5u+qBCm4XBBvUIkgvYceN8jx5vg /pyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=LlB3hGC0EtqE7DElFKgU3+2MxOCeLMGpkOlxujjA0zA=; b=gkGdvYIr2bnhCdrXCv+2gu8cMnW7eROmB31IF1dGsVDt1QKaq0dZgSC4Qi1m+hs+lt WSiqSM1RZgTWCJl+bxEGRLnzg6a/G7dcG/j2zROdoETiVVbli0FQDceMCITw1tLa3TYw 3RwMisKI7py6KrcZuMXhKAn55BNDNeIVHVOnjZzgbsnZxVIDzkvMZJvJlfDkVmUZBuI7 d3+NsSbOrC/xqvF9JRQJzGhHuvNWtNasqVLhinW9gdH7MPBaNI8Uzwn8TUIRde7X4V/L 2P8l4CwAQ+yjm+lTbl3jhLW/afZY/3CF750rpoBC5DYRO34PeTNRQGpNaw+RoNCSBFF/ cgOw== X-Gm-Message-State: AD7BkJJbeK2N6aFgU/n3dWYC6W1JrOULuiPY1YyZiLGQVstmCk8vmGeNvfPJM9+c6jwfpZ5NkfKOBaDbdl6dKg== X-Received: by 10.37.231.11 with SMTP id e11mr6699492ybh.142.1456695021695; Sun, 28 Feb 2016 13:30:21 -0800 (PST) Original-Received: by 10.37.25.86 with HTTP; Sun, 28 Feb 2016 13:30:21 -0800 (PST) In-Reply-To: <8737scubaj.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4002:c07::234 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:18197 Archived-At: --94eb2c0b12ae50bcdd052cdb3d28 Content-Type: text/plain; charset=UTF-8 Here's a patch I came up with to enable (and fix where necessary) the support for signed integer and double struct fields. Am I on the right track here? Thanks, - Dave --94eb2c0b12ae50bcdd052cdb3d28 Content-Type: text/x-diff; charset=US-ASCII; name="0001-struct-Add-support-for-unboxed-signed-integers-and-d.patch" Content-Disposition: attachment; filename="0001-struct-Add-support-for-unboxed-signed-integers-and-d.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_il72kesd0 RnJvbSA4YmRlNWM3MDE4ZmRlOTFjYzcxNDA3NzcxMDdiYWNmYjNmZWJiMTcwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBEYXZpZCBUaG9tcHNvbiA8ZHRob21wc29uMkB3b3JjZXN0ZXIu ZWR1PgpEYXRlOiBTdW4sIDI4IEZlYiAyMDE2IDE2OjExOjM1IC0wNTAwClN1YmplY3Q6IFtQQVRD SF0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WN0LWxheW91dCIsIDEsIDAsIDAsCiAJICB7CiAJICBjYXNlICd1JzoKIAkgIGNhc2UgJ3AnOgot I2lmIDAKIAkgIGNhc2UgJ2knOgogCSAgY2FzZSAnZCc6Ci0jZW5kaWYKIAkgIGNhc2UgJ3MnOgog CSAgICBicmVhazsKIAkgIGRlZmF1bHQ6CkBAIC0yMTksNiArMjE3LDggQEAgc2NtX2lzX3ZhbGlk X3Z0YWJsZV9sYXlvdXQgKFNDTSBsYXlvdXQpCiAgICAgc3dpdGNoIChjX2xheW91dFtuXSkKICAg ICAgIHsKICAgICAgIGNhc2UgJ3UnOgorICAgICAgY2FzZSAnaSc6CisgICAgICBjYXNlICdkJzoK ICAgICAgIGNhc2UgJ3AnOgogICAgICAgY2FzZSAncyc6CiAgICAgICAgIHN3aXRjaCAoY19sYXlv dXRbbisxXSkKQEAgLTM2MCw2ICszNjAsMjYgQEAgc2NtX3N0cnVjdF9pbml0IChTQ00gaGFuZGxl LCBTQ00gbGF5b3V0LCBzaXplX3Qgbl90YWlsLAogCQl9CiAJICAgICAgYnJlYWs7CiAKKyAgICAg ICAgICAgIGNhc2UgJ2knOgorCSAgICAgIGlmICgocHJvdCAhPSAncicgJiYgcHJvdCAhPSAndycp IHx8IGluaXRzX2lkeCA9PSBuX2luaXRzKQorCQkqbWVtID0gMDsKKwkgICAgICBlbHNlCisJCXsK KwkJICAqbWVtID0gc2NtX3RvX2xvbmcgKFNDTV9QQUNLIChpbml0c1tpbml0c19pZHhdKSk7CisJ CSAgaW5pdHNfaWR4Kys7CisJCX0KKwkgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSAn ZCc6CisJICAgICAgaWYgKChwcm90ICE9ICdyJyAmJiBwcm90ICE9ICd3JykgfHwgaW5pdHNfaWR4 ID09IG5faW5pdHMpCisJCSptZW0gPSAwLjA7CisJICAgICAgZWxzZQorCQl7CisJCSAgKigoZG91 YmxlICopIG1lbSkgPSBzY21fdG9fZG91YmxlIChTQ01fUEFDSyA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