From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Troy Hinckley Newsgroups: gmane.emacs.devel Subject: Re: question about Qnil representation Date: Wed, 26 Oct 2022 10:04:47 -0600 Message-ID: <5d85a71f-500e-43c7-a1fb-47ffe8518d94@Spark> References: <5a560265-fa81-42d2-945b-ab85d72df9e6@Spark> <5a00e93e-5f44-4865-aeeb-51f0aced9996@Spark> <8335bao9rs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="63595aa4_7fdcc233_10bc8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10493"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 26 18:14:47 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onj3G-0002Xe-Pv for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Oct 2022 18:14:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onitq-0002ly-Ei; Wed, 26 Oct 2022 12:05:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1onitm-0002i9-FA for emacs-devel@gnu.org; Wed, 26 Oct 2022 12:04:58 -0400 Original-Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onitk-0003Eg-Fe; Wed, 26 Oct 2022 12:04:57 -0400 Original-Received: by mail-il1-x135.google.com with SMTP id d14so9059043ilf.2; Wed, 26 Oct 2022 09:04:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=qDm5kkLd9RacSJo3/Yq2mUiuvJ0PxDUyY3M94wOPzNY=; b=e9H9vifiFgZOrJ4L3mIpCkGrFVsbxoN29mrcseaGJg3NU95sSRAW12mZEZ/t2GrdGS fCOb0Vf+LulNkj7wXV50a+XVuKdNByjoyi3//TwjScZqRmdNAD17A5mWEM84eyeseAfy 7nZJ/K3qxFQtuR/lx5uMy2fqlJStTRXIMj/2X2hnY2sWjeh4qe0gpkQIzlV2LeN99Z7w Ffoh31pPuDEsViwbCdiVMhINUHLdoJi5CdlEHrPWDeGoxlGnkt10JlK1TozpNY3It2Vt CasG51BxNFI1iJw6snMnU9KqPSj6HbHJ5ZGweoKGGgu5M+aR51yR2JElpcNuP4+y0thb 9CKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qDm5kkLd9RacSJo3/Yq2mUiuvJ0PxDUyY3M94wOPzNY=; b=3HlJkz71Wjm9IQkj5+KdikjpMc+y1tOmTsoJ7xCtlBWXWzfAcszI+qAMS5T9EyThSS rvz2QFxwysB7WYMWBL8xgthsf1GFUkCOOLRGalK7sv+3z6dJ5h7bHsfyG8FGJYaucima 2PaEbj0ZjrLJzyea7SaCwsHCYTBOno6Igpm2DrJz0lUepxqQS1CbI4CQwRQQnO4oWbe5 UEElS6Cyn19QONg88++TcIjJEvmrpVRNRojLnl7lMMprBAzfSXEapveiKVfUShTYU1uE mnlU3fXnJPTLSfQsjnNC9TF3IR4GYRFm9xzir9/b0/5gM7TWDuYHCUMh1aBa40sfAK4I E9QA== X-Gm-Message-State: ACrzQf0pskCYKV59GM4xWtU1DRuEr23g6sW7VXdDwfuTpXnt1MTwFiYh Wi4ducXEeGmBAAkQQ89kiSOuE2d0WI0= X-Google-Smtp-Source: AMsMyM52LqA8lOKNeeBqbJNbCxwiFG+lSe0uIeKbcHm0DVgpFixDQXxQLQbJg0YHyiwki/W3XrJLgg== X-Received: by 2002:a05:6e02:19ce:b0:2fc:3a29:f89f with SMTP id r14-20020a056e0219ce00b002fc3a29f89fmr27169178ill.219.1666800294419; Wed, 26 Oct 2022 09:04:54 -0700 (PDT) Original-Received: from [192.168.1.121] (h24-54-181-16.ftcmco.broadband.dynamic.tds.net. [24.54.181.16]) by smtp.gmail.com with ESMTPSA id m1-20020a056638224100b0035a498d222asm2096414jas.35.2022.10.26.09.04.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2022 09:04:53 -0700 (PDT) In-Reply-To: <8335bao9rs.fsf@gnu.org> X-Readdle-Message-ID: 5d85a71f-500e-43c7-a1fb-47ffe8518d94@Spark Received-SPF: pass client-ip=2607:f8b0:4864:20::135; envelope-from=troyhinckley@gmail.com; helo=mail-il1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: "Emacs-devel" Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:298558 Archived-At: --63595aa4_7fdcc233_10bc8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sure, but it reinterprets the integer as a *Lisp=5FSymbol to get at the a= ctual struct correct=3F Or am I misunderstanding how this works=3F On Oct 26, 2022, 10:00 AM -0600, Eli Zaretskii , wrote: > > Date: Wed, 26 Oct 2022 09:40:30 -0600 > > =46rom: Troy Hinckley > > > > I have been reading through the C source to try and learn it and unde= rstand it better. I saw in Changeling.13 an > > entry =46rom Paul Eggert on 2015-01-05 with =E2=80=9CUse 0 for Qnil=E2= =80=9D As a fix for Bug=2315880. How does this work in > > practice=3F It looks like symbols are just pointers, but 0 would not = be a valid pointer. I don=E2=80=99t see any special code > > for handling the null case. > > Symbols are not pointers, they have the same C type as any other > Lisp=5FObject. If Lisp=5FObject is represented by an integer number, th= en > zero is a valid integer number as well. > --63595aa4_7fdcc233_10bc8 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Sure, but it reinterprets the integer as a *Lisp=5F= Symbol to get at the actual struct correct=3F Or am I misunderstanding ho= w this works=3F
On Oct 26, 2022, 10:00 AM -0600, El= i Zaretskii <eliz=40gnu.org>, wrote:
Date: Wed, 26 Oct 2022 09:40:30 -0600
= =46rom: Troy Hinckley <troyhinckley=40gmail.com>

I have been reading through the C source to try and learn it and understa= nd it better. I saw in Changeling.13 an
entry =46rom Paul Eggert on 2015-01-05 with =E2=80=9CUse 0 for Qnil=E2=80= =9D As a fix for Bug=2315880. How does this work in
practice=3F It looks like symbols are just pointers, but 0 would not be a= valid pointer. I don=E2=80=99t see any special code
for handling the null case.

Symbols are not pointers, they have the same C type as any other
Lisp=5FObject. If Lisp=5FObject is represented by an integer number, then=
zero is a valid integer number as well.

--63595aa4_7fdcc233_10bc8--