From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.user Subject: Re: Guix records Date: Wed, 10 Feb 2021 13:11:39 -0800 Message-ID: References: <87lfc2e9vn.fsf@clara> <875z30lqa7.fsf@clara> 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="9338"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Olivier Dion Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Feb 10 22:17:26 2021 Return-path: Envelope-to: guile-user@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 1l9wrW-0002JF-4h for guile-user@m.gmane-mx.org; Wed, 10 Feb 2021 22:17:26 +0100 Original-Received: from localhost ([::1]:60914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9wrV-0000Iu-3b for guile-user@m.gmane-mx.org; Wed, 10 Feb 2021 16:17:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9wmA-0006DM-7N for guile-user@gnu.org; Wed, 10 Feb 2021 16:11:54 -0500 Original-Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:46446) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l9wm8-0004Pt-B0 for guile-user@gnu.org; Wed, 10 Feb 2021 16:11:53 -0500 Original-Received: by mail-pg1-x536.google.com with SMTP id r38so2047795pgk.13 for ; Wed, 10 Feb 2021 13:11:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2srba4AlrKl4KLU6R34xD6nZY9ZESR+hn2+uvnu531g=; b=Zhq0tFzdKbXy4ayDYPqP7cMuKulVCG9d2EJ/JutEx3nIZlkM3JevDMrKyHmTr8IQZ3 54bedKLYWZ71TKmPLsB8uHjHldDtxJvmbH6FUEs2DEeOJGvMN0KRGel/rnUFebv/fcxg ZegLHe2SJZsaffFBNOAxyKHtWiq+0LCaYCI2TRLVGZE4NdZXUstFaAZHyWDLIJFKVbXQ PB2yiZGZrgfXTaM+jpnf8l2aX7AT934qjJJr345KhpKEMuXiWBfBuYJgIMrWgnrn7hlB cuWtchouqcxleJLgzydFiR5Mq4vyXUyL3KKmyfzHuP6ok554Q4ZkAB7KQXURWMkA1Mih vDlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2srba4AlrKl4KLU6R34xD6nZY9ZESR+hn2+uvnu531g=; b=iOf9UoyaovlyH62U9GfnEcom4srr/vrDixpvFFrVYR7TGUO11bRH3sTh8iXPbwpw4g rwmSVqtIoKiC6pgEDmm1Vm4X9/nTIMS2WFTTSqOASFfa8iHWi8D4at05EWC+5uNyU4jg 02cTGbay6sj69vuTFDr9VkDX7jEqa8Bon6Rmgm0UCsLyXScQ+lsugNnRtIPrV5uTn0PC M/ys6UwsTj5ZMAhWH59Y/Iln5oIdMyNYC8hwMgIadbeVFKTtxdhsYhI8zlihw4yzwVHZ 0c8KWh76DwQ2YN3Juzqcr9iytsM6UauANIfJyzBJm4JBPjEd2vpk/YhiHtHOxW+XNRTW XyMA== X-Gm-Message-State: AOAM5317Naa2G4qsBpuSpwhp/VDSGlByn3UwuVVblrfuETK3j/TePBFN ondjMS4hffcoearD5GQOanuMwbucF18h0xNiJDg= X-Google-Smtp-Source: ABdhPJzpHpO7zndtbTFUp2pVxsbCqcCTMIZ0yG+he+FO/Aqwhi3LZGlJn/K9p8pwvwVvlP8jNAHtj55bYUHhHeOl6vg= X-Received: by 2002:aa7:9f1a:0:b029:1de:2c09:a040 with SMTP id g26-20020aa79f1a0000b02901de2c09a040mr5192348pfr.21.1612991510559; Wed, 10 Feb 2021 13:11:50 -0800 (PST) In-Reply-To: <875z30lqa7.fsf@clara> Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=aconchillo@gmail.com; helo=mail-pg1-x536.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17239 Archived-At: On Tue, Feb 9, 2021 at 4:28 PM Olivier Dion wrote= : > On Tue, 09 Feb 2021, Aleix Conchillo Flaqu=C3=A9 w= rote: > > Hi Olivier, > > > > Unfortunately I don't have an answer, and actually I didn't even know > this > > existed, but I'd love to see a library for it. I added something simila= r > > (in terms of syntax) to guile-json (define-json-type) and I'm happy to > see > > that it seems I was not doing something very stupid. For this specific > > record it would be something like: > > > > (define-json-type > > (age) > > (name) > > (profession)) > > > > Which will define a constructor and getters (no setters). However, to > > create a new record you have to use the constructor (which is not very > > convenient) or use an alist and then use (scm->employee). But it would = be > > great if one could do: > > Is (scm->employee) something (define-json-type) offers? Just having > that would be great. I would be more tolerant to have guile-json as a > dependency, since it's most likely lighter than Guix, probably already > installed on the user system and it might me useful for users that are > allergic to parentheses for configuration. > > Yes, it is. Actually (scm->employee) is something that (define-json-mapping) offers (also in guile-json). (define-json-mapping) was originally copied from (guix json) which no longer exists in Guix, they use guile-json instead. Then (define-json-type) is based on (define-json-mapping), but yes all of this is available in guile-json. > > > > It would be fantastic to combine (guix records) and guile-json somehow, > but > > I'm not sure how. > > If guile-json' license is compatible with Guix' license, I don't see any > problem with taking the code from Guix and adapting it for guile-json. > > Yes, they both are GPLv3. I was referring about how to actually do it without breaking anything. Aleix