From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by sourceware.org (Postfix) with ESMTPS id D89423858D28 for ; Thu, 30 Dec 2021 08:52:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D89423858D28 Received: by mail-io1-xd2f.google.com with SMTP id p65so28896502iof.3 for ; Thu, 30 Dec 2021 00:52:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I3qbXfPHJw/KBxNCLTGL54FTYFWjY9LiidaQC+XQcww=; b=fxQdWPFHgg99t+Iwz7zwO68N5Rwv2rGwJkSc1KfdpOdwTq8iTU+7qZV2OZ1/liJXpL TuX9tUvvRKjlnROR0guV3pmOIK2UBOytg2vsUE/4d2nZWIYUp4Q9uH1uCUZbV3nlv0Tb aHmJ9qa1/Isx8ykCsSkEtm5H4jIhIyEfJp/j6dO0mpR5tSpH7h9YylxjF2jHNS4KNJwT lZ8cTV4zaarTuzaoEfFyVJr5lIPWSRdXYAH1dyKPHspyiYPght0rUxNcrhoCS1I/iAR7 ZFIbdaDNIa+VO0Qat6rEL13PICB7HtmgYUsfi7oU3X+GYuKEBug8lZfr7FPucSlVLWUm roNw== X-Gm-Message-State: AOAM533RiNT7s1DSuaFHQvGvRLjMpwe1hkmiN+79yslojNK6MdgducnA rkHyiJd+eBwHAJgH/Rhsmh391/GvDX7htHrzLGqSq30gGME= X-Google-Smtp-Source: ABdhPJzA8SBC/2JFOgI4FGnKKrHUYoANMvnHsUxgfE+35YUpWMOIfLdw4qK7K+pd+/G1vukegI1F97xvvQuTAwg5G/w= X-Received: by 2002:a02:b384:: with SMTP id p4mr12563199jan.167.1640854344171; Thu, 30 Dec 2021 00:52:24 -0800 (PST) MIME-Version: 1.0 References: <010e9c97-43ad-475e-576b-1f69a140d219@bothner.com> In-Reply-To: <010e9c97-43ad-475e-576b-1f69a140d219@bothner.com> From: Panicz Maciej Godek Date: Thu, 30 Dec 2021 09:52:12 +0100 Message-ID: Subject: Re: Type information seems to be erased in macros To: Per Bothner Cc: kawa@sourceware.org X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Dec 2021 08:52:26 -0000 Hi! Thanks for quick reply! czw., 30 gru 2021 o 00:30 Per Bothner napisa=C5=82(a): > > > On 12/29/21 14:12, Panicz Maciej Godek via Kawa wrote: > > Does the macro system erase type information from objects? > > Not in general, but it is possible that a compond name > like screen:translate! might not survive the macro-expansion process. > > The --debug-print-expr flag may be useful to see what is happening. > It prints out the syntax tree after name lookup and macro-expansion, > but before type analysts and optimizations. > > It you post a short self-contained program I can take a look. > > Actually, this turned out to be a trivial mistake on my part -- the name "screen" wasn't visible as I thought it was. > There is a good chance you might have better luck with: > > (invoke screen 'translate! x! y!) > > That should avoid any issues with compound symbols. > > > If I add explicit casts in the macro, is it likely to cause some > > performance penalty? > > Almost certainly nothing you'd notice: Probably just an extra checkcast > instruction in the bytecode. Which means some extra work, but pretty > minor. > > If end up needing run-time reflection (which is what you get if > you ignore the warning), that is a lot more expensive. > > Thanks, that's good to know! BTW I've been working on a touch-based Scheme editor for Android called GRASP, and I managed to hook up Kawa to it, which gave a nice effect: https://www.youtube.com/watch?v=3DoOHg74HYau4 I also gave an overview of GRASP during this year's Scheme Workshop (before integrating with Kawa) https://www.youtube.com/watch?v=3DFlOghAlCDA4 The source is available here (the structure of the repo is a bit tricky, so I can explain it if anyone's interested) https://github.com/panicz/grasp-android Currently, I am in the process of rewriting GRASP to Kawa, because I find it much more comfortable to program in. Thanks again!