From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.devel Subject: Re: Immediate doubles (up to 2^256) and rationals coming to Guile 3 Date: Sat, 8 Jun 2019 10:08:25 +0100 Message-ID: <20190608100825.7ae761680debe51e487913f1@gmail.com> References: <87zhmvaw5p.fsf@netris.org> <877e9wc210.fsf@netris.org> <87blz8wlda.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="130294"; mail-complaints-to="usenet@blaine.gmane.org" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jun 08 11:09:09 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hZXLS-000Xe4-QA for guile-devel@m.gmane.org; Sat, 08 Jun 2019 11:09:07 +0200 Original-Received: from localhost ([::1]:56358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZXLR-0006nd-Am for guile-devel@m.gmane.org; Sat, 08 Jun 2019 05:09:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41066) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZXKx-0006nG-Ka for guile-devel@gnu.org; Sat, 08 Jun 2019 05:08:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZXKv-0006j4-VN for guile-devel@gnu.org; Sat, 08 Jun 2019 05:08:31 -0400 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:45536) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hZXKv-0006iO-IP for guile-devel@gnu.org; Sat, 08 Jun 2019 05:08:29 -0400 Original-Received: by mail-wr1-x42a.google.com with SMTP id f9so4359739wre.12 for ; Sat, 08 Jun 2019 02:08:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=BdVLn/e/EXT45rJhtA/oSbmdwIFf3YNl6ugXG1pP2Io=; b=UpaWjtXFXbpA6g+z4ihNb+zVgH7kRXvfHO8QFO+S2ZJXW3KRWGWdD0sF/oZCTD1oy7 FOmKTYBQ/80J7+5nLY35LWgZRm8RtkV2VKta85DoLllAlPY7KH8tlsb0WVaDp1hXvIsk YQ86H6oM4n0X/uc29DtrhcnhCFPa4FIGPmMPBKZz+Ot5Tg/BqcMIpVon+rBDMy0xxjQw lGHeYprCZpWPTeD9w4TzofjWHi5S+dyg/bNlf3s1cKILsDJENsKOYjU1FtE73Eq6zoRw o7vIeyNL+vgsjuIUHXHl8DKJY4L1bojJbsoCIR265lVqJLlFQz5WD9cS0qPWk4FbPuJy F6rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BdVLn/e/EXT45rJhtA/oSbmdwIFf3YNl6ugXG1pP2Io=; b=ElXObE5ogERmEGuvb0xa1FZ/pp1kgGJcGw5MEau3+pGta4bhxohRn9eYXeV9h4k2sm /Fa9fTwZzJVBj5qImLwwCK56S4tDZeJxVTR2bwxUNUhqMZVXYRc1TuCutDiiGShlqnX7 JcVPKEly4stnrnZbrTUj0lkSehVBxVmDLE6q9kAeX04yk0FcRZxl64lzWzE5t4iIhocX PgGiG5xZw0LEDXR1PsS+MwJOZqnn+3EUEvyU+2TEjXpAPVjVdeZFxVuxXZc8T+LIvT50 X75dPHwwyf3lR2Db7HX3rL9krIvON3mhWF58y7jJgYPo2fnf+useRmIql+MhVDkTlZNt 9QYg== X-Gm-Message-State: APjAAAV+wq0DU+gXZY8VlS/QSj0qBwCGAniqp8ktQAamjjgOQQygcCs5 EMS5M32LmwzG6MnBGISJI8F3kOTB X-Google-Smtp-Source: APXvYqxWDYu6TCqB7AGEqSkq/Fd/4ghDdrZVttamquj7c2oqQ8GYfh443xBzmNs/gYc1gohPv8WPlg== X-Received: by 2002:adf:c7d0:: with SMTP id y16mr37121177wrg.39.1559984907734; Sat, 08 Jun 2019 02:08:27 -0700 (PDT) Original-Received: from bother.homenet ([2.27.184.193]) by smtp.gmail.com with ESMTPSA id b136sm5173527wme.30.2019.06.08.02.08.26 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 08 Jun 2019 02:08:26 -0700 (PDT) Original-Received: from bother.homenet (localhost [127.0.0.1]) by bother.homenet (Postfix) with SMTP id 8A95426850A for ; Sat, 8 Jun 2019 10:08:25 +0100 (BST) In-Reply-To: <87blz8wlda.fsf@web.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.org gmane.lisp.guile.devel:19954 Archived-At: On Sat, 08 Jun 2019 10:07:45 +0200 Arne Babenhauserheide wrote: [snip] > Wow, I didn’t know that you could do that. > > However: "The details of that allocation are implementation-defined, and > it's undefined behavior to read from the member of the union that wasn't > most recently written." https://en.cppreference.com/w/cpp/language/union > > Can you guarantee that this works? This is C and not C++ and the provision to which you refer does not apply. Reading from a member of a union other than the one last written to is implementation defined in C89/90, and defined in C99 (with Technical Corrigendum 3) and above, although it might include a trap representation (but wouldn't on any platform supported by guile). You might want to see in particular footnote 95 of C11 (which isn't normative but is intended to explain the provisions of §6.2.6.1 which are). gcc and clang have always supported type punning through unions. Chris