From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:1008:1e59::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WGm7MgUhfmXw4AAAkFu2QA (envelope-from ) for ; Sat, 16 Dec 2023 23:13:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id gL+SLQUhfmVHgAEA62LTzQ (envelope-from ) for ; Sat, 16 Dec 2023 23:13:25 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=PjbdXYc2; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1702764805; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kpu/zCl3zA2yD2mFDY2rhIMz08zxjTxLO/EP6ueXmfQ=; b=Qp6jYuMAWz4QTrXosvG2Yx/tuLOnUlCSJHwaiXwH3Cq9vpylnz+iWP6Onko0oYGb7iqOFF COIPhDacCgCUi1JoIwzlYrIEfj0b66Qk3B42Cmh8Vvxf229YEoJH4PkmKhUXeXdRFJcQHh QWi/QeKp83qOZu1FeXdCOYm7hJPSEAu9cVnuSA2LD+EIGw6QF0nXc7CmXyVEpY677qx1o8 /Ye8p/jwFypXLCP5aAvoYUqrz40Ki6U2YXnrMUg4e6JJlCLIQRst8dLx2Nlctk794rSFDI pJmYLCnTsux1wiNTU4bf2raQQku7YSbkMbDxvT4R45V8R37m21U1eNBIu6YqZQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=PjbdXYc2; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1702764805; a=rsa-sha256; cv=none; b=A/5lziFHnLRJrNLtvlTY3dhdBoJbfrpQDlOl6O1tMrNb1DmwpgadHUNGR0OnjQbIsjO+qw sXj2zAYSoU0ZWv+QkiR3k2kkaQqJCrXbDhhiYj3aaVXcYwda1Dp+4oiVg+BgoYAujgM5Ai MsXy2jjT1jcuDqBaKnDbKbi3NTDMaFJMdLG478cXBwTzZrnc4PFa9n9LrySNqtBIWwx0Zr BReyG7IyC2ccioo4RhrYErYCp6eMtD5khuDBqJecTgLPNYpbpJyHjTLZQkHODE6ndaC7sh v5rkB242SX5eYdwbdsLF2bLWd9oTdjqri2H+WAOP3YlIjdDzwp5xJJoJK3GY+Q== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7C67A36FDB for ; Sat, 16 Dec 2023 23:13:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEcu7-00052x-Sm; Sat, 16 Dec 2023 17:13:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEcu5-00051s-QS for guix-patches@gnu.org; Sat, 16 Dec 2023 17:13:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEcu5-0001VC-IM for guix-patches@gnu.org; Sat, 16 Dec 2023 17:13:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEcu6-0001kp-B8 for guix-patches@gnu.org; Sat, 16 Dec 2023 17:13:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67842] [PATCH 4/4] services: mympd: Refactor serialization process. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Dec 2023 22:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67842 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Bruno Victal Cc: 67842@debbugs.gnu.org Received: via spool by 67842-submit@debbugs.gnu.org id=B67842.17027647816735 (code B ref 67842); Sat, 16 Dec 2023 22:13:02 +0000 Received: (at 67842) by debbugs.gnu.org; 16 Dec 2023 22:13:01 +0000 Received: from localhost ([127.0.0.1]:56239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEcu4-0001kZ-JF for submit@debbugs.gnu.org; Sat, 16 Dec 2023 17:13:00 -0500 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]:58423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEcu2-0001kL-8E for 67842@debbugs.gnu.org; Sat, 16 Dec 2023 17:12:59 -0500 Received: by mail-ej1-x641.google.com with SMTP id a640c23a62f3a-a234205785dso13564166b.0 for <67842@debbugs.gnu.org>; Sat, 16 Dec 2023 14:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702764771; x=1703369571; darn=debbugs.gnu.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=kpu/zCl3zA2yD2mFDY2rhIMz08zxjTxLO/EP6ueXmfQ=; b=PjbdXYc2ckaRirTTyLF9etgiO+8VlqNPgIEh5HBiL7FA2dYKsyVM8ZKp7pW889vQoB C1aILVeU2bKqSV7lyddrayP77yvsBUBKJrygy+EgjWtnnhUw49AcMct6raRhT5e7/ZW+ N8OKIIrzPcnG9qNKk15giEPKk2r2A1ly0ltiQ3b8ZB3wkjuS+EpeXf5aANBDUD24v1I/ xkqsSr/Xdl+MdBRTxKExojNkUqFGOti71nZHetgUcJ4Qnjad84Obu7X73m9XQg/L4UNg K3TNQcbd/jmOu21aR2NWh5vipw84sUq1RwcZfQZACZ3FKnVPifmmMZAHpO2aqJHHWn9O i6ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702764771; x=1703369571; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kpu/zCl3zA2yD2mFDY2rhIMz08zxjTxLO/EP6ueXmfQ=; b=a1e4gOUF8T6EQu1A9uF5v8nFsFkZsOAwZS/RGO0a2W+Nd56qRlW7C9o/5O+HcCJDfO WizOlbd6Xuxro/5zV8s9pkp3MPj+S5Z0r3terbr1XLjhEB9XewYxUNR/d4xqEyNXU1xp W2NmD/AtoV0nVD7HUp+FzyWKLUkGxu0FZ0t1Er/U0DTNmCwPOq4zJIPkRHbPKf+Qyn5u nWXmjJ7d8rA3sUROqPE2JODxJHVp75NXKTDY12HmQpjPKlsehryrfSSeG+0dWSaA771C yFb6T8rgwi8B+/gGREEnYxbH8TbqmwuJk2LyOp48lAhA2md3Dr8HO4cxDZhwMS4Cb+AU /nFg== X-Gm-Message-State: AOJu0Yxf6zKsY8DJGcRbcf6UzWQt7hZfXs8/M89Ft3F7wrUMxuUG7dVq nT6IuMpWKeDhVRavZ0QuVPU= X-Google-Smtp-Source: AGHT+IEhDSqptuev1J1naXxm3a/UxQ0sbZwl/F7QJsWMTFagFfpV0hRL5gThky6ZRvpCEQ3UCi8Y9g== X-Received: by 2002:a17:906:c116:b0:a04:a111:4901 with SMTP id do22-20020a170906c11600b00a04a1114901mr4929890ejc.18.1702764771290; Sat, 16 Dec 2023 14:12:51 -0800 (PST) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id un7-20020a170907cb8700b00a1b65249053sm12195023ejc.128.2023.12.16.14.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 14:12:50 -0800 (PST) Message-ID: From: Liliana Marie Prikler Date: Sat, 16 Dec 2023 23:12:49 +0100 In-Reply-To: <9283714a-991e-436a-bb83-fb9254cba5a2@makinata.eu> References: <9283714a-991e-436a-bb83-fb9254cba5a2@makinata.eu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.11 X-Spam-Score: -5.11 X-Migadu-Queue-Id: 7C67A36FDB X-Migadu-Scanner: mx10.migadu.com X-TUID: UMwM33Bi2s9s Am Samstag, dem 16.12.2023 um 19:36 +0000 schrieb Bruno Victal: > Hi Liliana, >=20 > On 2023-12-16 01:44, Liliana Marie Prikler wrote: > > Am Freitag, dem 15.12.2023 um 21:02 +0000 schrieb Bruno Victal: > > > -(define-maybe/no-serialization integer) > > > +(define-maybe/no-serialization exact-integer) > > At the risk of asking a silly question, what's the difference > > between an integer and an exact integer? >=20 > IIUC it has to do with whether a decimal point is present or not, > which influences the serialization process. (e.g. having port set > to 8080.0 doesn't make much sense even though it is an integer) I don't think we have to make this distinction that often, though; and if we do, there are more fitting descriptions like signed-integer and unsigned-integer. Even if it's to guard against silly inputs, most folks wouldn't write 8080.0 there. > --8<---------------cut here---------------start------------->8--- > $ cat integer-dem.scm > #!/usr/bin/env -S guile --no-auto-compile > !# >=20 > (for-each > =C2=A0(lambda (s) > =C2=A0=C2=A0 (format #t "Formatted output: ~a~%" s) > =C2=A0=C2=A0 (format #t "number->string: ~a~%" (number->string s)) > =C2=A0=C2=A0 (format #t "Integer? ~a~%" (integer? s)) > =C2=A0=C2=A0 (format #t "Exact-integer? ~a~%" (exact-integer? s)) > =C2=A0=C2=A0 (newline)) > =C2=A0(list 64 128.0)) >=20 > $ ./integer-dem.scm > Formatted output: 64 > number->string: 64 > Integer? #t > Exact-integer? #t >=20 > Formatted output: 128.0 > number->string: 128.0 > Integer? #t > Exact-integer? #f > --8<---------------cut here---------------end--------------->8--- >=20 > > > =C2=A0=C2=A0 (port > > > -=C2=A0=C2=A0 (maybe-port 80) > > > -=C2=A0=C2=A0 "HTTP port to listen on.") > > > +=C2=A0=C2=A0 (maybe-exact-integer 80) > > Losing the information that this is a port (i.e. only integers that > > fit > > into a uint16 are valid) is imho not great. >=20 > I'm not too happy with this either, though in hindsight I think > redefining 'port?' (from Guile Ports) was a bad idea. At the moment > the (re)defined port? predicate only checks whether the value is an > integer, so switching it to exact-integer doesn't seem to change > things much. (other than being stricter in criteria) Maybe port-number? is clearer? > Alternatively we could have a proper predicate, perhaps named ip- > port? that would not only perform the exact-integer? check, but also > test whether it fits within a uint16. I'm more inclined to introduce > this kind of change in a separate series that would define it in a > reusable manner and perform a cleanup run across the existing > services though. >From my point of view you are already introducing "this kind of change" as not a separate series :) Cheers