From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Taylan Kammer Newsgroups: gmane.lisp.guile.bugs Subject: bug#48448: 'procedure-name' returns #f if name is #{}# (the empty symbol) Date: Sun, 16 May 2021 01:33:00 +0200 Message-ID: <1ee0f4ed-5b13-854e-f95c-66bf11cc33d9@gmail.com> References: <1b56d817814d4d1fa08e70578d4aebac909b0aff.camel@telenet.be> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14844"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 To: Maxime Devos , 48448@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun May 16 01:34:14 2021 Return-path: Envelope-to: guile-bugs@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 1li3nR-0003dJ-RS for guile-bugs@m.gmane-mx.org; Sun, 16 May 2021 01:34:13 +0200 Original-Received: from localhost ([::1]:43812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1li3nL-00077e-3K for guile-bugs@m.gmane-mx.org; Sat, 15 May 2021 19:34:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1li3nG-00076Y-UA for bug-guile@gnu.org; Sat, 15 May 2021 19:34:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1li3nG-0005yo-Lj for bug-guile@gnu.org; Sat, 15 May 2021 19:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1li3nG-0003CO-Hm for bug-guile@gnu.org; Sat, 15 May 2021 19:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Taylan Kammer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 15 May 2021 23:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48448 X-GNU-PR-Package: guile Original-Received: via spool by 48448-submit@debbugs.gnu.org id=B48448.162112160612249 (code B ref 48448); Sat, 15 May 2021 23:34:02 +0000 Original-Received: (at 48448) by debbugs.gnu.org; 15 May 2021 23:33:26 +0000 Original-Received: from localhost ([127.0.0.1]:49402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li3mf-0003BU-3a for submit@debbugs.gnu.org; Sat, 15 May 2021 19:33:26 -0400 Original-Received: from mail-ej1-f44.google.com ([209.85.218.44]:45864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1li3mO-0003B2-7K for 48448@debbugs.gnu.org; Sat, 15 May 2021 19:33:24 -0400 Original-Received: by mail-ej1-f44.google.com with SMTP id s22so3554843ejv.12 for <48448@debbugs.gnu.org>; Sat, 15 May 2021 16:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=0gJN7wDczvDxE2yCRjyh5Gb48dQAUmwSpy/8O/bb7xY=; b=rJLKGHMGZ1GMXi4epDT5mRWu/1xj1ucEQ0854ClmLdO4QzhDVktm3BP5t8FBhAgUIO dyxccgf56WSgv9785hWQdK1rqbcDtQFtUT9rXPJia5dC++/ch894jglMOONBMTIx+niK Aauiy1uPuDv7lYu97wheyofR9DsCMqeKaHMKtBdDTlrVyjdCp4bhyi3LW7ws7rE2Kmff qi+SDpKRwz0BH1QbTfMv5PPaVDQRgAxwmQ2BhU6D5YAV6VMg2ChBPUlHXt47A6G1vYuz KezsWJbltg1ukXwdjDsW3nfi7/9ckCm+kwxhOU+q4Kg27m1Mz0IY7EiVO3k9iFPEkQax PXVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0gJN7wDczvDxE2yCRjyh5Gb48dQAUmwSpy/8O/bb7xY=; b=CxY1lLrQy9gS8cPXaVeWPO/swmEu9z5KCoOytwggMDVgVa51mXN6i/lzVno/NiUhcz AzW3g0DcP59YTR6h5obHLrIOT0Lxgy216oWwYlnhioYsZzU4h+M2lFhe0+VvIjpuOuS6 DIHmjZS0H6fdi2yMVm6R0Hl+Q9s/2sdnqO9KlOzDTpOfJ4ZZ0c2svF9vSKlVu938w4fz Y8bCObxBoj9uXOFLpgEaqmnNp6gK7lCq9QG+jxZItrzVYkuyTRyUrsvE5iB4S4FKkIOq QuTdgd57ROSxOVmxhdlidvnmgJ/URMBcYMO4eNJinrmcUqX0eEp1B+anJm+M5rBEIJOQ Kvcg== X-Gm-Message-State: AOAM532Tp6jQllQjw4gAB582dhKOMkaA5FuOILLbnVAn+MnBkFLJmyLT 4HIerb2WjpgU0CBHTUX0JCax6JbQoHoOiA== X-Google-Smtp-Source: ABdhPJypWN1UP//7jfS5fVV2DW+SEGOjv8aNDyk16JfyMDmk0f3WMb3AzeKX52auyYoe3x+rFbOsAA== X-Received: by 2002:a17:906:e105:: with SMTP id gj5mr56299291ejb.388.1621121582407; Sat, 15 May 2021 16:33:02 -0700 (PDT) Original-Received: from [192.168.178.20] (b2b-109-90-125-150.unitymedia.biz. [109.90.125.150]) by smtp.gmail.com with ESMTPSA id cf19sm6087977ejb.24.2021.05.15.16.33.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 May 2021 16:33:02 -0700 (PDT) In-Reply-To: <1b56d817814d4d1fa08e70578d4aebac909b0aff.camel@telenet.be> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10067 Archived-At: On 15.05.2021 20:27, Maxime Devos wrote: > guile --version: 3.0.5 > In a REPL: > > (let ((#{}# (lambda () 0)) (something-else (lambda () 0))) > (map procedure-name (list #{}# something-else))) > --> $20 (#f someting-else) > The problem seems to be that once the compiler produces bytecode, there is no distinction anymore between a missing name and a name that is the empty string. See the procedure link-symtab in module/system/vm/assembler.scm line 2345. For every piece of metadata (this includes the names of procedures), it puts it into the string table, and conflates a missing name (name = #f) with the empty string: (string-table-intern! strtab (if name (symbol->string name) "")) I'm guessing that changing this would not be worth the effort, although this isn't my area of expertise. (I spent more than an hour trying to figure out the source of the issue, though it was a great learning experience.) One could even argue that if you name a procedure after the empty string... it has no name, right? ;-) I'm marking this as a minor bug. -- Taylan