From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mario Lang Newsgroups: gmane.emacs.devel Subject: Re: EIEIO default constructor function Date: Sun, 04 Apr 2021 04:42:38 +0200 Message-ID: <87ft06bwip.fsf@blind.guru> References: <87y2e0rppp.fsf@blind.guru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12203"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.50 (gnu/linux) Cc: ericludlam@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 04 04:44:12 2021 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 1lSskF-00035n-AZ for ged-emacs-devel@m.gmane-mx.org; Sun, 04 Apr 2021 04:44:11 +0200 Original-Received: from localhost ([::1]:36380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSskE-0000vu-C4 for ged-emacs-devel@m.gmane-mx.org; Sat, 03 Apr 2021 22:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSsjS-0000Vf-LY for emacs-devel@gnu.org; Sat, 03 Apr 2021 22:43:22 -0400 Original-Received: from familiekainz.at ([37.187.20.171]:51604 helo=ns3035380.ip-37-187-20.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSsjQ-0004X9-FR for emacs-devel@gnu.org; Sat, 03 Apr 2021 22:43:22 -0400 Original-Received: by ns3035380.ip-37-187-20.eu (Postfix, from userid 110) id E500F56; Sun, 4 Apr 2021 02:43:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=blind.guru; s=mail; t=1617504197; bh=yDqSrV5C9KDwU7Ewh40yCjOBeYYfT1R06yUo6rKP6Dg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=AIEuLTHx+0op/z7eLvtPOto66LPmr9rsv5ugquK4hqx9IwJfW0N89SjumrRg5RvmX zim/ZKItJLTS8A4ubyuLwbh169+rmKsy2c76doygJIDrK6WkuUDwpbVr+PoWMIjsIO IK6eHpbVYU7Au/NquIZMuM+vsen8VN0iBDFLTfv4= Original-Received: from x1.blind.guru (84-115-55-45.cable.dynamic.surfer.at [84.115.55.45]) by ns3035380.ip-37-187-20.eu (Postfix) with ESMTPSA id 45E543E; Sun, 4 Apr 2021 02:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=blind.guru; s=mail; t=1617504160; bh=yDqSrV5C9KDwU7Ewh40yCjOBeYYfT1R06yUo6rKP6Dg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=E1prOJigCLwHojn9mffde0KsaK2zskjjDb6wDEkEFPcO0yoMD+FiRRCJ5EWZAer+I BAeJ3C60fTEuAqvWXmob/sahjuDnWyE58LpcL/8TGYcacsq1YrdLcJ70BGYubKq4Nh aXCQ9Hg/EImfIMRAfNekX2jerKCr443SVAiQZy3o= Original-Received: by x1.blind.guru (Postfix, from userid 1000) id 18A3BE80CD5; Sun, 4 Apr 2021 04:42:39 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Sat, 03 Apr 2021 09:48:40 -0400") Received-SPF: pass client-ip=37.187.20.171; envelope-from=mlang@blind.guru; helo=ns3035380.ip-37-187-20.eu 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, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:267375 Archived-At: Stefan Monnier writes: >> So my question is, what is the rationale behind *always* creating a >> wrapper for `make-instance'? > > You'll have to ask Eric Ludlam ;-) I guessed as much :-). I should probably have put him on CC. >> Could we perhaps add some sort of >> class-option to disable the wrapper creation? > > We could, yes. I suggest you `M-x report-emacs-bug` so we don't forget. > Ideally attach a patch ;-) If a patch is welcome, I might look into that. > We may also want to make those constructor functions conditional on > `eieio-backward-compatibility`. Oh, that is a good idea. According to my test, CLOS does not create a wrap= per by default, so hiding that behaviour behind `eieio-backward-compatibility' seems like what I would want to aim for. > You might also consider using `cl-defstruct`, which > doesn't suffer from such problems and is lighter weight. I was actually trying that at first, but it turned out I need inheritance based dynamic dispatch. So I am actually very grateful for eie= io being merged into Emacs proper, `defclass' *is* handy if you need its power. --=20 CYa, =E2=A1=8D=E2=A0=81=E2=A0=97=E2=A0=8A=E2=A0=95