From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Test your ELisp knowledge Date: Fri, 9 Feb 2024 11:29:39 +0700 Message-ID: References: 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="31237"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 09 05:30:44 2024 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 1rYIXE-0007z9-Ti for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Feb 2024 05:30:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYIWR-00014M-3p; Thu, 08 Feb 2024 23:29:55 -0500 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 1rYIWQ-00014D-4t for emacs-devel@gnu.org; Thu, 08 Feb 2024 23:29:54 -0500 Original-Received: from mail-ua1-x936.google.com ([2607:f8b0:4864:20::936]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rYIWO-0004D9-NM for emacs-devel@gnu.org; Thu, 08 Feb 2024 23:29:53 -0500 Original-Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-7d2e1a0337bso236063241.3 for ; Thu, 08 Feb 2024 20:29:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707452991; x=1708057791; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=aAA28xnZ+z6fRRIcfrRmp1rCcQMTQhpGWDPvQQdoyFY=; b=OR3fvIii1uDUxRZO2lZkVVZ2Y8emE9YMHZjSFDxiSrIrxRTv84gT13DNDzCwg65BR+ VsWRwGtC8OMyNp4WE7vRpWAPVL1VE6QMbwKF2MoNL0yT43P82VQgEvGJtCvcNXqO5ckR +8lr8Tp0r56v3sDhSrcB8UboPnfF453pdNqWx0/iKubz6TKCvi3q8RRBK21rTouKAfmc avkZ75KVLR5AaQJFVr1Z5Nazy9RTJ5braffFk5uoj9QFNWHYSAIaY5rDf16HYJeKrfs6 wihQe3r5R6AgPGq624Lm+YbcGVmisMjKqWeLpX9ErvyLnKeBzKlfDyx5Hs1leMQaOTYg ei/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707452991; x=1708057791; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aAA28xnZ+z6fRRIcfrRmp1rCcQMTQhpGWDPvQQdoyFY=; b=nlmUzaWYq/pgd4o6ot8RVUDbkw9jy6lOOqB170Ons32bQaYZDsVhHXTyglLmJ+2KSB GxJdyawM2KjfbtNRTtdxv0H3PyByCLivuRw1z1XofAxnxLsM7jP9pnq9dUOl9pjSrkzP 1WbPa3I4ggpUb+IJZlrRhSCUzijA4h+lfWgi0+rfCzMKINrV1OfiJ/n/eglxUaniaWuo VP/v6tneauhdUDR0tsK3PrlFNipfybF6Y4fJN6UsufUDNTA6hyN6tF8Kmf0hBntC6NAD EyoouOa2ux7Q2JvE1vuKo0thyMeiV9WnMPFlMX1rLUR4ryQuUGb/2p6SyJ9EM6bfBe/j flow== X-Gm-Message-State: AOJu0YyEF3lj5rfIRIlOh4xioacXy1j+2P0VOIzPo/XVfvuTRcnY/F31 VrkPu4MvysVNgbX+NH82ovwxpIZxEbSHNHsLJC0b3tVh4gnMsYHYiB+NHkevwZfhJURw6CjHcbB RvY4JP/PJTD73EO1f88TwUQrOI98= X-Google-Smtp-Source: AGHT+IFQQIh0eelhmvJTOjT9BC6EoLU9GAt4NMaokvnn97s6hgkGutztmVa2MPStKojV/pKJws4/CiRcwM7YGdA6HUE= X-Received: by 2002:a05:6102:3131:b0:46d:6506:ce41 with SMTP id f17-20020a056102313100b0046d6506ce41mr283237vsh.23.1707452991214; Thu, 08 Feb 2024 20:29:51 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::936; envelope-from=yurivkhan@gmail.com; helo=mail-ua1-x936.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , 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:316062 Archived-At: On Fri, 9 Feb 2024 at 09:53, Stefan Monnier wrot= e: > Here's a test for you: without trying to run it Does putting myself in the shoes of a Lisp interpreter count as running? > guess what error will > be signaled when you do: > > M-: (their-fun (/ my-x 0)) RET Something about their-fun not having been defined first. Because if it is, my next step depends on whether it=E2=80=99s a function or a macro. If it=E2=80=99s a function then the next is that my-x is not defined as a variable. If it=E2=80=99s a macro, it might fail on its own, or decide not = to evaluate its argument as a form, but if it does, then same behavior as with a function. Otherwise I guess it comes to the division by zero, and that=E2=80=99s the real question? I guess the result would depend on the type of the value of my-x, possibly not failing but yielding a positive infinity, negative infinity or NaN for floats? Otherwise, for integers, I=E2=80=99d expect a division by zero error; for non-numeric types, a type error.