From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [IPv6:2a0c:5a00:149::26]) by sourceware.org (Postfix) with ESMTPS id F393A3858400 for ; Wed, 29 Dec 2021 23:30:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F393A3858400 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=bothner.com Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1n2iOv-00F9RZ-79; Thu, 30 Dec 2021 00:30:33 +0100 Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1n2iOu-000608-RN; Thu, 30 Dec 2021 00:30:32 +0100 Received: by submission01.runbox with esmtpsa [Authenticated ID (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1n2iOb-0004EY-Vg; Thu, 30 Dec 2021 00:30:14 +0100 Message-ID: <010e9c97-43ad-475e-576b-1f69a140d219@bothner.com> Date: Wed, 29 Dec 2021 15:30:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: Type information seems to be erased in macros Content-Language: en-US To: Panicz Maciej Godek , kawa@sourceware.org References: From: Per Bothner In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_SOFTFAIL, 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 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: Wed, 29 Dec 2021 23:30:36 -0000 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. 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. -- --Per Bothner per@bothner.com http://per.bothner.com/