From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.devel Subject: Re: Strongly typed language my ass Date: Tue, 20 Sep 2022 23:58:48 +0200 Message-ID: <47D877C0-2573-4C35-9D23-D2E80B351ABB@abou-samra.fr> References: <3izAWevitpu2Y1OBwQnrCwhVv4CePmVfWKxl-0oCg1yBwy1TfQcHwbHBUk9iNaZcK5WYKxmxebrZpwXAK5qM3s36qWzc1UBHH2D2XbB3jJ0=@rixotstudio.cz> Mime-Version: 1.0 (1.0) Content-Type: multipart/alternative; boundary=Apple-Mail-1B1E3728-9C19-43FD-B615-BE7CECEEE385 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19960"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org To: Jacob Hrbek Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Sep 21 01:55:57 2022 Return-path: Envelope-to: guile-devel@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 1oan5o-0004wU-Jv for guile-devel@m.gmane-mx.org; Wed, 21 Sep 2022 01:55:56 +0200 Original-Received: from localhost ([::1]:45328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oan5n-0000Ac-Jl for guile-devel@m.gmane-mx.org; Tue, 20 Sep 2022 19:55:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oalGf-0000KO-88 for guile-devel@gnu.org; Tue, 20 Sep 2022 17:59:01 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.73]:57951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oalGd-0001xN-85 for guile-devel@gnu.org; Tue, 20 Sep 2022 17:59:00 -0400 Original-Received: from smtpclient.apple ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MFKCV-1oUOPa1SS9-00FhHd; Tue, 20 Sep 2022 23:58:51 +0200 In-Reply-To: <3izAWevitpu2Y1OBwQnrCwhVv4CePmVfWKxl-0oCg1yBwy1TfQcHwbHBUk9iNaZcK5WYKxmxebrZpwXAK5qM3s36qWzc1UBHH2D2XbB3jJ0=@rixotstudio.cz> X-Mailer: iPhone Mail (19H12) X-Provags-ID: V03:K1:IiRlSd2cTh61Xlg5Y2MqxwNRKBrv5CMvLCYxbz/MdDMM1wXITcs kkve+BzdzAwfVRivDBPHX/ECEy0z+axtHy1PeApVXUr3/lQiVKLhvkeUi7Zap/AmEdYtJpR 2g9yXV87jB4Ju1gFQqxhDL9kJWu8Id5o5DF04lOgpVEEfratibn9r7LGPJEMLjiS3fAAf5L wHmXy5XvToS8UvYe0BUsg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Xk6KehzSPyg=:PkkrYmuc+C9CilTus97NFJ mtBskdYzlZNrtJ4gq76rzyDtDO4qwswSiKwT2FNrgJg9EcVmPQivd6PHOBhEWFukZIDpEDVFu 9k1Rf+N6ho5/WO/PR5UHhXpaJq07WKhjUUSyHdBqqoYdeskuRTcw4SSfjQ/JMHTysgiMKZHug NZTL2mxdyj+qFeo0TwSSHHZtPWhN+jQxzTgMceXjI8A+awu5gaD/DQDzwXyxuq3rrqsc/OPx0 E/5WZi3yCGQPrx5LlZdO8AqKsi+DKDnEDppz4giL2JX8ZroptTsR/PF4YyhR5GrajoBvbhCTH nqYZX6co0oDeHWJC3MkkL0Xh6dUczFYu5hFLqHMiTJEzR7z/xdz2z1d8OV2Jpi11hhXO2ywUt d08LvNLvQSTuFYr+YU+9e/47BIAM7mriN33LJx48eL+fYx0LzwsohMi5qJpQ1avxJYUcMLjDO xV27RlmYjI4gZMD2E3zPOy59QqkW1JTz2kfGdFNjoAZqAfnhTSTYfcthY1JIHmnm38IZSa6iH jXQ7Wqp7KH3yIqV93PJ4BP9qMin5avB5RXDZXx1IniP1UI9Pt8PNEd9wSTYNWeejDGDrmdSAu WXyyT6bI+AAKwV1isUowFTAZjc/AWArm/5IqoXME0QQxk8MEPOald29v1nvi8HxaVF3Q6if2h VHH7KB6Ve4CafeqY8FcISVLSKMcZnAZippF3/fvowM7h/JfTDRsPqVD2LY1oiQa0menQW7frv 4Q5EX8qXyjaqb4WTSBFt1RTZxFqVwW6ooSJXx+XF1SRwJDXPW7tEVdfpoTPD9REtAAuEDWDK Received-SPF: none client-ip=217.72.192.73; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_QP_LONG_LINE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:21358 Archived-At: --Apple-Mail-1B1E3728-9C19-43FD-B615-BE7CECEEE385 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Le 20 sept. 2022 =C3=A0 23:44, Jacob Hrbek a =C3=A9= crit : >=20 > =EF=BB=BF > In what world is this considered a strongly typed language when I need to d= o these checks like it's a weakly typed one? >=20 > (define* (lazy-assign key #:optional (val "")) > "Assign environmental variable KEY with an optional value VAL, both = must be a string or a thunk that evaluates to a string >=20 > This procedure sets an entry in the @{%makevars} hash table" >=20 > (cond ((procedure? key) > (set! key (key))) > ((string? key) > ;; FIXME-QA(Krey): Seems like a wasteful @{format} > (set! key (format #f "~a" key))) > ;; FIXME-QA(Krey): Make sure that the error here is clear and descript= ive > (else (make-non-continuable-error))) >=20 > ;; FIXME-QA(Krey): Add check for sanity of VAL >=20 > (makevars-set key (delay val))) >=20 > Instead of something like: >=20 > (define* (lazy-assign (string-type key) #:optional (val "")) > "Assign environmental variable KEY with an optional value VAL, both must= be a string or a thunk that evaluates to a string >=20 > This procedure sets an entry in the @{%makevars} hash table" >=20 > (makevars-set key (delay val))) >=20 > Notice the (string-type key) meant to declare that it's only expecting an i= nput that is a string or evaluates into a string which mitigates the need to= include sanity checking in every procedure.. >=20 > or even something like: >=20 > (define* (lazy-assign key:string #:optional (var:string "")) ...) >=20 > -- Jacob "Kreyren" Hrbek https://www.gnu.org/software/guile/manual/html_node/GOOPS.html Writing that denigrates is unlikely to attract helpful responses. I won=E2=80= =99t reply further. --Apple-Mail-1B1E3728-9C19-43FD-B615-BE7CECEEE385 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

Le 20 sept. 2022 =C3=A0= 23:44, Jacob Hrbek <kreyren@rixotstudio.cz> a =C3=A9crit :
=EF=BB=BFIn what world is this consi= dered a strongly typed language when I need to do these checks like it's a w= eakly typed one?

    (define* (lazy-assign key #= :optional (val ""))
      "Assign envi= ronmental variable KEY with an optional value VAL, both  must be a stri= ng or a thunk that evaluates to a string

    This procedure sets an entry in the @{%make= vars} hash table"

     = (cond ((procedure? key)
    (set! key (key= )))
    ((string? key)
    ;; FIXME-QA(Krey): Seems like a wasteful @{format}
    (set! key (format #f "~a" key)))
    ;; FIXME-QA(Krey): Make sure that the error here is c= lear and descriptive
    (else (make-non-co= ntinuable-error)))

     = ; ;; FIXME-QA(Krey): Add check for sanity of VAL

=
      (makevars-set key (delay val)))
=

Instead of something like:

  (define* (lazy-assign (string-type key) #:optiona= l (val ""))
 = ; "Assign environmental variable KEY with an optional value VAL, both must b= e a string or a thunk that evaluates to a string

  This proc= edure sets an entry in the @{%makevars} hash table"

  (makevars-set key (delay val)))

Notice the (string-type key) meant to declare that it's only ex= pecting an input that is a string or evaluates into a string which mitigates= the need to include sanity checking in every procedure..

or even som= ething like:

    (define* (lazy-assign key:string #:optiona= l (var:string "")) ...)

-- Jacob "Kreyren" Hrbek




Writing t= hat denigrates is unlikely to attract helpful responses. I won=E2=80=99t rep= ly further.

= --Apple-Mail-1B1E3728-9C19-43FD-B615-BE7CECEEE385--