From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: question about Qnil representation Date: Thu, 27 Oct 2022 08:45:32 +0800 Message-ID: <87eduu8577.fsf@yahoo.com> References: <5a560265-fa81-42d2-945b-ab85d72df9e6@Spark> <5a00e93e-5f44-4865-aeeb-51f0aced9996@Spark> <8335bao9rs.fsf@gnu.org> <5d85a71f-500e-43c7-a1fb-47ffe8518d94@Spark> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38827"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Troy Hinckley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 27 02:48:38 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 1onr4X-0009vQ-Ve for ged-emacs-devel@m.gmane-mx.org; Thu, 27 Oct 2022 02:48:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1onr1o-0001Gc-95; Wed, 26 Oct 2022 20:45:48 -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 1onr1m-0001C1-04 for emacs-devel@gnu.org; Wed, 26 Oct 2022 20:45:46 -0400 Original-Received: from sonic311-25.consmr.mail.ne1.yahoo.com ([66.163.188.206]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1onr1k-0000tr-8e for emacs-devel@gnu.org; Wed, 26 Oct 2022 20:45:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1666831542; bh=Y1llfTgePqBFKUUFTfgxV+1q230enkQs6aWHT70wXL0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=QhQHpi/8Nr59LJSCFh0RmKV/WPz/V4RrmvRB71n/c/Km3zzYhDjubR58QwABRm1bI/p7ehDNBrzOEAHwGZzlWSehT4gvYnjbtrgWKtDoRGY8+S7znQKyw6uuLCR+wF8wMX543/jPDKyy/f2v2MxXVR1VPZopI7gWv8QeJqTGr7cyqYchFhBiRBlYhaB61iFgSDwWmb/m1k1vtQ8Ve/n5QLM+j98WIvkd32JHDDiai9DYnfPBuMi4X7nwJcAcg/+SVikOydvpEUiLIMK4ooenhOwMh6y4ERvT8L2Ki2SxCWtzaPYUTTxu7Y1hRQ2raBpOAgGeEtYpRrpEgidHYpcYLg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1666831542; bh=4LgLVCC6LsSfQc7d8rWZcREV24vGO5c2s/QRW5iO5Aa=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Of0CiJMOkpK3Tg5u4yh0BnyoajxFaWD3hE6RefoeucY9iZcRsnbynt37oU1GQOZewoxrhElfCOL2rRn1qa5CaCUx5mcr/b9AjaIo8toWq3iWhaxpXDZt1Gdsvmv3Ys1HYA/xy9OHWsbfS4ASO8ZvP+C45+ZmB7FwIdai29cU7V9cWGmxEoR5++008ayg3OYV1vaFI9bcyap25fFDMQBHVlXD/EjoPRCe4dmEKw+txOSF9sDi5AKAmGpENn6gzzq2b0r3iniltVRI6rAfk6hTkFUWd1HTzACopmKEniq81GA+6gaspaxJsetWsONaMSN60WTaTLAtAV09sB2+2K7nkA== X-YMail-OSG: y_J.vEoVM1kHV.i7sC.iilnmg5iHw8TRG1PRe3ki4_ZCHsblt3GAmn2PIGuTe.U R1Yu5VOPaVACwxZcWPQpQch3ZPs2sQxhQSNkucIB_ynq3Avu9X7XIFbmJBSyQvnR6cbvxwSlc8qY bXeGcuxqB2Vn1F5wGf2X9V9peKRlHkjLaBRQPH2jklpU7pgZzjTIbW7VAt9xltN00XoW49003jPy hNGF7kbXPc.jtW.0z1al91xHFmA6BOAsci2T5pP5mKLuC3pbKlSE.XzuuWhWbN0p7.4mLiZ95Ckx tLFOjASgcDYabWnDcx.laBzF0001Uh_ZuD7lrMCztdpV.3W40e2x0ZtSJoU.1357upo0khvRZtsN a3tUXe8xHf7GA18yoBKPzFmi.GPEtcMfwx37Wy3ezCNnce4q.q7BCWX5fEnY_Q0yu1zAo5WYLWya wr6iPXfNL_yS.ibSaJCoQptuWPrICDFLcHthCF7tF8nkH.fZW9jkGsvt7uVTuzwYbS92xnAeMOAs 4fINAUpx3QLbhYUHgwVbUhJx0g7pB_g0k9MjUjaNkhYkkKLWhCTq1J_Frg5PAGW45ltWBbcRF2d6 YgagBeYL0Noq3gad1McA1.lN_t94Z6TvIduZ1kz6ASwkWPExqjjGp.E1WfyWlGwqh62vXTbN7Vpp WqgPKW.7PxIG5t0Fy_v9_d339BEECZBE2vU7bh.ulJwg68h3.x3wKfPhKDYOK9SccpY3VDUwVK55 mLYwIIAPWyTabbynCih6terfFXBrB0AvGgKAcygFO3rivL.0vULeTSq8yCd87xEmV0zZNh137Bz4 ZdS1U84jRay9n0wT8.miLDOdjRJsLBzD3M51S4yfAB X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Thu, 27 Oct 2022 00:45:42 +0000 Original-Received: by hermes--production-sg3-74fb94585-wlrr8 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID a8ea089c8d4bee67e1b4bcda7294f7f6; Thu, 27 Oct 2022 00:45:37 +0000 (UTC) In-Reply-To: <5d85a71f-500e-43c7-a1fb-47ffe8518d94@Spark> (Troy Hinckley's message of "Wed, 26 Oct 2022 10:04:47 -0600") X-Mailer: WebService/1.1.20783 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.188.206; envelope-from=luangruo@yahoo.com; helo=sonic311-25.consmr.mail.ne1.yahoo.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:298587 Archived-At: Troy Hinckley writes: > Sure, but it reinterprets the integer as a *Lisp_Symbol to get at the > actual struct correct? No, Emacs never reinterprets Lisp_Objects, as they have a tag. > Or am I misunderstanding how this works? Yes. There are several tagging schemes used to associate Lisp_Objects with their types. Usually, if a platform can provide the proper alignment requirements, the least significant 3 bits of the word type (configured at build-time) are used to a tag containing type information. After the tag bit is removed, Lisp_Objects are either pointers to the corresponding Lisp_Foo struct, integers, or symbols, which are actually offsets from the start of the auto-generated `lispsym' array in global.h. The first element of that array is nil, and the tag bit for the symbol type is 0, so XSYMBOL naturally returns the correct `nil' Lisp_Symbol for the integer 0.