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:22:54 -0600 Message-ID: References: <5a560265-fa81-42d2-945b-ab85d72df9e6@Spark> <5a00e93e-5f44-4865-aeeb-51f0aced9996@Spark> <87ilk6a7be.fsf@rfc20.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="63595ee3_2901d82_10bc8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23821"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org, Matt Armstrong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 26 18:24:07 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 1onjCJ-00060G-Hp for ged-emacs-devel@m.gmane-mx.org; Wed, 26 Oct 2022 18:24:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onjBQ-00022V-0i; Wed, 26 Oct 2022 12:23:12 -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 1onjBM-0001NM-Pw for emacs-devel@gnu.org; Wed, 26 Oct 2022 12:23:08 -0400 Original-Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onjBK-0006f7-Qy for emacs-devel@gnu.org; Wed, 26 Oct 2022 12:23:08 -0400 Original-Received: by mail-io1-xd2f.google.com with SMTP id z3so1655771iof.3 for ; Wed, 26 Oct 2022 09:23:02 -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:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=bCWbMRzofj8tYUpfJJZgRfDIBQyTBdzJZ8EQYBN5xhY=; b=XXycoRtV0Hs5gBANCf4XVQP1JOTJucHMCuHZ5IyCwLlPPQDTnskqPWGtWa7mPvn6VT /rKgz35Lb3+/y1pTNk75uFReu6VkWB2I9EB+Dfl2Tn1lwRR0474i/8iSl8bERUHFl9ba ovS6/jMjHM520PtDR7BI9tvdHfjEhkcIi0CTxAtaDSqqd+Vxl0REy9/JZNK4gqu1Hot8 R05FFO4laOmqGECrwLzURepyncSzrCTRruXBOK/x1PEKPHqWYyQevpI1jRzuXChrKKbQ qSte82WS45U+rftDQNBnkeJWDeMUmvk5+ZYOHViUER38QSje12buQrOczjwj5vTJS63M u0vQ== 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:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bCWbMRzofj8tYUpfJJZgRfDIBQyTBdzJZ8EQYBN5xhY=; b=uh5QLXWj87fePzi/7WsphsuukTVa2XUT61Lzg0yAFDAPUgw+FJ37oTu9vlTjLbi3Iq df4pnRYbyPKF4wiOj20Povz3g1BIQvezCsKTt3ECJlbfNWHm3VTiwvVTBi1HXF4HNZV9 tiKmxHOgZBsS5SvYdTLVuPP/yfqZH/hkKFEtesSLdHSYkftbR+IIOaF4ccuBbWV6fxW4 /Emaslj60lMjSymY44nqXNYNkKrgmAltEi8kUmmG0+QSMg/GCUiyaNyMI8i1lQaxJ38S MPfT9E+tfzgvRXFPJHt6nHLm5drMviW3vPQ5Sq7S2laKpdC+3aryWCnfhpcvL3ZTz3tg AfoQ== X-Gm-Message-State: ACrzQf3YSAcnQby/0Nwy8kqh2y+GiyTCazAZ4jcwbHmwflr/CLs18roq rTpuudVzbSmzl4dywZ7LQg1elEd/6A0= X-Google-Smtp-Source: AMsMyM67d8rWLZpUGMmeJ5wparDCaG6IIwJ7g8i5EANVVMZG+GnHBF8pRzq+9FswyqB8Eqaw/GhAnQ== X-Received: by 2002:a05:6602:341c:b0:6bc:1c3d:836e with SMTP id n28-20020a056602341c00b006bc1c3d836emr24584945ioz.24.1666801381143; Wed, 26 Oct 2022 09:23:01 -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 k7-20020a056e02134700b0030014a5556bsm2174059ilr.69.2022.10.26.09.23.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2022 09:23:00 -0700 (PDT) In-Reply-To: <87ilk6a7be.fsf@rfc20.org> X-Readdle-Message-ID: d48212c3-9688-4a0a-8b1a-401b9ab43a2c@Spark Received-SPF: pass client-ip=2607:f8b0:4864:20::d2f; envelope-from=troyhinckley@gmail.com; helo=mail-io1-xd2f.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:298560 Archived-At: --63595ee3_2901d82_10bc8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Clearly I am doing a poor job explaining my question. Let me try again. As I understand it, every Symbol is an instance if Lisp_Symbol. The Lisp_Object is an integer that can represent multiple types with tags defined by Lisp_Type. If the tag is 0, then the type is a symbol. In that case you would treat the rest of the bytes in the Lisp_Object as pointer to a Lisp_Symbol instance. However if the symbol nil is defined as 0, then it is not a pointer to anything. How then do you access that symbol? Is there special case code to handle the null pointer? I hope that question makes more sense. Let me know where my understanding is wrong. On Oct 26, 2022, 10:16 AM -0600, Matt Armstrong , wrote: > Troy Hinckley writes: > > > but 0 would not be a valid pointer. > > I am a confused by this. 0 is a valid value for a C pointer. This is > what NULL is, etc. You must not dereference it, but it is a valid > value. --63595ee3_2901d82_10bc8 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Clearly I am doing a poor job explaining my questio= n.&=23160;

Let me try again. As I understand it, every Symbol is an instance if Lisp= =5FSymbol. The Lisp=5FObject is an integer that can represent multiple ty= pes with tags defined by Lisp=5FType. If the tag is 0, then the type is a= symbol. In that case you would treat the rest of the bytes in the Lisp=5F= Object as pointer to a Lisp=5FSymbol instance. However if the symbol nil = is defined as 0, then it is not a pointer to anything. How then do you ac= cess that symbol=3F Is there special case code to handle the null pointer= =3F

I hope that question makes more sense. Let me know where my understanding= is wrong.
On Oct 26, 2022, 10:16 AM -0600, Ma= tt Armstrong <matt=40rfc20.org>, wrote:
Troy Hinckley <troyhinckley=40gmail.com> writes:

but 0 would not be a valid pointer.

I am a confused by this. 0 is a valid value for a C pointer. This is
what NULL is, etc. You must not dereference it, but it is a valid
value.
--63595ee3_2901d82_10bc8--