From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 10:30:00 2021 Received: (at 50349) by debbugs.gnu.org; 4 Sep 2021 14:30:00 +0000 Received: from localhost ([127.0.0.1]:48347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMWgC-0006SH-14 for submit@debbugs.gnu.org; Sat, 04 Sep 2021 10:30:00 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:46847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMWg8-0006Rp-PN for 50349@debbugs.gnu.org; Sat, 04 Sep 2021 10:29:57 -0400 Received: by mail-wm1-f51.google.com with SMTP id m25-20020a7bcb99000000b002e751bcb5dbso1491532wmi.5 for <50349@debbugs.gnu.org>; Sat, 04 Sep 2021 07:29:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bb6pH1j/rp/E3UEBUIYCqusd/6L5a0LqCZZvF7Iifr0=; b=kKe+0n6NJQDIoHDbDTx4l+DAFpt3gmTcmcjF/QSjZzZR+3gQWouua6l7iGkN5ewwX+ xoXq4USA9gl+MBa/qoa6HzY3xSEVjC8wxLxA6GVtpCQcMnDwmzCTW0Mv5RkownsR+8aq EeAUyBVfzmLSNdEIZnxmCcDGi7G+oNXCiIE1RXRQPJ308MVe1vNLhi0amqxq4SVQ7VYT hn/l0PRoXtpLOSwc/tGnI3ePWGeEPKOCZnNy6ptKP9Q0T5Gk4ThhEurLP4+XM7ZI3SqK vzfIrmBYeuiuaAZoz7ymgStyQ4L2rd3BlNK20LcXENo2Dm14RD/vbpkqY1L6qZtvMbkR 5FfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bb6pH1j/rp/E3UEBUIYCqusd/6L5a0LqCZZvF7Iifr0=; b=Lzx3E3rjrkwi4sW+UlWgrhYG2UvL/ViRcs188LVBQzrfTEpuxQQbbMgmzKpmSfrTW6 StPBjPzAiJFKC76AWeMomchDAaUiTnfUbZxVL7/EjcTOG7soUqLxiFaLc563eVyzaHDs vd9VW5sSVTiQeTFgRQ13g9vCFUpSquq/nxyiKPk2m+/rZilL4zx9bp+bAwcyoCty/Ngg 1l04xb2G1ECKlq1LmrHRcYSv6hO2P8Szy7Zic5MYewYpFoJWndyGLvHx53N2d+uzrRC3 A56grl+tYqsxWWjLRunXbtGMYQ0pYaRvt4XeRveCDcyAvBhBGAo7k+38plbVMFuyzYAm RMJg== X-Gm-Message-State: AOAM532pBpCXOIwiOMWKus+mgMzW/36udd8ajbwxX7Vg67S7Nk8hwjsF 9Q4SPq2zDgpOFlgl3bd6TCA= X-Google-Smtp-Source: ABdhPJxVKuzVP9tPPdazt4w9o/XzIfKFmXKxucl1353lpp3xCYeshj5ndzAVR4AlAIrOXG7xiTMX7Q== X-Received: by 2002:a1c:7e12:: with SMTP id z18mr3572409wmc.60.1630765790734; Sat, 04 Sep 2021 07:29:50 -0700 (PDT) Received: from [192.168.178.20] (b2b-109-90-125-150.unitymedia.biz. [109.90.125.150]) by smtp.gmail.com with ESMTPSA id v21sm2406752wra.92.2021.09.04.07.29.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Sep 2021 07:29:50 -0700 (PDT) Subject: Re: bug#50349: [PATCH] packages: Add 'define-package' syntax. To: Tobias Geerinckx-Rice , Maxime Devos References: <15d01b32313f5f2f291b120597719ae92bd26acd.1630639896.git.iskarian@mgsn.dev> <757b7543b931335c3725264edfbc79c012aa10fc.camel@telenet.be> <87y28caazy.fsf@nckx> From: Taylan Kammer Message-ID: <95c92fc5-1fcf-b347-370e-d1943f22c2c3@gmail.com> Date: Sat, 4 Sep 2021 16:29:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <87y28caazy.fsf@nckx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 50349 Cc: Sarah Morgensen , 50349@debbugs.gnu.org, guix-patches@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) On 04.09.2021 12:09, Tobias Geerinckx-Rice via Bug reports for GNU Guix wrote: > All, > > To keep a link with previous ‘define-package’ discussion, I've merged this bug with #15284.  It was never resolved IMO and things have changed since 2013 with the label-less input style. > > Maxime Devos 写道: >> This could be even shorter in the special case that the variable name >> and package name are the same (modulo types): >> >> (define-package "my-favorite-package" >>   (version ...) >>   ...) > > (define-anything STRING ...) is just too weird to ack.  Are there any package names that aren't currently valid symbols?  Is there a good reason for them? > > Kind regards, > > T G-R To me the most obvious thing to do seems (define-package foo ...) ;no explicit name needed to bind the variable 'foo' and use symbol->string for the name of the package, with the possibility to override the name like (define-package foo (name "foobar") ...) which would bind the variable 'foo' to a package named "foobar". Here's a syntax-case definition: (define-syntax define-package (lambda (stx) (syntax-case stx () ((_ ( ...) ...) (if (memq 'name (map syntax->datum #'( ...))) #'(define-public (package ( ...) ...)) #`(define-public (package (name #,(symbol->string (syntax->datum #'))) ( ...) ...))))))) -- Taylan