From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.devel Subject: Re: question regarding my emacs package Date: Mon, 12 Jun 2023 18:22:25 +0530 Message-ID: References: <6cG8Tc55Zz8xk6rE6mJLfDxckAINPcYqp781yltsndzqq5146yw76EZ_2CoUtQT4P2j2afSx5VRD5G1-9qzFHWAW3LxYWwmxh87lvB2MgNE=@rj95.be> <873533mfq3.fsf@posteo.net> <87y1kvkv2f.fsf@posteo.net> <2pOYRsmOk_f2sx48BICCjf9r3Z5OviLDonOFi4dhWoSpd_dAWOXFSA3jO2YeyJ5FBf-Sydd0ZTzTOsAlIg8tc_eBqM9nzq2PW4q4usn4Nuo=@rj95.be> <87ilbzkq9y.fsf@posteo.net> <877csetnwy.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29027"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Cancel-Lock: sha1:DGxEf+En1CcV5sLMRAU9BLaA1SE= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 12 15:12:58 2023 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 1q8hLu-0007LB-8h for ged-emacs-devel@m.gmane-mx.org; Mon, 12 Jun 2023 15:12:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8hLc-0008Ev-QS; Mon, 12 Jun 2023 09:12:40 -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 1q8h2I-0000G7-Tj for emacs-devel@gnu.org; Mon, 12 Jun 2023 08:52:43 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8h2H-0005Jv-B9 for emacs-devel@gnu.org; Mon, 12 Jun 2023 08:52:42 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1q8h2D-000AUh-1z for emacs-devel@gnu.org; Mon, 12 Jun 2023 14:52:37 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 12 Jun 2023 09:12:36 -0400 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306747 Archived-At: * Madhu : Wrote on Sun, 11 Jun 2023 17:11:21 +0530: > [Question about cl-defstruct] > > > I tried loading the file from github on emacs master and it fails when > trying to compile > > ``` > (defun breadcrumbs--drop () > "Track the buffer position as a `breadcrumbs--breadcrumb'. > > If this has already been tracked, move an existing one in `breadcrumbs-ring' to head." > (let* ((breadcrumb (make-breadcrumbs--breadcrumb)) > (index (ring-member breadcrumbs-ring breadcrumb))) > ``` > > > with > ``` > Debugger entered--Lisp error: (wrong-type-argument stringp (buffer-file-name)) > make-breadcrumbs--breadcrumb--cmacro((make-breadcrumbs--breadcrumb)) > apply(make-breadcrumbs--breadcrumb--cmacro (make-breadcrumbs--breadcrumb) nil) > macroexp--compiler-macro(make-breadcrumbs--breadcrumb--cmacro (make-breadcrumbs--breadcrumb)) > ``` > > The cl-defstruct slot has an initform "(buffer-file-name)" which seems > legit since it takes an optional argument. > > However when I change the form to (buffer-file-name nil) as below, it > loads > > ``` > (cl-defstruct breadcrumbs--breadcrumb > (buffer-file-name > (buffer-file-name nil) > :documentation "The file backing the breadcrumb.") > ``` So with my emacs-30 nativecomp this just doesnt work. the buffer-file-name slot of the cl-defstruct has to be changed to buffer-file-name-1 (and the corresponding accessors to breadcrumbs--breadcrumb-buffer-file-name-1) throughout the file. Do others not see this limitation in the compiler? > Common Lisp has a problem with the interpretation of the lexical > scoping of the initforms. C-h f cl-defstruct doesn't impose any > conditions on the SDEFAULT form. Are there any guarantees or > limitations on the forms that can go into SDEFAULT